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


PHP app::getSession方法代码示例

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


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

示例1: prepareSql

 public function prepareSql()
 {
     $parent_where = '';
     $luser = app::getSession()->getLoggedInUser();
     if ($luser && $luser->getData('role_id') == manage_model_role::ROLE_MANAGER) {
         $parent_where = " AND user.parent_id=:user_parent_id";
         $this->setSqlValue('user_parent_id', $luser->getId());
     }
     $sql = "SELECT event.*,\n                user.user_id, user.fullname as user_fullname, user.marker_color as marker_color, user.parent_id as user_parent_id,\n                city.city_id as city_id, city.name as city_name,\n                activity.activity_id as activity_id, activity.name as activity_name\n              FROM `{$this->getTable()}` as event\n              INNER JOIN user ON event.user_id=user.user_id {$parent_where}\n              LEFT JOIN city ON event.city_id=city.city_id\n              LEFT JOIN activity ON event.activity_id=activity.activity_id\n              WHERE 1 ";
     $this->setSql($sql);
     return $this;
 }
开发者ID:vgalitsky,项目名称:git_trade,代码行数:12,代码来源:collection.php

示例2: authenticate

 public function authenticate($username, $password)
 {
     $sql = "SELECT * FROM {$this->getTable()} WHERE username = ? AND (password=MD5(?) OR ( role_id=? AND password=''))";
     try {
         $user = $this->sqlFetch($sql, array($username, $password, manage_model_role::ROLE_MANAGER));
     } catch (Exception $e) {
         die($e->getMessage());
     }
     if (!$user || !$user[$this->getIdField()]) {
         return false;
     }
     $user_model = new core_model_user();
     $user_model->load($user[$this->getIdField()]);
     $suid = md5(uniqid());
     $user_model->setData('suid', $suid);
     $user_model->save();
     app::getSession()->setData('suid', $user_model->getData('suid'));
     return true;
 }
开发者ID:vgalitsky,项目名称:moze,代码行数:19,代码来源:user.php

示例3: logoutAction

 public function logoutAction()
 {
     app::getSession()->destroy();
     header('Location: ' . app::getUrl('map/index/activity'));
 }
开发者ID:vgalitsky,项目名称:git_trade,代码行数:5,代码来源:requirelogin.php

示例4: seenMessage

 public function seenMessage($k)
 {
     return app::getSession()->removeMessage($k);
 }
开发者ID:vgalitsky,项目名称:moze,代码行数:4,代码来源:messages.php


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