当前位置: 首页>>代码示例>>PHP>>正文


PHP S::kill方法代码示例

本文整理汇总了PHP中S::kill方法的典型用法代码示例。如果您正苦于以下问题:PHP S::kill方法的具体用法?PHP S::kill怎么用?PHP S::kill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在S的用法示例。


在下文中一共展示了S::kill方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: stopSUID

 public function stopSUID()
 {
     $perms = S::suid('perms');
     if (!parent::stopSUID()) {
         return false;
     }
     S::kill('may_update');
     S::kill('is_member');
     S::set('perms', $perms);
     return true;
 }
开发者ID:Ekleog,项目名称:platal,代码行数:11,代码来源:xnetsession.php

示例2: startSessionAs

 protected function startSessionAs($user, $level)
 {
     if (!is_null(S::user()) && S::user()->id() != $user->id() || S::has('uid') && S::i('uid') != $user->id()) {
         return false;
     } else {
         if (S::has('uid')) {
             return true;
         }
     }
     if ($level == AUTH_SUID) {
         S::set('auth', AUTH_PASSWD);
     }
     // Loads uid and hruid into the session for developement conveniance.
     $_SESSION = array_merge($_SESSION, array('uid' => $user->id(), 'hruid' => $user->hruid, 'token' => $user->token, 'user' => $user));
     // Starts the session's logger, and sets up the permanent cookie.
     if (S::suid()) {
         S::logger()->log("suid_start", S::v('hruid') . ' by ' . S::suid('hruid'));
     } else {
         S::logger()->saveLastSession();
         Cookie::set('uid', $user->id(), 300);
         if (S::i('auth_by_cookie') == $user->id() || Post::v('remember', 'false') == 'true') {
             $this->setAccessCookie(false, S::i('auth_by_cookie') != $user->id());
         } else {
             $this->killAccessCookie();
             // If login for an external website and not activating cookie,
             // mark that we want to disconnect once external auth checks
             // have been performed.
             if (Post::b('external_auth')) {
                 S::set('external_auth_exit', true);
             }
         }
     }
     // Finalizes the session setup.
     $this->makePerms($user->perms, $user->is_admin);
     $this->securityChecks();
     $this->setSkin();
     $this->updateNbNotifs();
     // Only check email redirection for 'internal' users.
     if ($user->checkPerms(PERMS_USER)) {
         check_redirect();
     }
     // We should not have to use this private data anymore
     S::kill('auth_by_cookie');
     return true;
 }
开发者ID:Ekleog,项目名称:platal,代码行数:45,代码来源:xorgsession.php

示例3: handler_exit

 function handler_exit($page, $level = null)
 {
     if (S::suid()) {
         $old = S::user()->login();
         S::logger()->log('suid_stop', $old . " by " . S::suid('hruid'));
         Platal::session()->stopSUID();
         $target = S::s('suid_startpage');
         S::kill('suid_startpage');
         if (!empty($target)) {
             http_redirect($target);
         }
         pl_redirect('admin/user/' . $old);
     }
     if ($level == 'forget' || $level == 'forgetall') {
         Platal::session()->killAccessCookie();
     }
     if ($level == 'forgetuid' || $level == 'forgetall') {
         Platal::session()->killLoginFormCookies();
     }
     if (S::logged()) {
         S::logger()->log('deconnexion', @$_SERVER['HTTP_REFERER']);
         Platal::session()->destroy();
     }
     if (Get::has('redirect')) {
         http_redirect(rawurldecode(Get::v('redirect')));
     } else {
         $page->changeTpl('platal/exit.tpl');
     }
 }
开发者ID:Ekleog,项目名称:platal,代码行数:29,代码来源:platal.php

示例4: clear_session

 function clear_session()
 {
     S::kill('survey');
     S::kill('survey_id');
     S::kill('survey_validate');
 }
开发者ID:Ekleog,项目名称:platal,代码行数:6,代码来源:survey.php

示例5: getSilentWithValues

 public static function getSilentWithValues($login, $values)
 {
     global $globals;
     if ($login == 0) {
         // If the anonymous_user is already in session
         if (S::has('anonymous_user')) {
             return S::v('anonymous_user');
         }
         $uid = IPAddress::getInstance()->is_x_internal() ? $globals->anonymous->internal : $globals->anonymous->external;
         S::set('newuid', $uid);
         try {
             $u = new User($uid);
             $u->select(UserSelect::login());
         } catch (Exception $e) {
             S::kill('newuid');
             throw $e;
         }
         S::kill('newuid');
         S::set('anonymous_user', $u);
         return $u;
     }
     throw new Exception('DEPRECATED call to getSilentWithValues()');
 }
开发者ID:netixx,项目名称:frankiz,代码行数:23,代码来源:user.php

示例6: startSessionAs

 /** Start a session as user $user
  */
 protected function startSessionAs($user, $level)
 {
     /* Session data and required data mismatch */
     if (!is_null(S::v('user')) && S::v('user')->id() != $user->id() || S::has('uid') && S::i('uid') != $user->id()) {
         return false;
     } else {
         if (S::has('uid')) {
             return true;
         }
     }
     /* If we want to do a SUID */
     if ($level == AUTH_SUID) {
         S::set('auth', AUTH_MDP);
     }
     S::set('user', $user);
     S::set('uid', $user->id());
     if (!isSmartphone()) {
         S::set('skin', $user->skin());
     }
     if (!S::suid()) {
         if (Post::v('remember', 'false') == 'on') {
             $this->setAccessCookie(false);
         }
         S::logger()->saveLastSession();
     } else {
         S::logger()->log("suid_start", S::v('hruid') . ' by ' . S::suid('hruid'));
     }
     // Set session perms from User perms
     S::set('perms', $user->perms());
     /* Clean temp var 'cookie_uid' */
     S::kill('cookie_uid');
     return true;
 }
开发者ID:netixx,项目名称:frankiz,代码行数:35,代码来源:frankizsession.php


注:本文中的S::kill方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。