本文整理汇总了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;
}