Moderator permissions

Moderator permissions can be defined in any page by using the predefined auth class.

Moderator Only Variables and Switches
You can use variables and switches to define what moderators are able to see. e.g.: $template->assign_vars(array( 'MY_VARIABLE'	=> ($auth->acl_get('m_')) ? $variable_for_moderator : $variable_for_user, // or a switch (better) 'S_IS_MODERATOR'=> ($auth->acl_get('m_')) ? true : false, // moderator has lock permissions, to lock the currently viewable topics within a forum. 'S_CAN_LOCK'	=> ($auth->acl_get('m_lock')) ? true : false, // moderator has ban permissions. // Ban permissions are global, and therefor not limited to a specific forum 'S_CAN_BAN'		=> ($auth->acl_get('m_ban')) ? true : false, ));

Usage within templates: (example)
I am a Moderator!I am not a Moderator I can lock topicsEven if I have some Moderator permissions, I cannot lock topics I can ban people!!I watch can’t ban people

{MY_VARIABLE}

Restricting Scripts/Pages to Moderators
session_begin; $auth->acl($user->data); $user->setup('common');

// is the user logged in? if (!$user->data['is_registered']) {   if ($user->data['is_bot']) {       // the user is a bot, send them back to home plate... redirect(append_sid("{$phpbb_root_path}index.$phpEx")); }   // the user is not logged in, give them a chance to login here... login_box('', 'LOGIN'); } else if (!$auth->acl_get('m_')) {   // the user is logged in, but they do not have Moderator permissions, give them a nice warning message trigger_error('NOT_AUTHORISED'); }

// the rest of your script/page

// you can also be specific with the moderator permissions... // to give access to ONLY those moderators who have ban permissions (for example) // we would have used the following code above. else if (!$auth->acl_get('m_ban')) {	// the user does not have moderator ban permissions... trigger_error('NOT_AUTHORISED'); }