Ejemplo n.º 1
0
 /**
  * Changes visibility of a user.
  */
 public function changeVisibility()
 {
     checkUnauthorizedAccess();
     $userid = UserRepository::getIdByUsername($_SESSION['username']);
     $user = UserRepository::getUserByID($userid);
     if ($user['visibility'] == 1) {
         UserRepository::hideFromUsersList($userid);
         redirect(Route::get("listUsers")->generate());
     } else {
         UserRepository::showInUsersList($userid);
         redirect(Route::get("listUsers")->generate());
     }
 }