本文整理匯總了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));
}
示例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;
}