get_acl_admin('auth') ) { return; } $filename = basename(__FILE__); $module['Forums']['Permissions'] = $filename . $SID . '&mode=forums'; $module['Forums']['Moderators'] = $filename . $SID . '&mode=moderators'; $module['Forums']['Super_Moderators'] = $filename . $SID . '&mode=supermoderators'; $module['General']['Administrators'] = $filename . $SID . '&mode=administrators'; return; } define('IN_PHPBB', 1); // // Include files // $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); // // Do we have forum admin permissions? // if ( !$auth->get_acl_admin('auth') ) { message_die(MESSAGE, $lang['No_admin']); } // // Define some vars // if ( isset($HTTP_GET_VARS['f']) || isset($HTTP_POST_VARS['f']) ) { $forum_id = ( isset($HTTP_POST_VARS['f']) ) ? intval($HTTP_POST_VARS['f']) : intval($HTTP_GET_VARS['f']); $forum_sql = " WHERE forum_id = $forum_id"; } else { $forum_id = 0; $forum_sql = ''; } if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) { $mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode']; } else { $mode = ''; } // // Start program proper // switch ( $mode ) { case 'forums': $l_title = $lang['Permissions']; $l_title_explain = $lang['Permissions_explain']; $l_can = '_can'; break; case 'moderators': $l_title = $lang['Moderators']; $l_title_explain = $lang['Moderators_explain']; $l_can = '_can'; break; case 'supermoderators': $l_title = $lang['Super_Moderators']; $l_title_explain = $lang['Super_Moderators_explain']; $l_can = '_can'; break; case 'administrators': $l_title = $lang['Administrators']; $l_title_explain = $lang['Administrators_explain']; $l_can = '_can_admin'; break; } // // Brief explanation of how things work when updating ... // // Granting someone any admin permissions grants them permissions // to all other options, e.g. Moderator and Forums across the board. // This is done via the acl class // if ( isset($HTTP_POST_VARS['update']) ) { switch ( $HTTP_POST_VARS['type'] ) { case 'user': $set = 'set_acl_user'; break; case 'group': $set = 'set_acl_group'; break; } foreach ( $HTTP_POST_VARS['entries'] as $id ) { $auth->$set($forum_id, $id, $HTTP_POST_VARS['option']); } message_die(MESSAGE, 'Permissions updated successfully'); } else if ( isset($HTTP_POST_VARS['delete']) ) { switch ( $HTTP_POST_VARS['type'] ) { case 'user': $set = 'delete_acl_user'; break; case 'group': $set = 'delete_acl_group'; break; } $option_ids = false; if ( !empty($HTTP_POST_VARS['option']) ) { $sql = "SELECT auth_option_id FROM " . ACL_OPTIONS_TABLE . " WHERE auth_value LIKE '" . $HTTP_POST_VARS['option'] . "_%'"; $result = $db->sql_query($sql); if ( $row = $db->sql_fetchrow($result) ) { $option_ids = array(); do { $option_ids[] = $row['auth_option_id']; } while( $row = $db->sql_fetchrow($result) ); } $db->sql_freeresult($result); } foreach ( $HTTP_POST_VARS['entries'] as $id ) { $auth->$set($forum_id, $id, $option_ids); } message_die(MESSAGE, 'Permissions updated successfully'); } // // Get required information, either all forums if // no id was specified or just the requsted if it // was // if ( !empty($forum_id) || $mode == 'administrators' || $mode == 'supermoderators' ) { // // Clear some vars, grab some info if relevant ... // $s_hidden_fields = ''; if ( !empty($forum_id) ) { $sql = "SELECT forum_name FROM " . FORUMS_TABLE . " WHERE forum_id = $forum_id"; $result = $db->sql_query($sql); $forum_info = $db->sql_fetchrow($result); $db->sql_freeresult($result); $l_title .= ' : ' . $forum_info['forum_name'] . ''; } // // Generate header // page_header($l_title); ?>
sql_query($sql); $group_list = ''; while ( $row = $db->sql_fetchrow($result) ) { $group_list .= ''; } $db->sql_freeresult($result); if ( empty($HTTP_POST_VARS['advanced']) || empty($HTTP_POST_VARS['entries']) ) { ?>