PDA

View Full Version : Admin/Mod CP Permissions question


Club3G
06-20-2005, 11:00 PM
Hi all,

I have several supermods on my site that I allow limited control panel permisisons (users, calendars, etc).

The problem that I'm having is that any of the hacks I have installed don't seem to check the permissions, so in their admincp menu, they get the vbulletin options that I allow them, plus the dropdowns for all of my installed hacks.

How can I set a permission check so that the menus aren't displayed for anyone other than "real" administrators for the added menus?

Or, shorter question if nobody knows offhand - what's the name of the admin panel menu template?

Thanks!

Andreas
06-20-2005, 11:07 PM
The ACP doesn't use Templates at all.
If you want to introduce custom admin permissions, several steps are necessary:

Edit init.php array $_BITFIELD['usergroup']['adminpermissions'] to include the new permissions.
To avoid problems with new vBulletin versions using the same bits for other permissions I suggest to use 2^31 first, then 2^30 and so on
In admincp/index.php wrap all custom navgroups with:

if (can_administer('canadminhack1'))
{
// Navigation stuff for Hack1 here
}

Edit all Hacks CP files to include

if (!can_administer('canadminhack1'))
{
print_cp_no_permission();
}

at the top (after calling global.php)

Paul M
06-20-2005, 11:11 PM
or as an alternative, you could suround them with an if using an existing permission that they don't have.

Andreas
06-20-2005, 11:13 PM
Yep, this would also be an option.

Club3G
06-20-2005, 11:16 PM
Thank you very much guys, worked like a charm. :D