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


PHP Cookie::i方法代码示例

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


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

示例1: smarty_insert_getUsername

function smarty_insert_getUsername()
{
    $id = Cookie::i('uid', -1);
    $id = S::v('uid', $id);
    if ($id < 0) {
        return '';
    }
    $user = User::getSilentWithUID($id);
    return $user->bestEmail();
}
开发者ID:Ekleog,项目名称:platal,代码行数:10,代码来源:insert.getUserName.php

示例2: tryCookie

 /** Checks the cookie and set user_id according in cookie_uid variable
  */
 private function tryCookie()
 {
     S::kill('cookie_uid');
     //Remove previously stored id
     if (!Cookie::has('uid') || !Cookie::has('hash')) {
         return self::COOKIE_INCOMPLETE;
     }
     $res = XDB::query("SELECT   uid, password\n                             FROM   account\n                            WHERE   uid = {?} AND state = 'active'", Cookie::i('uid'));
     if ($res->numRows() == 1) {
         list($uid, $password) = $res->fetchOneRow();
         if (sha1($password) == Cookie::v('hash')) {
             S::set('cookie_uid', $uid);
             return self::COOKIE_SUCCESS;
         } else {
             return self::COOKIE_WRONG_HASH;
         }
     }
     return self::COOKIE_WRONG_UID;
 }
开发者ID:netixx,项目名称:frankiz,代码行数:21,代码来源:frankizsession.php

示例3: tryCookie

 /** Check the cookie and set the associated uid in the auth_by_cookie session variable.
  */
 private function tryCookie()
 {
     S::kill('auth_by_cookie');
     if (Cookie::v('access') == '' || !Cookie::has('uid')) {
         return self::NO_COOKIE;
     }
     $res = XDB::query('SELECT  uid, password
                          FROM  accounts
                         WHERE  uid = {?} AND state = \'active\'', Cookie::i('uid'));
     if ($res->numRows() != 0) {
         list($uid, $password) = $res->fetchOneRow();
         if (sha1($password) == Cookie::v('access')) {
             S::set('auth_by_cookie', $uid);
             return self::COOKIE_SUCCESS;
         } else {
             return self::INVALID_COOKIE;
         }
     }
     return self::INVALID_USER;
 }
开发者ID:Ekleog,项目名称:platal,代码行数:22,代码来源:xorgsession.php

示例4: getDomainFromCookie

 public static function getDomainFromCookie()
 {
     if (Cookie::has('domain')) {
         return Cookie::s('domain', '');
     }
     if (Cookie::has('uid')) {
         $uid = Cookie::i('uid');
         $res = XDB::query("SELECT  f.domain\n                                 FROM  formations AS f\n                            LEFT JOIN  studies AS s ON (s.formation_id = f.formation_id)\n                                WHERE  s.uid = {?}\n                             ORDER BY  s.promo ASC\n                                LIMIT  1", $uid);
         if ($res->numRows()) {
             return $res->fetchOneCell();
         }
     }
     return "";
 }
开发者ID:netixx,项目名称:frankiz,代码行数:14,代码来源:user.php


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