public function execute() { $accountModel = new Model_User_Account(); $user = User_Session::getLoginSession(); $accountModel->logout($user); $this->redirect('/personal/signin'); }
public function logout($user) { $serviceUserOnline = new Model_User_Online(); // 将用户从在线列表移出 $serviceUserOnline->delUser($user['id']); // 用户登出 User_Session::delLoginSession(); User_Session::delLoginCookie(); User_Session::delUserIdCookie(); $notice = array('msg' => '您已成功登出!', 'type' => 'information'); User_Session::setNotice($notice); }
public function detectLogin() { if (!$this->isLogin) { $account = array('email' => '*****@*****.**', 'password' => '123456'); $accountModel = new Model_User_Account(); $user = $accountModel->getUser($account); $accountModel->login($user); $this->redirect('/index'); return false; // 保存登陆返回页面 $backPage = $this->getRequest()->getServer('REQUEST_URI'); User_Session::setBackPage($backPage); $this->getResponse()->setRedirect('/personal/signin'); } }
} ?> "> <div id="page"> <?php if (!isset($_GET['popup'])) { ?> <div id="mast-wrap"> <header id="head"> <div class="top-bar"> <div class="wrap"> <div class="left"> <?php $user = User_Session::get(); ?> <?php if (!empty($user) && $user->isValid()) { ?> <span>Welcome, <?php echo Format::htmlspecialchars($user->info('first_name')); ?> !</span> <a href="/idx/dashboard.html" class="popup">Dashboard</a> <?php // REWMOD Friday, February 13, 2015 - Eric B *456848651351*- Collab 150116MC[CD][PRG]_26408 ?> <a href="/idx/dashboard.html?type=favorites" class="popup link-faves">Favorites <span class="count"><?php echo $user->info('num_favorites');
/** * 选择要查看的业务 */ public function getBusiness() { $host_id = ''; $loginUser = User_Session::getLoginCookie(); $business = $this->getBusinessByUser($loginUser['id']); $hosts = $business['business']; if (!empty($hosts)) { $hosts = substr($hosts, 0, strlen($hosts) - 1); $sql = "select id from `{$this->relationPathTable}` where host in ({$hosts})"; $hosts_ids = self::getIns()->fetchAll($sql, false, true); foreach ($hosts_ids as $value) { $host_id .= $value['id'] . ","; } $host_id = rtrim($host_id, ','); } return $host_id; }
public function _initBusiness() { $userBusinessService = new Service_User_Business(); $business = $userBusinessService->getList(User_Session::getUserIdCookie()); User_Session::setBusiness($business); }