Example #1
0
 /**
  * 
  * Checks to make sure the LDAP extension is loaded.
  * 
  * @return void
  * 
  */
 protected function _preConfig()
 {
     parent::_preConfig();
     if (!extension_loaded('ldap')) {
         throw $this->_exception('ERR_EXTENSION_NOT_LOADED', array('extension' => 'ldap'));
     }
 }
Example #2
0
 /**
  * 
  * Fetches the access list from the adapter into $this->list.
  * 
  * @param string|Solar_Auth_Adapter $auth_spec Fetch access controls for
  * this user handle.  If a string, is assumed to be the handle directly;
  * otherwise, the handle is pulled from a Solar_Auth_Adapter object.
  * 
  * @param array|Solar_Auth_Adapter $role_spec Fetch access controls for
  * these user roles.  If an array, is assumed to be the roles directly;
  * otherwise, the roles are pulled from a Solar_Role_Adapter object.
  * 
  * @return void
  * 
  */
 public function load($auth_spec, $role_spec)
 {
     // clear out previous values
     $this->reset();
     if ($auth_spec instanceof Solar_Auth_Adapter) {
         $this->_auth = $auth_spec;
         $handle = $this->_auth->handle;
     } else {
         $handle = $auth_spec;
     }
     if ($role_spec instanceof Solar_Role_Adapter) {
         $this->_role = $role_spec;
         $roles = $this->_role->getList();
     } else {
         $roles = $role_spec;
     }
     // get the access list
     $list = $this->fetch($handle, $roles);
     // reverse so that last ones are checked first
     $this->list = array_reverse($list);
 }