vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   administrator permissions problem (https://vborg.vbsupport.ru/showthread.php?t=96227)

WMR 09-14-2005 02:57 AM

administrator permissions problem
 
for some reason i cant edit administrator permissions on my forum, here is the error that i get

Quote:

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:

PHP Code:

// ############################# 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

PHP Code:

IF(administrator.userid IS NULL012

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.

Quote:

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

The 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.


All times are GMT. The time now is 04:42 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.00986 seconds
  • Memory Usage 1,724KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete