本文整理匯總了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);
}
示例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);
}
示例3: logoutAction
public function logoutAction()
{
$userModel = new UserModel();
$userModel->logout();
}
示例4: logoutAction
public function logoutAction()
{
UserModel::logout();
}
示例5: logoutAction
public function logoutAction()
{
UserModel::logout();
$this->gotoPage('/index', 'Succefully logged out');
}
示例6: act_logout
public function act_logout()
{
UserModel::logout();
}
示例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);
}