本文整理汇总了PHP中SessionUtils::saveSessionObject方法的典型用法代码示例。如果您正苦于以下问题:PHP SessionUtils::saveSessionObject方法的具体用法?PHP SessionUtils::saveSessionObject怎么用?PHP SessionUtils::saveSessionObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SessionUtils
的用法示例。
在下文中一共展示了SessionUtils::saveSessionObject方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
protected function setUp()
{
parent::setUp();
$this->deleteAllUsers();
$this->createNewUsers();
SessionUtils::saveSessionObject('user', $this->usersArray['admin']);
}
示例2: dirname
<?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;
示例3: 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);
}
}
}
示例4: define
define('CLIENT_PATH', dirname(__FILE__));
include "config.base.php";
include "include.common.php";
include "server.includes.inc.php";
if (empty($user)) {
if (!empty($_REQUEST['username']) && !empty($_REQUEST['password'])) {
$suser = null;
$ssoUserLoaded = false;
if (empty($suser)) {
$suser = new User();
$suser->Load("(username = ? or email = ?) and password = ?", array($_REQUEST['username'], $_REQUEST['username'], md5($_REQUEST['password'])));
}
if ($suser->password == md5($_REQUEST['password']) || $ssoUserLoaded) {
$user = $suser;
SessionUtils::saveSessionObject('user', $user);
$suser->last_login = date("Y-m-d H:i:s");
$suser->Save();
if (!$ssoUserLoaded && !empty(BaseService::getInstance()->auditManager)) {
BaseService::getInstance()->auditManager->user = $user;
BaseService::getInstance()->audit(IceConstants::AUDIT_AUTHENTICATION, "User Login");
}
if ($user->user_level == "Admin") {
header("Location:" . HOME_LINK_ADMIN);
} else {
header("Location:" . HOME_LINK_OTHERS);
}
} else {
header("Location:" . CLIENT_BASE_URL . "login.php?f=1");
}
}
示例5: Copyright
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 Ice Framework. If not, see <http://www.gnu.org/licenses/>.
------------------------------------------------------------------
Original work Copyright (c) 2012 [Gamonoid Media Pvt. Ltd]
Developer: Thilina Hasantha (thilina.hasantha[at]gmail.com / facebook.com/thilinah)
*/
include 'includes.inc.php';
if (empty($user)) {
$actual_link = "http://{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}";
SessionUtils::saveSessionObject('loginRedirect', $actual_link);
header("Location:" . CLIENT_BASE_URL . "login.php");
}
if (empty($user->default_module)) {
if ($user->user_level == "Admin") {
$homeLink = HOME_LINK_ADMIN;
} else {
$homeLink = HOME_LINK_OTHERS;
}
} else {
$defaultModule = new Module();
$defaultModule->Load("id = ?", array($user->default_module));
$homeLink = CLIENT_BASE_URL . "?g=" . $defaultModule->mod_group . "&&n=" . $defaultModule->name . "&m=" . $defaultModule->mod_group . "_" . str_replace(" ", "_", $defaultModule->menu);
}
//Check Module Permissions
$modulePermissions = BaseService::getInstance()->loadModulePermissions($_REQUEST['g'], $_REQUEST['n'], $user->user_level);