MyBB Community Forums

Full Version: Super admin
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I tryed to make someone super admin but it showed and error.
so i fixed it.
but now im afraid that i might get it wrong again and it will screw up forever
is it
$config['super_admins'] = '1,2';
?
You may also put it as:
$config['super_admins'] = 'username1, username2'; 
Put you still have to set all the admin permissions for username2 to "Yes" in the ACP.
maatty Wrote:You may also put it as:
$config['super_admins'] = 'username1, username2'; 
Put you still have to set all the admin permissions for username2 to "Yes" in the ACP.

Since when will that work?

It requires the UID. It's the only way
Tikitiki Wrote:Since when will that work?

It requires the UID. It's the only way

That is how it works in my forum config.php file. You may try it yourself.
maatty Wrote:
Tikitiki Wrote:Since when will that work?

It requires the UID. It's the only way

That is how it works in my forum config.php file. You may try it yourself.

No it does not. I checked the code myself and there is NOTHING that converts usernames to uids.

Wanna see the code yourself?

/**
 * Checks if a certain user ID is in the list of super administrators
 *
 * @param int The user ID to be checked
 * @return boolean true when the user is a super admin, false when not
 */
function is_super_admin($uid)
{
	global $config;
	$config['super_admins'] = str_replace(" ", "", $config['super_admins']);
	if(strpos(",{$config['super_admins']},", ",{$uid},") === false)
	{
		return false;
	}
	else
	{
		return true;
	}
}

Does it looks like usernames will work?
Tikitiki Wrote:Does it looks like usernames will work?
According to the adminfunctions.php, it shouldn't at all--that is what the logic says, but if I always had the same config.php file, ever since the first version I used, with this:
$config['super_admins'] = 'maatty, admin';
and it still works with no problem whatsoever, then I'd be curious to know how and why is this happening? Does mybb disobey its own logic? I wonder?
Are you sure it's working? The super_admin variable isn't used all that often. It's not required to simply view the admincp or use it.

If you try my mybb ezsql plugin...that uses the super_admin variable...try it and see if it works.

http://mods.mybboard.net/view/mybb-ezsql
labrocca Wrote:If you try my mybb ezsql plugin...that uses the super_admin variable...try it and see if it works.

http://mods.mybboard.net/view/mybb-ezsql
I have been using that wonderful plugin since it came out. Here is a screen shot of this simple query: "SELECT * FROM mybb_adminlog;":

[Image: admin.jpg]
Try banning one of the accounts then.

If it works then you have a code modification, if it doesn't then it means that the EZSql has a bug.
Tikitiki Wrote:Try banning one of the accounts then.

If it works then you have a code modification, if it doesn't then it means that the EZSql has a bug.

I'm on the habit of banning users on daily basis; nevertheless, I have just banned the other super_admin. I didn't know that even admins can be banned with a click of a button!

Most probably, as you said, there is a code modification which makes it possible to totally ignore the super_admins usernames in the config.php. I'll have a look at all the code mods to see which one is doing this miracle.Big Grin
Pages: 1 2