Skip to content
Snippets Groups Projects
Commit 7050b74a authored by Tim Steiner's avatar Tim Steiner
Browse files

Change login to use CAS instead of LDAP

parent f11109a8
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,9 @@ class Auth_IndexController extends App_Controller_Action {
public function loginAction()
{
$this->_redirect('/auth/index/validate');
return;
$session = new Zend_Session_Namespace(__CLASS__);
$this->view->errorMessage = $session->errorMessage;
unset($session->errorMessage);
......@@ -36,12 +39,21 @@ class Auth_IndexController extends App_Controller_Action {
$auth = Unl_Auth::getInstance();
$ldap = new Unl_Ldap('ldap://localhost:10389');
$ldapAdapter = new Unl_Auth_Adapter_Ldap($ldap, $username, $password);
$auth->pushAdapter($ldapAdapter);
//$ldap = new Unl_Ldap('ldap://localhost:10389');
//$ldapAdapter = new Unl_Auth_Adapter_Ldap($ldap, $username, $password);
//$auth->pushAdapter($ldapAdapter);
if ($_SERVER['HTTPS'] == 'on') {
$serviceUrl = 'https://';
} else {
$serviceUrl = 'http://';
}
$serviceUrl .= $_SERVER['SERVER_NAME'] . Zend_Controller_Front::getInstance()->getBaseUrl() . '/auth/index/validate';
$casAdapter = new Unl_Auth_Adapter_Cas($serviceUrl, 'https://login.unl.edu/cas', $this->_getParam('ticket'));
$auth->pushAdapter($casAdapter);
try {
$result = $auth->authenticate($ldapAdapter);
$result = $auth->authenticate();
} catch (Exception $e) {
//
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment