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

Initial support for UNL's CAS Authentication

parent fd20aa55
No related branches found
No related tags found
No related merge requests found
...@@ -16,5 +16,6 @@ class Nmc_Auth_Adapter_Cas implements Zend_Auth_Adapter_Interface ...@@ -16,5 +16,6 @@ class Nmc_Auth_Adapter_Cas implements Zend_Auth_Adapter_Interface
if ($loggedIn) { if ($loggedIn) {
return new Zend_Auth_Result(true, phpCAS::getUser()); return new Zend_Auth_Result(true, phpCAS::getUser());
} }
return new Zend_Auth_Result(false, null, array('Not signed in to CAS.'));
} }
} }
\ No newline at end of file
...@@ -27,10 +27,13 @@ class Nmc_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface ...@@ -27,10 +27,13 @@ class Nmc_Auth_Adapter_Ldap implements Zend_Auth_Adapter_Interface
$userName = $this->_userName; $userName = $this->_userName;
$password = $this->_password; $password = $this->_password;
if (!$userName) {
return new Zend_Auth_Result(false, null, array('LDAP: No username specified.'));
}
try { try {
$this->_connection->bind("uid=$userName,ou=people,dc=unl,dc=edu", $password); $this->_connection->bind("uid=$userName,ou=people,dc=unl,dc=edu", $password);
$filter = 'uid=' . $userName;
$filter = 'uid=' . $user_name;
$this->_connection->search('ou=people,dc=unl,dc=edu', $filter ); $this->_connection->search('ou=people,dc=unl,dc=edu', $filter );
} catch (Nmc_Ldap_Exception $e) { } catch (Nmc_Ldap_Exception $e) {
if ($e->getCode() == 49) { if ($e->getCode() == 49) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment