*
* @param array $params Optional parameters:
* <pre>
+ * 'default_user' - (string) The default user.
* 'logger' - (Horde_Log_Logger) A logger object.
* 'notify_expire' - (callback) Callback function to output notification
* when password is about to expire. Passed one
unset($params['logger']);
}
+ $params = array_merge(array(
+ 'default_user' => ''
+ ), $params);
+
$this->_params = $params;
}
/**
* Automatic authentication.
*
- * @return boolean Whether or not the user is authenticated automatically.
+ * @return boolean Whether or not the user is authenticated
+ * automatically.
* @throws Horde_Auth_Exception
*/
public function transparent()
{
$userId = empty($this->_credentials['userId'])
- ? $GLOBALS['registry']->getAuth()
+ ? $this->_params['default_user']
: $this->_credentials['userId'];
$credentials = empty($this->_credentials['credentials'])
? Horde_Auth::getCredential()
/* Build a custom query, based on the config file. */
$query = str_replace(
'\L',
- $this->_db->quote($GLOBALS['registry']->getAuth()),
+ $this->_db->quote($this->_params['default_user']),
$this->_params['query_list']
);
public function checkExistingAuth()
{
return !empty($_SERVER[$this->_params['username_header']]) &&
- $this->_removeScope($_SERVER[$this->_params['username_header']]) == $GLOBALS['registry']->getAuth();
+ ($this->_removeScope($_SERVER[$this->_params['username_header']]) == $this->_params['default_user']);
}
/**