<input id="addAdmin" type="button" value="Add Admin"></input> <?php $result = mysql_query("select * from user where admin=1"); if (mysql_num_rows($result) >= 1) { while ($row = mysql_fetch_assoc($result)) { ?> <div> <span class="username"><?php echo $row['username']; ?> </span> <input class="removeAdmin" type="button" value="Remove Admin"></input> </div> <?php } } ?> </body> </html> <?php } else { if ($method == "add") { add_admin($username); return "{message:'{$username} added to admin list.'}"; } else { if ($method == "remove") { remove_admin($username); return "{message:'{$username} removed from admin list.'}"; } } }
redraw_page(); break; case 'view_logs': view_logs(); break; case 'edit_config': edit_config(); break; case 'edit_admins': edit_admins(); break; case 'add_admin': add_admin(); break; case 'remove_admin': remove_admin(); break; case 'push_changes': push_changes(); break; case 'create_user': create_user(); break; case 'remove_user': remove_user(); break; case 'view_users': view_users(); break; case 'view_user_details': view_user_details();
} if (is_team_admin($user, $team)) { error_page(tra("%1 is already an admin of %2", $email_addr, $team->name)); } $now = time(); $ret = BoincTeamAdmin::insert("(teamid, userid, create_time) values ({$team->id}, {$user->id}, {$now})"); if (!$ret) { error_page(tra("Couldn't add admin")); } } $user = get_logged_in_user(); $teamid = get_int('teamid'); $team = BoincTeam::lookup_id($teamid); if (!$team) { error_page(tra("No such team")); } require_founder_login($user, $team); $action = get_str('action', true); switch ($action) { case 'remove': check_tokens($user->authenticator); remove_admin($team); Header("Location: team_admins.php?teamid={$teamid}"); exit; case 'add': check_tokens($user->authenticator); add_admin($team); Header("Location: team_admins.php?teamid={$teamid}"); exit; } show_admins($user, $teamid);
<button class="btn btn-primary" name='get_email' value='1'>Save</button> </td> </tr> </form> </table> <?php if (isset($_POST['submit']) and $_POST['submit'] == 1) { $result = add_admin($dbc, $_POST['adminQuery']); if ($result == 1) { echo "<br>Admin successfully added."; } else { echo "<br>Unable to add admin."; } } if (isset($_POST['submit']) and $_POST['submit'] == 2) { $result = remove_admin($dbc, $_POST['adminQuery']); if ($result == 1) { echo "<br>Admin successfully removed."; } else { echo "<br>Unable to remove admin."; } } if (isset($_POST['get_email'])) { if (isset($_POST['checket'])) { $var = set_get_email($dbc, $_SERVER['HTTP_QUEENSU_NETID'], 1); } else { $var = set_get_email($dbc, $_SERVER['HTTP_QUEENSU_NETID'], 0); } if ($var == 1) { ?> <script language="JavaScript">