Page 1 of 1

PhpBB Security/Special error [SOLVED]

PostPosted: Tue Jan 30, 2007 2:54 am
Author: Leadfoot
Your phpBB Version: 2.0.
phpBB Type: Standard phpBB
MODs: No
Your knowledge: Basic Knowledge
Board URL: http://www.csasylum.com

PHP Version:
MySQL Version:


What was done before the problem appeared?
upgraded to 141


What was done to try to solve the problem?
posted here



De.scription and Message

When I go into the acp/security/special page i see this:


phpBB Security :: Special Fields
Protect admin & moderator accounts
Disabling this, will not stop any extra admins or mods added. Enabled Disabled
Amount of allowed admins
This number will set how many admins are allowed to be on your site. So no one can inject an admin account to gain access.
You currently have 3 real users set to 'Admin' status in the users table. It appears you have more admins in the users table than allowed!
Amount of allowed mods
This number will set how many moderators are allowed to be on your site. So no one can inject a moderator account to gain access.
You currently have 9 real users set to 'Moderator' status in the users table. It appears you have more mods in the users table than allowed!

I try to enable it and set the proper number of admins and mods and I still get the same thing. Any Ideas guys?

Re: PhpBB Security/Special error

PostPosted: Tue Jan 30, 2007 2:59 am
Author: DjPorkchop
Sounds like you didnt copy the fields in your phpBB_security.php and fix it after upgrade.

Maybe if your lucky you got a backup copy of that file somewhere and can copy your correct config info over.

I stand to be corrected if Im wrong.

PostPosted: Tue Jan 30, 2007 3:11 am
Author: Leadfoot
i have a backup of my old forums. So if I copy over that file it should be ok? Not sure if your meaning a db fix or a file fix?

Re: PhpBB Security/Special error

PostPosted: Tue Jan 30, 2007 3:17 am
Author: DjPorkchop
NB: Please follow these instructions in the order they are given. If the procedure isn't followed precisely, the updating and installing of database tables will be affected.


Step 1.

Open the file root/includes/phpbb_security.php and find the following code that contains three functions.


function phpBBSecurity_AdminConfigName()
{
return 'phpBBSecurity_max_admins';
}

function phpBBSecurity_ModConfigName()
{
return 'phpBBSecurity_max_mods';
}

function phpBBSecurity_UseSpecial()
{
return 'phpBBSecurity_use_max';
}

The return values may vary... It's important to save this information you'll need it later (ref. step 6).

Step 6.

Now it's time to use the information you obtained in step 1 from the root/includes/phpbb_security.php file.

Open the new root/includes/phpbb_security.php file on your server and replace the three functions with
the functions from your old phpbb_security.php file (See Step 1).

Re: PhpBB Security/Special error

PostPosted: Tue Jan 30, 2007 4:00 am
Author: Teelk
If you used the automatic update .script from the downloads section you'll need to get the fields from the database. The db update .script randomly generates these fields in 141 and in the update to 141.

To find out what the fields, do a search in phpmyadmin. Search for these three fields...

sec_admin
sec_mod
sec_name

The values of each are the return values for those functions. So, if you searched for sec_admin and it's value was qwertyuiop, then you would have the following in the code.

function phpBBSecurity_AdminConfigName()
{
return 'qwertyuiop';
}

function phpBBSecurity_ModConfigName()
{
return 'phpBBSecurity_max_mods';
}

function phpBBSecurity_UseSpecial()
{
return 'phpBBSecurity_use_max';
}

PostPosted: Tue Jan 30, 2007 12:08 pm
Author: Leadfoot
Great fix thanks Teelk and MWE. Working fine now so it seems

PostPosted: Fri Feb 09, 2007 12:13 am
Author: Omni-Lee
Are the fields listed here within a specific table? If so, which table or can someone give me the sql command to search for a given field set across a database of tables?

SELECT sec_admin FROM *;

did not work.

I manually went through every table sec_admin nor any of the other two fields exist.

Re: PhpBB Security/Special error [SOLVED]

PostPosted: Fri Feb 09, 2007 1:07 pm
Author: Leadfoot
go to your database and click on phpbb_config. Then click on browse. You will see that you will get over 20 pages if you database displays 30 per page. I reset my view to 300 per page and then as I loaded each page to view use your ie/edit/find on this page button and search sec_admin. I believe that with 300 lines per page it will be on page 2. Least thats were mine is. All three lines will be one after the other.
Hope this helps

PostPosted: Fri Feb 09, 2007 2:00 pm
Author: Omni-Lee
Wow, thanks. I found it and fixed the missing entries.

A lesson well learned!

PostPosted: Fri Feb 09, 2007 3:59 pm
Author: Leadfoot
ya I hear ya I just learned it last week!!