Esempio n. 1
0
File: index.php Progetto: alcf/chms
 protected function btnLogin_Click($strFormId, $strControlId, $strParameter)
 {
     $objLogin = PublicLogin::LoadByUsernamePassword(trim(strtolower($this->txtUsername->Text)), $this->txtPassword->Text);
     if (!$objLogin || !$objLogin->IsAllowedToUseChms()) {
         $this->lblMessage->Text = 'Invalid username or password.';
         $this->txtUsername->Blink();
         $this->txtPassword->Blink();
         $this->txtUsername->Focus();
         return;
     }
     if ($this->chkRemember->Checked) {
         setcookie('username', $objLogin->Username, time() + 60 * 60 * 24 * 14, '/', null);
     } else {
         setcookie('username', null, 1, '/', null);
     }
     QApplication::PublicLogin($objLogin);
     if ($objLogin->TemporaryPasswordFlag) {
         QApplication::Redirect('/update_password.php');
     } else {
         QApplication::RedirectOnPublicLogin();
     }
 }