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


PHP sp_authcode函數代碼示例

本文整理匯總了PHP中sp_authcode函數的典型用法代碼示例。如果您正苦於以下問題:PHP sp_authcode函數的具體用法?PHP sp_authcode怎麽用?PHP sp_authcode使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


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

示例1: _initialize

 function _initialize()
 {
     parent::_initialize();
     $site_options = get_site_options();
     $this->assign($site_options);
     $ucenter_syn = C("UCENTER_ENABLED");
     if ($ucenter_syn) {
         if (!isset($_SESSION["MEMBER_id"])) {
             if (!empty($_COOKIE['thinkcmf_auth']) && $_COOKIE['thinkcmf_auth'] != "logout") {
                 $thinkcmf_auth = sp_authcode($_COOKIE['thinkcmf_auth'], "DECODE");
                 $thinkcmf_auth = explode("\t", $thinkcmf_auth);
                 $auth_username = $thinkcmf_auth[1];
                 $members_obj = M('Members');
                 $where['user_login_name'] = $auth_username;
                 $member = $members_obj->where($where)->find();
                 if (!empty($member)) {
                     $is_login = true;
                     $_SESSION["MEMBER_type"] = 'local';
                     $_SESSION["MEMBER_id"] = $member['ID'];
                     $_SESSION['MEMBER_name'] = $auth_username;
                     $_SESSION['MEMBER_status'] = $member['user_status'];
                 }
             }
         } else {
         }
     }
 }
開發者ID:Nightchen0521,項目名稱:cmf,代碼行數:27,代碼來源:HomeBaseAction.class.php

示例2: _initialize

 function _initialize()
 {
     parent::_initialize();
     $site_options = get_site_options();
     $this->assign($site_options);
     $ucenter_syn = C("UCENTER_ENABLED");
     if ($ucenter_syn) {
         if (!isset($_SESSION["user"])) {
             if (!empty($_COOKIE['thinkcmf_auth']) && $_COOKIE['thinkcmf_auth'] != "logout") {
                 $thinkcmf_auth = sp_authcode($_COOKIE['thinkcmf_auth'], "DECODE");
                 $thinkcmf_auth = explode("\t", $thinkcmf_auth);
                 $auth_username = $thinkcmf_auth[1];
                 $users_model = M('Users');
                 $where['user_login'] = $auth_username;
                 $user = $users_model->where($where)->find();
                 if (!empty($user)) {
                     $is_login = true;
                     $_SESSION["user"] = $user;
                 }
             }
         } else {
         }
     }
     if (sp_is_user_login()) {
         $this->assign("user", sp_get_current_user());
     }
 }
開發者ID:noikiy,項目名稱:luokeke2,代碼行數:27,代碼來源:HomeBaseController.class.php

示例3: post

 function post()
 {
     if ($_SESSION['_verify_']['verify'] != I("post.verify")) {
         $this->error("驗證碼錯誤!");
     }
     if (IS_POST) {
         $_POST['post_table'] = sp_authcode($_POST['post_table']);
         if ($this->comments_model->create()) {
             if (isset($_SESSION["MEMBER_type"]) && $_SESSION["MEMBER_type"] == 'local') {
                 //用戶已登陸,且是本站會員
                 $uid = $_SESSION["MEMBER_id"];
                 $_POST['uid'] = $uid;
                 $members_model = M('Members');
                 $member = $members_model->field("user_login_name,user_email")->where("ID={$uid}")->find();
                 $username = $member['user_login_name'];
                 $email = $member['user_email'];
                 $_POST['full_name'] = $username;
                 $_POST['email'] = $email;
             }
             $result = $this->comments_model->add();
             if ($result !== false) {
                 $this->success("評論成功!");
             } else {
                 $this->error("評論失敗!");
             }
         } else {
             $this->error($this->comments_model->getError());
         }
     }
 }
開發者ID:Nightchen0521,項目名稱:cmf,代碼行數:30,代碼來源:CommentAction.class.php

示例4: post

 function post()
 {
     /* if($_SESSION['_verify_']['verify']!=I("post.verify")){
     			$this->error("驗證碼錯誤!");
     		} */
     if (IS_POST) {
         $post_table = sp_authcode($_POST['post_table']);
         $_POST['post_table'] = $post_table;
         $url = parse_url(urldecode($_POST['url']));
         $query = empty($url['query']) ? "" : "?{$url['query']}";
         $url = "{$url['scheme']}://{$url['host']}{$url['path']}{$query}";
         $_POST['url'] = sp_get_relative_url($url);
         if (isset($_SESSION["user"])) {
             //用戶已登陸,且是本站會員
             $uid = $_SESSION["user"]['id'];
             $_POST['uid'] = $uid;
             $users_model = M('Users');
             $user = $users_model->field("user_login,user_email,user_nicename")->where("id={$uid}")->find();
             $username = $user['user_login'];
             $user_nicename = $user['user_nicename'];
             $email = $user['user_email'];
             $_POST['full_name'] = empty($user_nicename) ? $username : $user_nicename;
             $_POST['email'] = $email;
         }
         if (C("COMMENT_NEED_CHECK")) {
             $_POST['status'] = 0;
             //評論審核功能開啟
         } else {
             $_POST['status'] = 1;
         }
         if ($this->comments_model->create()) {
             $this->check_last_action(intval(C("COMMENT_TIME_INTERVAL")));
             $result = $this->comments_model->add();
             if ($result !== false) {
                 //評論計數
                 $post_table = ucwords(str_replace("_", " ", $post_table));
                 $post_table = str_replace(" ", "", $post_table);
                 $post_table_model = M($post_table);
                 $pk = $post_table_model->getPk();
                 $post_table_model->create(array("comment_count" => array("exp", "comment_count+1")));
                 $post_table_model->where(array($pk => intval($_POST['post_id'])))->save();
                 $post_table_model->create(array("last_comment" => time()));
                 $post_table_model->where(array($pk => intval($_POST['post_id'])))->save();
                 $this->ajaxReturn(sp_ajax_return(array("id" => $result), "評論成功!", 1));
             } else {
                 $this->error("評論失敗!");
             }
         } else {
             $this->error($this->comments_model->getError());
         }
     }
 }
開發者ID:elinxer,項目名稱:hualilibrary,代碼行數:52,代碼來源:CommentController.class.php

示例5: _initialize

 function _initialize()
 {
     parent::_initialize();
     $site_options = get_site_options();
     $this->assign($site_options);
     $ucenter_syn = C("UCENTER_ENABLED");
     if ($ucenter_syn) {
         if (!isset($_SESSION["user"])) {
             if (!empty($_COOKIE['thinkcmf_auth']) && $_COOKIE['thinkcmf_auth'] != "logout") {
                 $thinkcmf_auth = sp_authcode($_COOKIE['thinkcmf_auth'], "DECODE");
                 $thinkcmf_auth = explode("\t", $thinkcmf_auth);
                 $auth_username = $thinkcmf_auth[1];
                 $users_model = M('Member');
                 $where['user_login'] = $auth_username;
                 $user = $users_model->where($where)->find();
                 if (!empty($user)) {
                     $is_login = true;
                     $_SESSION["user"] = $user;
                 }
             }
         } else {
         }
     }
     if (sp_is_user_login()) {
         $this->assign("user", sp_get_current_user());
     } else {
         if (isset($_COOKIE['user_login'])) {
             $users_model = M('Member');
             $where['user_login'] = $_COOKIE['user_login'];
             $user = $users_model->where($where)->find();
             //echo $_COOKIE['user_auth'];echo '<br>';echo md5($result['user_pass'].'iloveyouhmvpoint');die;
             if (md5($user['user_pass'] . 'iloveyouhmvpoint') == $_COOKIE['user_auth']) {
                 $_SESSION['user'] = $user;
             }
         }
     }
     // 熱搜
     $top_hot_search = M('Ad')->where('ad_content="top_hot_search"')->limit(7)->select();
     $this->assign('top_hot_search', $top_hot_search);
     $cart = A('Order/Cart')->cart();
     $this->assign('cartNum', count($cart['cart']));
 }
開發者ID:kmlzh1983,項目名稱:diamond,代碼行數:42,代碼來源:HomeBaseController.class.php

示例6: do_favorite

 function do_favorite()
 {
     $key = sp_authcode($_POST['key']);
     if ($key) {
         $authkey = C("AUTHCODE");
         $key = explode(" ", $key);
         $authcode = $key[0];
         if ($authcode == C("AUTHCODE")) {
             $table = $key[1];
             $object_id = $key[2];
             $post = I("post.");
             unset($post['key']);
             $post['table'] = $table;
             $post['object_id'] = $object_id;
             $uid = sp_get_current_userid();
             $post['uid'] = $uid;
             $user_favorites_model = M("UserFavorites");
             $find_favorite = $user_favorites_model->where(array('table' => $table, 'object_id' => $object_id, 'uid' => $uid))->find();
             if ($find_favorite) {
                 $this->error("親,您已收藏過啦!");
             } else {
                 $post['createtime'] = time();
                 $result = $user_favorites_model->add($post);
                 if ($result) {
                     $this->success("收藏成功!");
                 } else {
                     $this->error("收藏失敗!");
                 }
             }
         } else {
             $this->error("非法操作,無合法密鑰!");
         }
     } else {
         $this->error("非法操作,無密鑰!");
     }
     $this->error(sp_authcode($_POST['key']));
 }
開發者ID:elinxer,項目名稱:hualilibrary,代碼行數:37,代碼來源:FavoriteController.class.php

示例7: sp_authencode

function sp_authencode($string)
{
    return sp_authcode($string, "ENCODE");
}
開發者ID:noikiy,項目名稱:luokeke2,代碼行數:4,代碼來源:function.php


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