當前位置: 首頁>>代碼示例>>PHP>>正文


PHP H::decode_hash方法代碼示例

本文整理匯總了PHP中H::decode_hash方法的典型用法代碼示例。如果您正苦於以下問題:PHP H::decode_hash方法的具體用法?PHP H::decode_hash怎麽用?PHP H::decode_hash使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在H的用法示例。


在下文中一共展示了H::decode_hash方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 public function __construct()
 {
     if (AWS_APP::session()->client_info and !$_COOKIE[G_COOKIE_PREFIX . '_user_login']) {
         // Cookie 清除則 Session 也清除
         unset(AWS_APP::session()->client_info);
     }
     if (!AWS_APP::session()->client_info and $_COOKIE[G_COOKIE_PREFIX . '_user_login']) {
         $auth_hash_key = md5(G_COOKIE_HASH_KEY . $_SERVER['HTTP_USER_AGENT'] . $_SERVER['HTTP_ACCEPT_LANGUAGE']);
         // 解碼 Cookie
         $sso_user_login = H::decode_hash($_COOKIE[G_COOKIE_PREFIX . '_user_login'], $auth_hash_key);
         if ($sso_user_login['user_name'] and $sso_user_login['password'] and $sso_user_login['uid']) {
             if (AWS_APP::model('account')->check_hash_login($sso_user_login['user_name'], $sso_user_login['password'])) {
                 AWS_APP::session()->client_info['__CLIENT_UID'] = $sso_user_login['uid'];
                 AWS_APP::session()->client_info['__CLIENT_USER_NAME'] = $sso_user_login['user_name'];
                 AWS_APP::session()->client_info['__CLIENT_PASSWORD'] = $sso_user_login['password'];
                 return true;
             }
         }
         return false;
     }
 }
開發者ID:chenruixuan,項目名稱:wecenter,代碼行數:21,代碼來源:user.php

示例2: __construct

 public function __construct()
 {
     if (AWS_APP::session()->client_info and !$_COOKIE[G_COOKIE_PREFIX . '_user_login']) {
         // Cookie 清除則 Session 也清除
         unset(AWS_APP::session()->client_info);
     }
     if (!AWS_APP::session()->client_info and $_COOKIE[G_COOKIE_PREFIX . '_user_login']) {
         $auth_hash_key = md5(G_COOKIE_HASH_KEY . $_SERVER['HTTP_USER_AGENT'] . $_SERVER['HTTP_ACCEPT_LANGUAGE']);
         // 解碼 Cookie
         $sso_user_login = H::decode_hash($_COOKIE[G_COOKIE_PREFIX . '_user_login'], $auth_hash_key);
         $user_name = $sso_user_login['user_name'];
         $host = 'localhost';
         $username = 'root';
         $password = 'toor';
         $database = 'baji';
         $dbc = mysqli_connect($host, $username, $password, $database);
         if (!$dbc) {
             die('Could not connect: ' . mysql_error());
         }
         $query = "SELECT * FROM users WHERE user_name = '{$user_name}'";
         $data = mysqli_query($dbc, $query) or die('error!!' . mysql_error());
         mysqli_close($dbc);
         $row = mysqli_fetch_array($data);
         $sso_user_login['password'] = $row['password'];
         $sso_user_login['uid'] = $row['uid'];
         $name = H::encode_hash($sso_user_login);
         HTTP::set_cookie($name);
         if ($sso_user_login['user_name'] and $sso_user_login['password'] and $sso_user_login['uid']) {
             if (AWS_APP::model('account')->check_hash_login($sso_user_login['user_name'], $sso_user_login['password'])) {
                 AWS_APP::session()->client_info['__CLIENT_UID'] = $sso_user_login['uid'];
                 AWS_APP::session()->client_info['__CLIENT_USER_NAME'] = $sso_user_login['user_name'];
                 AWS_APP::session()->client_info['__CLIENT_PASSWORD'] = $sso_user_login['password'];
                 return true;
             }
         }
         return false;
     }
 }
開發者ID:ddxmaaa,項目名稱:wecenter-loudong,代碼行數:38,代碼來源:user.php

示例3: __construct

 public function __construct()
 {
     parent::__construct(false);
     if ($_GET['app'] != 'admin') {
         return false;
     }
     TPL::import_clean();
     if (defined('SYSTEM_LANG')) {
         TPL::import_js(base_url() . '/language/' . SYSTEM_LANG . '.js');
     }
     if (HTTP::is_browser('ie', 8)) {
         TPL::import_js('js/jquery.js');
     } else {
         TPL::import_js('js/jquery.2.js');
     }
     TPL::import_js(array('admin/js/aws_admin.js', 'admin/js/aws_admin_template.js', 'js/jquery.form.js', 'admin/js/framework.js', 'admin/js/global.js'));
     TPL::import_css(array('admin/css/common.css'));
     if (in_array($_GET['act'], array('login', 'login_process'))) {
         return true;
     }
     if ($admin_info = H::decode_hash(AWS_APP::session()->admin_login)) {
         if ($admin_info['uid'] != $this->user_id or $admin_info['UA'] != $_SERVER['HTTP_USER_AGENT'] or !AWS_APP::session()->permission['is_administortar'] and !AWS_APP::session()->permission['is_moderator']) {
             unset(AWS_APP::session()->admin_login);
             if ($_POST['_post_type'] == 'ajax') {
                 H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('會話超時, 請重新登錄')));
             } else {
                 H::redirect_msg(AWS_APP::lang()->_t('會話超時, 請重新登錄'), '/admin/login/url-' . base64_encode($_SERVER['REQUEST_URI']));
             }
         }
     } else {
         if ($_POST['_post_type'] == 'ajax') {
             H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('會話超時, 請重新登錄')));
         } else {
             HTTP::redirect('/admin/login/url-' . base64_encode($_SERVER['REQUEST_URI']));
         }
     }
     $this->setup();
 }
開發者ID:lincoln2015,項目名稱:18duchengxuyuan_server,代碼行數:38,代碼來源:aws_controller.inc.php

示例4: remove_attach_action

 public function remove_attach_action()
 {
     if ($attach_info = H::decode_hash(base64_decode($_GET['attach_id']))) {
         $this->model('publish')->remove_attach($attach_info['attach_id'], $attach_info['access_key']);
     }
     H::ajax_json_output(AWS_APP::RSM(null, 1, null));
 }
開發者ID:leonardo0004,項目名稱:wecenter-loudong,代碼行數:7,代碼來源:ajax.php


注:本文中的H::decode_hash方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。