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


PHP UserModel::logout方法代码示例

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


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

示例1: personalLiAction

 function personalLiAction()
 {
     $token1 = $this->get("token");
     $request = $this->getRequest();
     $userModel = new UserModel();
     $userModel->logout();
     if ('POST' == $request->getMethod()) {
         $mobile = trim($this->post()->get("mobile"));
     }
     $url = Common_Config::SSO_VERIFY_URL;
     $domainId = Common_Config::UDO_OP_DOMAINID;
     $token = "tokend86ef2e5-e43b-4077-aafd-f2d3290a9889NHL2GezC";
     $secret = Common_Config::UDO_OP_SECRET_SERVER;
     $sign_raw = $domainId . $token . $secret;
     $sign = md5($sign_raw);
     $post_data = array("domainId" => $domainId, "token" => $token, "sign" => $sign);
     //print_r($post_data);
     $cl = new Common_Curl();
     $array = $cl->request($url, $post_data);
     $uid = $array['id'];
     //print_r($uid);
     //print_r($this->uid);
     $cookie = new User_Cookie(Common_Config::SITE_DOMAIN, Common_Config::SECURE_KEY, Common_Config::SECURE_SIGN);
     $cookie->login($uid);
     //print_r($this->uid);
     /*print_r($_SESSION['uid']);*/
     /*print_r($array);*/
     // print_r($array);
     $entrances = $array['entrances'];
     //print_r($entrances);
     $this->displayJsonUdo(Common_Error::ERROR_SUCCESS, $entrances);
 }
开发者ID:krisrita,项目名称:udo,代码行数:32,代码来源:School.php

示例2: logout

 public function logout()
 {
     Model::autoloadModel('User');
     $model = new UserModel($this->db);
     $model->logout();
     // redirect user to base URL
     header('location: ' . URL . CONTEXT_PATH_USER_LOGIN);
 }
开发者ID:khanhdnhut,项目名称:tours,代码行数:8,代码来源:user_ctrl.php

示例3: logoutAction

 public function logoutAction()
 {
     $userModel = new UserModel();
     $userModel->logout();
 }
开发者ID:lilhorse,项目名称:cocoa,代码行数:5,代码来源:UserController.php

示例4: logoutAction

 public function logoutAction()
 {
     UserModel::logout();
 }
开发者ID:ennjamusic,项目名称:study,代码行数:4,代码来源:SiteController.php

示例5: logoutAction

 public function logoutAction()
 {
     UserModel::logout();
     $this->gotoPage('/index', 'Succefully logged out');
 }
开发者ID:richistron,项目名称:TianguisCabal,代码行数:5,代码来源:UserController.php

示例6: act_logout

 public function act_logout()
 {
     UserModel::logout();
 }
开发者ID:ohjack,项目名称:newErp,代码行数:4,代码来源:login.action.php

示例7: getAdAction

 /**
  * 用户是否存在
  */
 public function getAdAction()
 {
     //广告接口首先拿客户端传来的ssotoken 在SSO进行验证获取用户信息
     $request = $this->getRequest();
     $userModel = new UserModel();
     $userModel->logout();
     if ('POST' == $request->getMethod()) {
         $token = trim($this->post()->get("ssotoken"));
     } else {
         $token = $this->get("ssotoken");
     }
     //$token = "1";
     if (!$token) {
         $this->displayJsonUdo(Common_Error::ERROR_PARAM);
     }
     //获取到用户信息
     $url = Common_Config::SSO_SCHOOL_URL;
     $post_data = array("ssotoken" => $token);
     //print_r($post_data);
     $cl = new Common_Curl();
     $result = $cl->request($url, $post_data);
     /*                $result = array("id"=>8 , "grade"=>11,"province"=>3,"city"=>4,"area"=>5,
                         "entrances"=>array(0=>array("id"=>1,"name"=>"双十","title"=>"双十网校","grade"=>11,"baseUrl"=>"1",
             "udoUrl"=>"2","city_id"=>4),
             1=>array("id"=>2,"name"=>"华英","title"=>"华英网校","grade"=>14,"baseUrl"=>"1",
                 "udoUrl"=>"2","city_id"=>6),
             2=>array("id"=>3,"name"=>"三明","title"=>"三明网校","grade"=>15,"baseUrl"=>"1",
                 "udoUrl"=>"2","city_id"=>4)));*/
     //print_r($result);
     if (array_key_exists('code', $result) && $result['code'] == 0) {
         $this->displayJsonUdo(Common_Error::ERROR_FAIL, null, "SSO没有返回正确的用户信息哦~");
     }
     //$result = array ("id"=> 2779,"province"=>3,"grade"=>11);
     //$result = array ("id"=> 2779,"province"=> 0,"grade"=>11);
     //sso返回成功,开始进行广告过滤
     //print_r($result);
     //过滤出和用户所在地区和年级一致的广告
     $ad = new AdModel();
     $adlist = $ad->getAd($result);
     $uid = $userModel->getUserId($token);
     /*$kaixin = $ad->filterPrimary($uid);
       if(is_array($kaixin))
           $adlist = $kaixin;*/
     //计算总竞价值
     $price_sum = 0;
     $temp_arr = array();
     foreach ($adlist as $i => $val) {
         $price_sum += $val['price'];
     }
     //生成随机数
     $arr = array();
     $arr[] = rand(1, 100);
     $arr = array_unique($arr);
     $rand = implode(" ", $arr);
     //获得随机url
     $url = [];
     $rate = 0;
     foreach ($adlist as $i => $val) {
         $temp_arr[$i] = $val['price'] / $price_sum * 100 + ($i - 1 >= 0 ? $temp_arr[$i - 1] : 0);
         //print_r($i."   ".$temp_arr[$i]);
         if ($rand <= $temp_arr[$i] && $rand >= ($i - 1 >= 0 ? $temp_arr[$i - 1] : 0)) {
             $url = $val;
             $rate = $val['price'] / $price_sum;
         }
     }
     //将推送的广告写入广告推送表
     $ad->adLog($url['id'], 0, $rate);
     $ad->adPushSum($url['id']);
     $ad->adStatistics($url['id']);
     $this->displayJsonUdo(Common_Error::ERROR_SUCCESS, $url);
 }
开发者ID:krisrita,项目名称:udo,代码行数:74,代码来源:Ad.php


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