, . , ( ), , . , / , LADP ..
, , . Zend_Auth, . Zend_Auth, , , , .
, Zend_Auth ;
protected function Authentication() {
$strEmail = trim($this->txtEmail->Text);
$this->txtPassword->Text = trim($this->txtPassword->Text);
$auth = QAuth::getInstance();
$authAdapter = new QAuth_Adapter_WebService(__LOGIN_WS_URL__,
$strEmail, $this->txtPassword->Text
);
$result = $auth->authenticate($authAdapter);
if ($result->isValid()) {
$objUser = User::LoadByEmail($strEmail);
if(!$objUser) {
$this->User_Create($strEmail);
$objUser = User::LoadByEmail($strEmail);
}
$crypt = new Encryption();
$encr = $crypt->encrypt(__KEY__, $objUser->UserID);
$_SESSION['user_id'] = $encr;
setcookie('user_id', $_SESSION['user_id'], time()+(3600*24*365*20));
$this->Intranet1Integration($objUser->UserID);
QApplication::Redirect('http://'.__URL__.'/index.php');
}
else {
QApplication::DisplayAlert(
'Log on failed. You must provide a Company email and a correct password.'
);
}
}