本文整理汇总了PHP中SessionUtils类的典型用法代码示例。如果您正苦于以下问题:PHP SessionUtils类的具体用法?PHP SessionUtils怎么用?PHP SessionUtils使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了SessionUtils类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: checkLogin
public function checkLogin($usr = '', $pass = '')
{
/*inicialmente validaremos contra datos preestablecidos que podrían venir por ejemplo, de una base de datos*/
if ($usr == self::$user && $pass == self::$password) {
self::$loggedin = true;
self::$arrUsuario['user'] = self::$user;
$_SESSION['auth_user'] = self::$user;
$_SESSION['auth_pass'] = self::$password;
parent::set("auth_user", self::$user);
parent::set("auth_pass", self::$password);
return true;
} else {
self::$arrUsuario = array();
self::$loggedin = false;
return false;
}
$auth = new SessionUtils();
if ($auth->checkLogin('test', 'test')) {
echo "ok";
print_r($_SESSION);
print_r($_COOKIE);
} else {
echo "fail";
}
}
开发者ID:karinaEsto94,项目名称:proyectoEjemplo,代码行数:25,代码来源:SessionUtils.php
示例2: setUp
protected function setUp()
{
parent::setUp();
$this->deleteAllUsers();
$this->createNewUsers();
SessionUtils::saveSessionObject('user', $this->usersArray['admin']);
}
开发者ID:rakesh-mohanta,项目名称:icehrm,代码行数:7,代码来源:TestTemplate.php
示例3: insertNewUserAddressVisited
public function insertNewUserAddressVisited(\AddressDTO $addressDTO)
{
try {
$this->userAutentication();
$userLogged = SessionUtils::getUserLogged();
$newAddress = array(":" . USERID => $userLogged->getUserId(), ":" . LONGITUDE => $addressDTO->getLongitude(), ":" . LATITUDE => $addressDTO->getLatitude(), ":" . TIMESTAMP => date(DATE_FORMAT));
$newAddressId = $this->getDB()->insert(USER_ADDRESS_VISITED_TABLE, $newAddress);
return $newAddressId;
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (Exception $e) {
throw $e;
}
}
开发者ID:sbadi,项目名称:shareatrip,代码行数:14,代码来源:AddressDAO.php
示例4: testSession
public function testSession()
{
try {
$userLogged = SessionUtils::getUserLogged();
$username = $userLogged->getUserName();
$sessionToken = SessionUtils::getSessionToken();
$query = "select * from sat_user where USERNAME = {$username} and SESSION_TOKEN = {$sessionToken}";
return $this->execQuery($query);
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (Exception $e) {
throw $e;
}
}
开发者ID:sbadi,项目名称:shareatrip,代码行数:14,代码来源:Database.php
示例5: deleteFriendModel
function deleteFriendModel($friendId)
{
try {
$responseDTO = new ResponseDTO(DELETE_FRIEND_FORM);
$friendsDAO = new FriendsDAO();
$oldFriend = $friendsDAO->deleteFriend($friendId);
SessionUtils::deleteFriendInUserLoggedFriendList($friendId);
$responseDTO->setResponseSucc("friend" . $friendId);
return $responseDTO;
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (UserNotAuthenticatedExceptionDTO $authExp) {
throw $authExp;
} catch (Exception $e) {
throw $e;
}
}
开发者ID:sbadi,项目名称:shareatrip,代码行数:17,代码来源:Friends_model.php
示例6: updateProfilePhoto
public function updateProfilePhoto(\PhotoDTO $userProfilePhotoDTO)
{
$userLogged = SessionUtils::getUserLogged();
$set = array(PROFILEPHOTO => $userProfilePhotoDTO->getPhotoId());
$where = array(USERID => $userLogged->getUserId());
try {
$this->userAutentication();
$userPhoto = $this->getDB()->update(USER_TABLE, $set, $where);
DataModelUtils::notifyAction($userProfilePhotoDTO->getPhotoId() . SEPARATOR . $userProfilePhotoDTO->getPhotoUrl(), PROFILE_SETTINGS_PHOTO_FORM);
return $userProfilePhotoDTO;
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (UserNotAuthenticatedExceptionDTO $authExp) {
throw $authExp;
} catch (Exception $e) {
throw $e;
}
}
开发者ID:sbadi,项目名称:shareatrip,代码行数:18,代码来源:PhotoDAO.php
示例7: 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
示例8: uploadPhotoModel
public static function uploadPhotoModel($uploadedPhoto, $albumId, $formType, $latitude = NULL, $longitude = NULL)
{
$responseDTO = new ResponseDTO($formType);
try {
$userLogged = SessionUtils::getUserLogged();
$fileName = $uploadedPhoto["name"];
$fileType = $uploadedPhoto["type"];
$tmpFileName = $uploadedPhoto["tmp_name"];
$rawImage = FileUtils::getRawImage($fileType, $tmpFileName);
$fileName = FileUtils::getFileName($fileName, $userLogged->getUserId(), $albumId);
$redimImage = FileUtils::getRedimensionedImage($tmpFileName, $rawImage);
if (imagejpeg($redimImage, $fileName, 100)) {
$photoDAO = new PhotoDAO();
$newPhotoDTO = new PhotoDTO(NULL, $fileName, $latitude, $longitude);
$newPhotoDTO = $photoDAO->insertNewPhoto($newPhotoDTO);
if ($newPhotoDTO->getPhotoId() == 0) {
$responseDTO->setErrField(ERROR_RESPONSE, "Errore durante l'inserimento della foto [" . $newPhotoDTO->getPhotoUrl() . "]");
} else {
$albumDAO = new AlbumDAO();
if (is_null($albumId)) {
$albumId = $albumDAO->getDefaultAlbumId($userLogged->getUserId());
}
if ($formType !== ADD_ALBUM_FORM) {
$photoInAlbumId = $albumDAO->insertNewUserPhotoAlbum($userLogged->getUserId(), $albumId, $newPhotoDTO->getPhotoId());
}
if (!is_null($latitude) && !is_null($longitude)) {
$uploadedAddress = FileUtils::saveAddressModel($latitude, $longitude, $formType);
}
return $newPhotoDTO;
}
} else {
$responseDTO->setErrField(ERROR_RESPONSE, "Errore durante la copia del file sul server PHP");
}
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (UserNotAuthenticatedExceptionDTO $userAuth) {
throw $userAuth;
} catch (Exception $e) {
throw $e;
}
}
开发者ID:sbadi,项目名称:shareatrip,代码行数:41,代码来源:FileUtils.php
示例9: userAutentication
function userAutentication()
{
try {
$userLogged = SessionUtils::getUserLogged();
$sessionToken = SessionUtils::getSessionToken();
if (!is_null($userLogged)) {
$query = "select * from sat_user where userid = " . $userLogged->getUserId() . " and SESSION_TOKEN = '" . $sessionToken . "'";
$objectArray = $this->getDB()->execQuery($query);
if (is_null($objectArray)) {
$myException = new UserNotAuthenticatedExceptionDTO(URL . LOGIN_CONTROLLER);
throw $myException;
}
}
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (UserNotAuthenticatedExceptionDTO $userAuth) {
throw $userAuth;
} catch (Exception $e) {
throw $e;
}
}
开发者ID:sbadi,项目名称:shareatrip,代码行数:21,代码来源:BaseDataAccess.php
示例10: 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
示例11: forgotPasswordModel
public function forgotPasswordModel($forgotPasswordForm)
{
$formObjRaw = new FormDTO(FORGOT_PWD_FORM, $forgotPasswordForm);
$responseDTO = new ResponseDTO(FORGOT_PWD_FORM);
try {
$formDataObj = $formObjRaw->getFormData();
$validator = new FormValidator(FORGOT_PWD_FORM, $formDataObj);
$validationError = $validator->checkAll();
if (sizeof($validationError) == 0) {
$userDAO = new UserDAO();
$userDTO = $userDAO->getUserByEmail($formDataObj[FORGOT_PWD_FORM . EMAIL]);
if (is_null($userDTO)) {
$responseDTO->setErrField(ERROR_RESPONSE, "Nessun user presente con questa mail");
} else {
$newPassword = PasswordUtils::createRandomicPassword();
$userDTO->setPassword($newPassword);
$resultMail = DataModelUtils::sendMail($userDTO, FORGOT_PWD_FORM);
$hashedPwd = PasswordUtils::getPassword($newPassword);
$userDTO->setPassword($hashedPwd);
$result = $userDAO->updateUserPassword($userDTO);
if ($result != 1) {
$responseDTO->setErrField(ERROR_RESPONSE, "Problema nel cambio della password");
} else {
$responseDTO->setResponseSucc("Verra mandata una mail con una nuova password all'indirizzo " . $userDTO->getEmail());
}
}
} else {
if (array_key_exists(EMAIL, $validationError)) {
$responseDTO->setErrField(EMAIL, $validationError[EMAIL]);
}
SessionUtils::setFormValue($formDataObj);
}
return $responseDTO;
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (Exception $e) {
throw $e;
}
}
开发者ID:sbadi,项目名称:shareatrip,代码行数:39,代码来源:ForgotPwd_model.php
示例12: getUnreadNotificationList
public function getUnreadNotificationList($limit = NULL)
{
$userLogged = SessionUtils::getUserLogged();
if (is_null($limit)) {
$query = "select * from sat_notify where SUBJECT_ID = " . $userLogged->getUserId() . " and IS_READ = 0 order by sent_at desc ";
} else {
$query = "select * from sat_notify where SUBJECT_ID = " . $userLogged->getUserId() . " and IS_READ = 0 order by sent_at desc ";
}
try {
$objectArray = $this->getDB()->execQuery($query);
if (is_null($objectArray)) {
return NULL;
} else {
$objectListDTO = DataModelUtils::getObjectList(NOTIFICATIONDTO, $objectArray);
return $objectListDTO;
}
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (Exception $e) {
throw $e;
}
}
开发者ID:sbadi,项目名称:shareatrip,代码行数:22,代码来源:NotificationDAO.php
示例13: confirmFriendshipModel
public function confirmFriendshipModel($notificationId, $userForm)
{
$formObjRaw = new FormDTO(CONFIRM_FRIENDSHIP_FORM, $userForm);
$formObjRaw->setSubElementId($notificationId);
try {
$formDataObj = $formObjRaw->getFormData();
$friendDAO = new FriendsDAO();
$result = $friendDAO->confirmFriendship($formDataObj[CONFIRM_FRIENDSHIP_FORM . FRIENDID]);
$userDAO = new UserDAO();
$friendDTO = $userDAO->getUserByUserId($formDataObj[CONFIRM_FRIENDSHIP_FORM . FRIENDID]);
$friendDTO->setPassword(NULL);
$notificationDAO = new NotificationDAO();
$result = $notificationDAO->setNotificationAsRead($formDataObj[CONFIRM_FRIENDSHIP_FORM . NOTIFICATIONID]);
SessionUtils::addFriendInUserLoggedFriendList($friendDTO, date(DATE_FORMAT));
DataModelUtils::notifyAction($friendDTO->getUserId() . SEPARATOR . $friendDTO->getUserName(), CONFIRM_FRIENDSHIP_FORM);
return $friendDTO;
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (Exception $e) {
throw $e;
}
}
开发者ID:sbadi,项目名称:shareatrip,代码行数:22,代码来源:Notification_model.php
示例14: getFriendsList
public function getFriendsList($userProfile)
{
if (!SessionUtils::isAdmin()) {
$query = "select ut.*, pt.*, tmp.FRIENDSSINCE \n from sat_user ut, sat_photo pt, ( \n select FRIENDID as USERID,FRIENDSSINCE \n from sat_user_friends \n where USERID = {$userProfile} \n UNION \n select USERID, FRIENDSSINCE \n from sat_user_friends \n where FRIENDID = {$userProfile} \n ) tmp \n where ut.profilephoto = pt.photoid and tmp.USERID = ut.USERID";
} else {
$query = "select distinct ut.*, pt.*, NULL AS FRIENDSSINCE from sat_user ut, sat_photo pt where ut.role <> 'ADMIN' and ut.profilephoto = pt.photoid ";
}
try {
$this->userAutentication();
$objectArray = $this->getDB()->execQuery($query);
if (is_null($objectArray)) {
return NULL;
} else {
$objectListDTO = DataModelUtils::getObjectList(FRIENDSDTO, $objectArray);
return $objectListDTO;
}
} catch (PDOException $pdoe) {
throw $pdoe;
} catch (Exception $e) {
throw $e;
}
}
开发者ID:sbadi,项目名称:shareatrip,代码行数:22,代码来源:FriendsDAO.php
示例15: 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
示例16: getNotificationMessage
public static function getNotificationMessage($object, $context, $direction = NULL)
{
$message = "";
$userLogged = SessionUtils::getUserLogged();
if ($context === REGISTRATION_FORM) {
$user = explode(SEPARATOR, $object);
$message = '<label><a href="' . URL . PROFILE_CONTROLLER . INDEX . $user[0] . '">' . $user[1] . '</a> si vuole registrare su sharetrip.com</label>';
} else {
if ($context === PROFILE_SETTINGS_PHOTO_FORM) {
$userProfilePhotoDTO = explode(SEPARATOR, $object);
$message = '<label><a href="' . URL . PROFILE_SETTINGS_CONTROLLER . INDEX . $userLogged->getUserId() . '">' . $userLogged->getUsername() . '</a> ha cambiato la propria foto del profilo</label>';
} else {
if ($context === ADD_ALBUM_FORM) {
$album = explode(SEPARATOR, $object);
$message = '<label><a href="' . URL . PROFILE_CONTROLLER . INDEX . $userLogged->getUserId() . '"><label>' . $userLogged->getUsername() . '</a> ha aggiunto l\' album ' . '<a href="' . URL . ALBUM_CONTROLLER . INDEX . $album[2] . "/" . $userLogged->getUserId() . '">' . $album[3] . '</a></label>';
} else {
if ($context === CHANGE_SETTINGS_FORM) {
$message = '<label><a href="' . URL . PROFILE_SETTINGS_CONTROLLER . INDEX . $userLogged->getUserId() . '"><label>' . $userLogged->getUsername() . '</a> ha modificato alcune info del profilo.</label>';
} else {
if ($context === WRITE_POST_FORM) {
$post = explode(SEPARATOR, $object);
$message = "";
if ($userLogged->getUserId() === $post[2]) {
$message = '<label><a href="' . URL . PROFILE_CONTROLLER . INDEX . $userLogged->getUserId() . '">' . $userLogged->getUsername() . '</a> ha scritto un nuovo <a href="' . URL . PROFILE_CONTROLLER . INDEX . $post[0] . '/' . $post[1] . '/' . $post[2] . '"> post </a> sulla sua bacheca</label>';
} else {
$message = '<label><a href="' . URL . PROFILE_CONTROLLER . INDEX . $userLogged->getUserId() . '"><label>' . $userLogged->getUsername() . '</a> ha scritto un nuovo <a href="' . URL . PROFILE_CONTROLLER . INDEX . $post[0] . '/' . $post[1] . '/' . $post[2] . '"> post </a> sulla bacheca di <a href="' . URL . PROFILE_CONTROLLER . INDEX . $post[2] . '">' . $post[3] . '</a></label>';
}
} else {
if ($context === WRITE_COMMENT_FORM) {
$comment = explode(SEPARATOR, $object);
$message = '<label><a href="' . URL . PROFILE_CONTROLLER . INDEX . $userLogged->getUserId() . '">' . $userLogged->getUsername() . '</a> ha commentato un <a href="' . URL . PROFILE_CONTROLLER . INDEX . $comment[1] . '/' . $comment[2] . '/' . $comment[3] . '/' . $comment[0] . '"> post </a></label>.';
} else {
if ($context === ADD_PHOTO_FORM) {
$album = explode(SEPARATOR, $object);
$message = '<label><a href="' . URL . PROFILE_CONTROLLER . INDEX . $userLogged->getUserId() . '">' . $userLogged->getUsername() . '</a> ha aggiunto una nuova <a href="' . URL . PHOTO_CONTROLLER . INDEX . $album[2] . '/' . $album[0] . '/' . $userLogged->getUserId() . '">foto</a> nell\' <a href="' . URL . ALBUM_CONTROLLER . INDEX . $album[2] . '/' . $userLogged->getUserId() . '"> album </a></label>';
} else {
if ($context === ADD_FRIEND_FORM) {
$friend = explode(SEPARATOR, $object);
$message = '<label><a href="' . URL . PROFILE_CONTROLLER . INDEX . $userLogged->getUserId() . '">' . $userLogged->getUsername() . '</a> vuole stringere amicizia con te</label>';
} else {
if ($context === CONFIRM_FRIENDSHIP_FORM) {
$friend = explode(SEPARATOR, $object);
if ($direction === TOMYSELF) {
$message = '<label>Hai stretto amicizia con <a href="' . URL . PROFILE_CONTROLLER . INDEX . $friend[0] . '">' . $friend[1] . '</a><label>';
} else {
if ($direction === TOMINENEWFRIEND) {
$message = '<label><a href="' . URL . PROFILE_CONTROLLER . INDEX . $userLogged->getUserId() . '">' . $userLogged->getUsername() . '</a> ha stretto amicizia con te.</label>';
} else {
if ($direction === TOMYFRIENDSLIST) {
$message = '<label><a href="' . URL . PROFILE_CONTROLLER . INDEX . $userLogged->getUserId() . '">' . $userLogged->getUsername() . '</a> ha stretto amicizia con <a href="' . URL . PROFILE_CONTROLLER . INDEX . $friend[0] . '">' . $friend[1] . '</a></label>';
} else {
if ($direction === TOMINENEWFRIENDFRIENDLIST) {
$message = '<label><a href="' . URL . PROFILE_CONTROLLER . INDEX . $friend[0] . '">' . $friend[1] . '</a> ha stretto amicizia con <a href="' . URL . PROFILE_CONTROLLER . INDEX . $userLogged->getUserId() . '">' . $userLogged->getUsername() . '</a></label>';
}
}
}
}
}
}
}
}
}
}
}
}
}
return $message;
}
开发者ID:sbadi,项目名称:shareatrip,代码行数:68,代码来源:DataModelUtils.php
示例17: define
<?php
include "config.base.php";
include "include.common.php";
if (defined('MODULE_PATH')) {
SessionUtils::saveSessionObject("modulePath", MODULE_PATH);
}
define('CLIENT_PATH', dirname(__FILE__));
include CLIENT_PATH . "/include.common.php";
include CLIENT_PATH . "/server.includes.inc.php";
$user = SessionUtils::getSessionObject('user');
$profileCurrent = null;
$profileSwitched = null;
$profileClass = ucfirst(SIGN_IN_ELEMENT_MAPPING_FIELD_NAME);
$profileVar = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
if (!empty($user->{$profileVar})) {
$profileCurrent = BaseService::getInstance()->getElement($profileClass, $user->{$profileVar}, null, true);
if (!empty($profileCurrent)) {
$profileCurrent = FileService::getInstance()->updateProfileImage($profileCurrent);
}
}
if ($user->user_level == 'Admin' || $user->user_level == 'Manager') {
$switchedEmpId = BaseService::getInstance()->getCurrentProfileId();
if ($switchedEmpId != $user->{$profileVar} && !empty($switchedEmpId)) {
$profileSwitched = BaseService::getInstance()->getElement($profileClass, $switchedEmpId, null, true);
if (!empty($profileSwitched)) {
$profileSwitched = FileService::getInstance()->updateProfileImage($profileSwitched);
}
}
}
$activeProfile = null;
开发者ID:bravokeyl,项目名称:ems,代码行数:31,代码来源:includes.inc.php
示例18: init
private function init()
{
$urlArray = $this->getUrlArray();
if (is_null($urlArray)) {
$userLogged = SessionUtils::getUserLogged();
if (!is_null($userLogged)) {
//
header('Location: ' . URL . SessionUtils::getLastPageVisited());
exit;
} else {
if (isset($_COOKIE[SHAREATRIPCOOKIE])) {
header('Location: ' . URL . LOGIN_CONTROLLER . 'autoLogin');
exit;
} else {
header('Location: ' . URL . LOGIN_CONTROLLER);
exit;
}
}
} else {
if ($urlArray[1] === 'index') {
if ($urlArray[0] === 'Profile') {
if (!is_null($urlArray[5])) {
SessionUtils::setPost($urlArray[2]);
SessionUtils::setAuthorId($urlArray[3]);
SessionUtils::setDashboardId($urlArray[4]);
SessionUtils::setComment($urlArray[5]);
} else {
if (!is_null($urlArray[4])) {
SessionUtils::setPost($urlArray[2]);
SessionUtils::setAuthorId($urlArray[3]);
SessionUtils::setDashboardId($urlArray[4]);
} else {
if (!is_null($urlArray[2])) {
SessionUtils::setPost(NULL);
SessionUtils::setAuthorId(NULL);
SessionUtils::setDashboardId($urlArray[2]);
}
}
}
header("Location: " . URL . PROFILE_CONTROLLER);
exit;
} else {
if ($urlArray[0] === 'Photo') {
if (!is_null($urlArray[4])) {
SessionUtils::setAlbumId($urlArray[2]);
SessionUtils::setPhotoId($urlArray[3]);
SessionUtils::setDashboardId($urlArray[4]);
} else {
if (!is_null($urlArray[3])) {
SessionUtils::setAlbumId($urlArray[2]);
SessionUtils::setDashboardId($urlArray[3]);
} else {
if (!is_null($urlArray[2])) {
SessionUtils::setAlbumId($urlArray[2]);
}
}
}
header("Location: " . URL . PHOTO_CONTROLLER);
exit;
} else {
if ($urlArray[0] === 'Album') {
if (!is_null($urlArray[3])) {
SessionUtils::setAlbumId($urlArray[2]);
SessionUtils::setDashboardId($urlArray[3]);
}
header("Location: " . URL . ALBUM_CONTROLLER);
exit;
} else {
if ($urlArray[0] === 'ProfileSettings') {
SessionUtils::setDashboardId($urlArray[2]);
header("Location: " . URL . PROFILE_SETTINGS_CONTROLLER);
exit;
}
}
}
}
}
$url = new UrlDTO($urlArray);
$this->loadController($url->getController());
$this->callControllerMethod($url);
}
}
开发者ID:sbadi,项目名称:shareatrip,代码行数:82,代码来源:CoreApp.php
示例19: setCurrentAdminProfile
public function setCurrentAdminProfile($profileId)
{
if (!class_exists('SessionUtils')) {
include APP_BASE_PATH . "include.common.php";
}
if ($profileId == "-1") {
SessionUtils::saveSessionObject('admin_current_profile', null);
return;
}
if ($this->currentUser->user_level == 'Admin') {
SessionUtils::saveSessionObject('admin_current_profile', $profileId);
} else {
if ($this->currentUser->user_level == 'Manager') {
$signInMappingField = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
$signInMappingFieldTable = ucfirst($signInMappingField);
$subordinate = new $signInMappingFieldTable();
$signInMappingField = SIGN_IN_ELEMENT_MAPPING_FIELD_NAME;
$subordinates = $subordinate->Find("supervisor = ?", array($this->currentUser->{$signInMappingField}));
$subFound = false;
foreach ($subordinates as $sub) {
if ($sub->id == $profileId) {
$subFound = true;
break;
}
}
if (!$subFound) {
return;
}
SessionUtils::saveSessionObject('admin_current_profile', $profileId);
}
}
}
开发者ID:bravokeyl,项目名称:ems,代码行数:32,代码来源:BaseService.php
示例20: session_start
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Parpaing is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Parpaing. If not, see <http://www.gnu.org/licenses/>.
*/
session_start();
require_once "config/config.php";
require_once "engine/utils/SessionUtils.php";
if (!SessionUtils::isConnected($_SESSION)) {
exit;
}
$path = "/";
if (isset($_REQUEST["path"])) {
$path = $_REQUEST["path"];
if (strpos($path, "..") !== false) {
exit;
}
}
$fullpath = $config["parpaing"]["root_directory"] . $path;
$filename = substr($fullpath, strrpos($fullpath, "/") + 1);
if (file_exists($fullpath) && is_file($fullpath)) {
header('Content-Type: application/octet-stream');
header("Content-Transfer-Encoding: Binary");
header("Content-Disposition: attachment; filename=\"{$filename}\"");
开发者ID:Warry,项目名称:parpaing,代码行数:31,代码来源:do_downloadFile.php
注:本文中的SessionUtils类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论