PDA

View Full Version : administrator permissions problem


WMR
09-14-2005, 02:57 AM
for some reason i cant edit administrator permissions on my forum, here is the error that i get

Database error in vBulletin 3.0.8:

Invalid SQL:
SELECT user.userid, user.username, administrator.adminpermissions, administrator.cssprefs,
IF(administrator.userid IS NULL, 0, 1, 2) AS isadministrator
FROM user AS user
LEFT JOIN administrator AS administrator ON(administrator.userid = user.userid)
WHERE user.userid = 2

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ' 2) AS isadministrator
FROM user AS user
LEFT JOIN admin

mysql error number: 1064

by an error the member #1 was deleted and now the main admin is member#2, just to let u know

any clue what shud be done ?
please help :disappointed:

Andreas
09-14-2005, 03:11 AM
You've edited admincp/adminpermissions.php by any chance?

It must look like this in the File, no matter what the Userid is:


// ############################# LOG ACTION ###############################
globalize($_REQUEST, array('userid' => INT));

if ($userid)
{
$user = $DB_site->query_first("
SELECT user.userid, user.username, administrator.adminpermissions, administrator.cssprefs,
IF(administrator.userid IS NULL, 0, 1) AS isadministrator
FROM " . TABLE_PREFIX . "user AS user
LEFT JOIN " . TABLE_PREFIX . "administrator AS administrator ON(administrator.userid = user.userid)
WHERE user.userid = $userid
");

WMR
09-14-2005, 03:16 AM
thats how it is.. i did not edit that file :/

Andreas
09-14-2005, 03:18 AM
Normally, that can't be :)

The SQL Error eMail should also tell the Script where the error happened.
What does it read there?

Feel free to send me a PM with FTP/ACP access and i'll take a look.

Marco van Herwaarden
09-14-2005, 08:59 AM
IF(administrator.userid IS NULL, 0, 1, 2)
The IF clause only take 3 parameters:
- The condition
- True value
- False value

You have a third value there, and that must be because you have edited some file.

by an error the member #1 was deleted and now the main admin is member#2, just to let u knowThe userid of the main admin doesn't matter. The only place where you would have to make an edit, is in the includes/config.php to include the new userid in the superadmins variable.