|
|
Joined: Jun 2001
Posts: 729
Coder
|
Coder
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
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
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.
|
|
|
|
Joined: Jun 2001
Posts: 729
Coder
|
Coder
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.
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
in cp.cgi, try the following: (untested) find: code:
my $is_one = &is_admin_or_mod("ALL", @this_admin);
replace with: code: [qb] my $is_one = $this_admin[8] eq 'Administrator'; [/qb] cp_lib.cgi: Find code:
if (($profile[8] ne 'Administrator') && ($profile[8] ne 'Moderator')) {
Replace with: code: [qb] if ($profile[8] ne 'Administrator') { [/qb]
|
|
|
|
Joined: Jun 2001
Posts: 729
Coder
|
Coder
Joined: Jun 2001
Posts: 729 |
Ok, made the changes and it does block logins except for admins  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  Thanx LK!
|
|
|
|
Joined: Mar 2001
Posts: 7,394
Admin / Code Breaker
|
Admin / Code Breaker
Joined: Mar 2001
Posts: 7,394 |
Instead of: code:
my $is_one = $this_admin[8] eq 'Administrator';
Try: code: [qb]chomp($this_admin[8]); my $is_one = 0; if ($this_admin[8] eq 'Administrator') { $is_one = 1; } [/qb]
|
|
|
|
Joined: Aug 2000
Posts: 874
Moderator / Developer
|
Moderator / Developer
Joined: Aug 2000
Posts: 874 |
Or you could just use this: my $is_one = &is_admin_or_mod("NONE", @this_admin);
|
|
|
|
Joined: Jun 2001
Posts: 729
Coder
|
Coder
Joined: Jun 2001
Posts: 729 |
Exact same problem 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!
|
|
|
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.
|
|
Posts: 808
Joined: July 2001
|
|
Forums63
Topics37,575
Posts293,932
Members13,824
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|