if (isset($_REQUEST['action']) && isset($_SESSION['admin'])) { if ($_REQUEST['action'] == 'logout') { $success = "You are now logged out of the club administration area."; unset($_SESSION['admin']); unset($_SESSION['admin_club_id']); } } } $parameters = array(); if (isset($error)) { $parameters['error'] = $error; } else { if (isset($success)) { $parameters['success'] = $success; } } if (isset($_SESSION['admin'])) { get_page_advanced("index", "admin", $parameters); } else { if (isset($_SESSION['user_id'])) { $parameters['user_loggedin'] = true; $parameters['clubs'] = getAdminGroups($_SESSION['user_id']); } else { $parameters['user_loggedin'] = false; //list normal clubs, and general application $parameters['clubs'] = listClubsIdName(); $parameters['clubs'][0] = 'General application'; $parameters['clubs'][-2] = 'Custom fields'; } get_page_advanced("index_login", "admin", $parameters); }
if (substr($_REQUEST['group_id'], 0, 1) == 'c') { customAlterAdmin($_REQUEST['id'], substr($_REQUEST['group_id_orig'], 1), substr($_REQUEST['group_id'], 1)); } } $success = "Admin updated successfully."; } } } } //get list of possible groups //there are three types we have to consider: // 1. clubs, in user_groups // 2. special groups, in user_groups // 3. custom field groups, in user_custom //we label the first two with g and the third with c $clubsList = listClubsIdName(); $catList = customCategories(); $groupList = array(); $groupList["g0"] = "General application"; $groupList["g-1"] = "Root admin"; //don't include custom field group, because we're including the actual custom categories foreach ($clubsList as $club_id => $club_name) { $groupList["g" . $club_id] = $club_name; } foreach ($catList as $cat_id => $cat_name) { $groupList["c" . $cat_id] = $cat_name; } //now create the list of admins, using same notation as above $adminList = array(); $result = mysql_query("SELECT user_groups.user_id, user_groups.`group`, users.username FROM user_groups LEFT JOIN users ON user_groups.user_id = users.id WHERE user_groups.`group` != '-2' ORDER BY user_groups.`group`"); while ($row = mysql_fetch_array($result)) {