當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SessionUtils::setError方法代碼示例

本文整理匯總了PHP中SessionUtils::setError方法的典型用法代碼示例。如果您正苦於以下問題:PHP SessionUtils::setError方法的具體用法?PHP SessionUtils::setError怎麽用?PHP SessionUtils::setError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SessionUtils的用法示例。


在下文中一共展示了SessionUtils::setError方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: signIn

 public function signIn()
 {
     try {
         $model = $this->getModel();
         $userAjax = NULL;
         if (isset($_GET["loginForm"])) {
             $userAjax = json_decode($_GET["loginForm"], true);
             $user = $model->signInModel($userAjax);
             //                var_dump($user->jsonSerialize());die;
             echo json_encode($user->jsonSerialize());
         } else {
             $user = $model->signInModel($userAjax);
             if (get_class($user) !== USERDTO) {
                 SessionUtils::setError($user);
                 header("Location: " . URL . LOGIN_CONTROLLER);
                 exit;
             } else {
                 header("Location: " . URL . HOME_CONTROLLER);
                 exit;
             }
         }
     } catch (PDOException $pdoe) {
         throw $pdoe;
     } catch (Exception $e) {
         throw $e;
     }
 }
開發者ID:sbadi,項目名稱:shareatrip,代碼行數:27,代碼來源:Login.php

示例2: deleteAlbum

 public function deleteAlbum($albumId)
 {
     try {
         $model = $this->getModel();
         $deletedAlbum = $model->deleteAlbumModel($albumId);
         if (isset($_POST[JAVASCRIPT_ON]) && $_POST[JAVASCRIPT_ON] === "Y") {
             echo json_encode($deletedAlbum->jsonSerialize());
         } else {
             SessionUtils::setError($deletedAlbum);
             header("Location: " . URL . ALBUM_CONTROLLER);
             exit;
         }
     } catch (PDOException $pdoe) {
         throw $pdoe;
     } catch (UserNotAuthenticatedExceptionDTO $authExp) {
         parent::userNotLogged($authExp);
     } catch (Exception $e) {
         throw $e;
     }
 }
開發者ID:sbadi,項目名稱:shareatrip,代碼行數:20,代碼來源:Album.php

示例3: forgotPassword

 public function forgotPassword()
 {
     try {
         $model = $this->getModel();
         $forgotPwdjax = NULL;
         if (isset($_GET["forgotPasswordForm"])) {
             $forgotPwdjax = json_decode($_GET["forgotPasswordForm"], true);
             $forgottenPwd = $model->forgotPasswordModel($forgotPwdjax);
             echo json_encode($forgottenPwd->jsonSerialize());
         } else {
             $forgottenPwd = $model->forgotPasswordModel($forgotPwdjax);
             SessionUtils::setError($forgottenPwd);
             header("Location:" . URL . FORGOT_PWD_CONTROLLER);
             exit;
         }
     } catch (PDOException $pdoe) {
         throw $pdoe;
     } catch (Exception $e) {
         throw $e;
     }
 }
開發者ID:sbadi,項目名稱:shareatrip,代碼行數:21,代碼來源:ForgotPwd.php

示例4: deleteUser

 public function deleteUser($userId)
 {
     try {
         $model = $this->getModel();
         $deletedUser = $model->deleteUserModel($userId);
         FileUtils::deleteAlbumDirOnServer($userId, NULL);
         if (isset($_POST[JAVASCRIPT_ON]) && $_POST[JAVASCRIPT_ON] === "Y") {
             echo json_encode($deletedUser->jsonSerialize());
         } else {
             $responseDTO = new ResponseDTO(DELETE_USER_FORM);
             $responseDTO->setResponseSucc("Utente eliminato con successo");
             SessionUtils::setError($responseDTO);
             header("Location: " . URL . USERLIST_CONTROLLER);
             exit;
         }
     } catch (PDOException $pdoe) {
         throw $pdoe;
     } catch (UserNotAuthenticatedExceptionDTO $authExp) {
         parent::userNotLogged($authExp);
     } catch (Exception $e) {
         throw $e;
     }
 }
開發者ID:sbadi,項目名稱:shareatrip,代碼行數:23,代碼來源:UserList.php

示例5: searchUser

 public function searchUser()
 {
     $model = $this->getModel();
     $searchCriteriaFormAjax = NULL;
     $jsonUserDTOList = [];
     try {
         if (isset($_GET["searchForm"])) {
             $searchCriteriaFormAjax = json_decode($_GET["searchForm"], true);
             $foundedResources = $model->searchResourceModel($searchCriteriaFormAjax);
             for ($i = 0; $i < sizeof($foundedResources); $i++) {
                 $index = 'friends' . $i;
                 $jsonUserDTOList[$index] = $foundedResources[$index]->jsonSerialize();
             }
             echo json_encode($jsonUserDTOList);
         } else {
             $foundedResources = $model->searchResourceModel($searchCriteriaFormAjax);
             if (get_class($foundedResources) === RESPONSEDTO) {
                 SessionUtils::setError($foundedResources);
             } else {
                 if (!is_null($foundedResources)) {
                     $responseDTO = new ResponseDTO(SEARCH_USER_FORM);
                     $responseDTO->setResponseSucc($foundedResources);
                     SessionUtils::setError($responseDTO);
                 }
             }
             header("Location: " . URL . FRIENDS_CONTROLLER);
             exit;
         }
     } catch (PDOException $pdoe) {
         throw $pdoe;
     } catch (UserNotAuthenticatedExceptionDTO $authExp) {
         parent::userNotLogged($authExp);
     } catch (Exception $e) {
         throw $e;
     }
 }
開發者ID:sbadi,項目名稱:shareatrip,代碼行數:36,代碼來源:Friends.php

示例6: denyFriendship

 public function denyFriendship($notificationId)
 {
     try {
         $userLogged = SessionUtils::getUserLogged();
         $deleteFriendAjax = NULL;
         $model = $this->getModel();
         if (isset($_POST["denyFriendshipForm"])) {
             $deleteFriendAjax = json_decode($_POST["denyFriendshipForm"], true);
             $deletedFriend = $model->denyFriendshipModel($notificationId, $deleteFriendAjax);
             echo json_encode($deletedFriend->jsonSerialize());
         } else {
             $deletedFriend = $model->denyFriendshipModel($notificationId, $deleteFriendAjax);
             SessionUtils::setError($responseDTO);
             header("Location: " . URL . NOTIFICATION_CONTROLLER);
             exit;
         }
     } catch (PDOException $pdoe) {
         throw $pdoe;
     } catch (Exception $e) {
         throw $e;
     }
 }
開發者ID:sbadi,項目名稱:shareatrip,代碼行數:22,代碼來源:Notification.php

示例7: deleteComment

 function deleteComment($commentId)
 {
     try {
         $model = $this->getModel();
         $deletedComment = $model->deleteCommentModel($commentId);
         if (isset($_POST[JAVASCRIPT_ON]) && $_POST[JAVASCRIPT_ON] === "Y") {
             echo json_encode($deletedComment);
         } else {
             SessionUtils::setError($deletedComment);
             header("Location: " . URL . PROFILE_CONTROLLER);
             exit;
         }
     } catch (PDOException $pdoe) {
         throw $pdoe;
     } catch (UserNotAuthenticatedExceptionDTO $authExp) {
         SessionUtils::logout();
         if (isset($_POST[JAVASCRIPT_ON]) && $_POST[JAVASCRIPT_ON] === "Y") {
             echo json_encode($authExp->jsonSerialize());
         } else {
             header("Location:" . URL . LOGIN_CONTROLLER);
         }
     } catch (Exception $e) {
         throw $e;
     }
 }
開發者ID:sbadi,項目名稱:shareatrip,代碼行數:25,代碼來源:Profile.php

示例8: addPhoto

 public function addPhoto()
 {
     try {
         $model = $this->getModel();
         $newPhotoAjax = NULL;
         if (isset($_POST[JAVASCRIPT_ON]) && $_POST[JAVASCRIPT_ON] === "Y") {
             $newPhoto = $model->addPhotoModel($newPhotoAjax, SessionUtils::getAlbumId());
             echo json_encode($newPhoto->jsonSerialize());
         } else {
             $newPhoto = $model->addPhotoModel($newPhotoAjax, SessionUtils::getAlbumId());
             if (get_class($newPhoto) === PHOTODTO) {
                 $responseDTO = new ResponseDTO(ADD_PHOTO_FORM);
                 $responseDTO->setResponseSucc("Foto aggiunta con successo!");
                 SessionUtils::setError($responseDTO);
             } else {
                 SessionUtils::setError($newPhoto);
             }
             header("Location: " . URL . PHOTO_CONTROLLER);
             exit;
         }
     } catch (PDOException $pdoe) {
         throw $pdoe;
     } catch (UserNotAuthenticatedExceptionDTO $authExp) {
         parent::userNotLogged($authExp);
     } catch (Exception $e) {
         throw $e;
     }
 }
開發者ID:sbadi,項目名稱:shareatrip,代碼行數:28,代碼來源:Photo.php

示例9: changeUserPassword

 public function changeUserPassword()
 {
     try {
         $model = $this->getModel();
         $changePasswordAjax = NULL;
         if (isset($_POST["changeUserPassword"])) {
             $changePasswordAjax = json_decode($_POST["changeUserPassword"], true);
             $newPwdInfo = $model->changeUserPwdModel($changePasswordAjax);
             if (get_class($newPwdInfo) === USERDTO) {
                 SessionUtils::logout();
             }
             echo json_encode($newPwdInfo->jsonSerialize());
         } else {
             $newPwdInfo = $model->changeUserPwdModel($changePasswordAjax);
             if (get_class($newPwdInfo) === USERDTO) {
                 SessionUtils::logout();
                 header("Location: " . URL . LOGIN_CONTROLLER);
                 exit;
             } else {
                 SessionUtils::setError($newPwdInfo);
                 header("Location: " . URL . PROFILE_SETTINGS_CONTROLLER);
                 exit;
             }
         }
     } catch (UserNotAuthenticatedExceptionDTO $authExp) {
         parent::userNotLogged($authExp);
     } catch (PDOException $pdoe) {
         throw $pdoe;
     } catch (Exception $e) {
         throw $e;
     }
 }
開發者ID:sbadi,項目名稱:shareatrip,代碼行數:32,代碼來源:ProfileSettings.php


注:本文中的SessionUtils::setError方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。