Previous Thread
Next Thread
Print Thread
Rate Thread
#179599 10/27/2002 11:54 AM
Joined: Jun 2001
Posts: 729
Coder
Coder
Offline
Joined: Jun 2001
Posts: 729
Well I am not exactly new but had no idea where else to post this.

How can I block ALL logins to the control panel except for admins?

TIA

Sponsored Links
#179600 10/27/2002 11:57 AM
Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
Search google for info about how to use .htaccess and .htpasswd, and how to make it only for a specific file: cp.cgi.

#179601 10/27/2002 1:01 PM
Joined: Jun 2001
Posts: 729
Coder
Coder
Offline
Joined: Jun 2001
Posts: 729
I know .htaccess and .htpasswd but did not want another level of IDs/passwords to manage.

I am trying to keep things integrated in to 1 package for all UBB functions. There are already too many passwords for other areas of the system and did not want to add another password for the admins to have to remember.

#179602 10/27/2002 1:11 PM
Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
in cp.cgi, try the following: (untested)
find:
Quote
code:
Code
	my $is_one = &is_admin_or_mod("ALL", @this_admin);

replace with:
code:
[qb]
Code
	my $is_one = $this_admin[8] eq 'Administrator';
[/qb]
cp_lib.cgi:
Find
Quote
code:
Code
	if (($profile[8] ne 'Administrator') && ($profile[8] ne 'Moderator')) {

Replace with:
code:
[qb]
Code
	if ($profile[8] ne 'Administrator') {
[/qb]

#179603 10/27/2002 1:37 PM
Joined: Jun 2001
Posts: 729
Coder
Coder
Offline
Joined: Jun 2001
Posts: 729
Ok, made the changes and it does block logins except for admins smile Only problem now is if I select an option from the control panel it tells me.

"Only administrators or moderators may perform this action."

Your close laugh Thanx LK!

Sponsored Links
#179604 10/27/2002 1:46 PM
Joined: Mar 2001
Posts: 7,394
LK Offline
Admin / Code Breaker
Admin / Code Breaker
Offline
Joined: Mar 2001
Posts: 7,394
Instead of:
Quote
code:
Code
	my $is_one = $this_admin[8] eq 'Administrator';

Try:
code:
[qb]
Code
chomp($this_admin[8]); my $is_one = 0; if ($this_admin[8] eq 'Administrator') { $is_one = 1; }
[/qb]

#179605 10/27/2002 2:23 PM
Joined: Aug 2000
Posts: 874
Moderator / Developer
Moderator / Developer
Offline
Joined: Aug 2000
Posts: 874
Or you could just use this:

Code
	my $is_one = &is_admin_or_mod("NONE", @this_admin);

#179606 10/27/2002 2:27 PM
Joined: Jun 2001
Posts: 729
Coder
Coder
Offline
Joined: Jun 2001
Posts: 729
Exact same problem frown

BUT...

I changed cp.cgi back to the original setting and left cp_lib.cgi changed as you noted and it is now working.

Tried Jordo's code and it seems to be working as well.

Thanx LK & Jordo!


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
Zarzal
Zarzal
Berlin, Germany
Posts: 808
Joined: July 2001
Forum Statistics
Forums63
Topics37,575
Posts293,932
Members13,824
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,835
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)