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


PHP CHttpSession::closeSession方法代碼示例

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


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

示例1: actionIndex

 public function actionIndex()
 {
     $session = new CHttpSession();
     $session->open();
     $user = $session['login'];
     $session->closeSession(true);
     $sql = Yii::app()->db->createCommand("SELECT User.Num_bank_cart, Credit.Type_credit, Credit.Sum_credit, Credit.Proc_stavka, Credit.Srok, Credit.Type_credit, Calendar.Month_pay, Credit.Num_credit, Credit.Type_platezh, Credit.Oforml_credit_date, Calendar.Pay_sum, Calendar.P_sum, Calendar.P_proc, Calendar.Less_sum\nFROM (User INNER JOIN Credit ON User.id_user = Credit.id_user) INNER JOIN Calendar ON Credit.id_credit = Calendar.id_credit WHERE Num_bank_cart = {$user} ")->queryAll();
     echo $this->render('index', array('variable' => $sql));
 }
開發者ID:vladumanskyi,項目名稱:diplom_Yii,代碼行數:9,代碼來源:testUserController.php

示例2: authenticate

 public function authenticate()
 {
     $userData = $this->username;
     $password = $this->password;
     $hashedPassword = md5($password);
     //Client
     $user = User::model()->find(array('condition' => "Num_bank_cart = '{$userData}'"));
     $pass = User::model()->find(array('condition' => "Password = '{$hashedPassword}'"));
     //Inspector
     $insp = Inspector::model()->find(array('condition' => "Login = '{$userData}'"));
     $inspPass = Inspector::model()->find(array('condition' => "Password = '{$hashedPassword}'"));
     $client = !empty($user);
     $inspLog = !empty($insp);
     if ($client || $userData == 'admin' || $inspLog) {
         $hashedPassword = md5($password);
         if (!empty($pass) || $password == 'admin' || !empty($inspPass)) {
             $session = new CHttpSession();
             $session->open();
             $session['login'] = $userData;
             if ($client != "") {
                 $data = 'client';
             } else {
                 if ($inspLog != "") {
                     $data = 'inspector';
                 } else {
                     $data = 'admin';
                 }
             }
             $session['data'] = $data;
             $session->closeSession(true);
             $this->errorCode = self::ERROR_NONE;
         } else {
             $this->errorCode = self::ERROR_PASSWORD_INVALID;
         }
     } else {
         $this->errorCode = self::ERROR_USERNAME_INVALID;
     }
     return !$this->errorCode;
 }
開發者ID:vladumanskyi,項目名稱:diplom_Yii,代碼行數:39,代碼來源:UserIdentity.php


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