$result = $register->forgotPassword($_POST['email']);
     if ($result !== TRUE) {
         echo $result;
     }
     break;
 case "postComment":
     $ASComment = new ASComment();
     echo $ASComment->insertComment(ASSession::get("user_id"), $_POST['comment']);
     break;
 case "updatePassword":
     $user = new ASUser(ASSession::get("user_id"));
     $user->updatePassword($_POST['oldpass'], $_POST['newpass']);
     break;
 case "updateDetails":
     $user = new ASUser(ASSession::get("user_id"));
     $user->updateDetails($_POST['details']);
     break;
 case "changeRole":
     onlyAdmin();
     $user = new ASUser($_POST['userId']);
     echo ucfirst($user->changeRole());
     break;
 case "deleteUser":
     onlyAdmin();
     $user = new ASUser($_POST['userId']);
     if (!$user->isAdmin()) {
         $user->deleteUser();
     }
     break;
 case "getUserDetails":
     onlyAdmin();