break; //--------------- SET_ADMIN ------------------ //--------------- SET_ADMIN ------------------ case 'set_admin': if ($params['isAdmin'] == 'true') { echo json_encode($admin->add_admin($params['login'])); } else { echo json_encode($admin->remove_admin($params['login'])); } break; //--------------- GET_USERS ------------------ //--------------- GET_USERS ------------------ case 'get_users': foreach ($auth->get_users() as $login => $pass) { $users[] = array('login' => $login, 'isAdmin' => $admin->is_admin($login)); } unset($login); unset($pass); echo json_encode($users); break; //--------------- REMOVE_USER ------------------ //--------------- REMOVE_USER ------------------ case 'remove_user': echo json_encode($auth->remove_user($params['login'])); break; //--------------- RESET_USER ------------------ //--------------- RESET_USER ------------------ case 'reset_user': echo json_encode($auth->reset_password($params['login'])); break; }