*/
static public function getAuth()
{
- return (!empty($_SESSION['horde_auth']['userId']))
- ? $_SESSION['horde_auth']['userId']
- : false;
+ return empty($_SESSION['horde_auth']['userId'])
+ ? false
+ : $_SESSION['horde_auth']['userId'];
}
/**
/* Clear any existing info. */
self::clearAuth();
- $credentials = Horde_Secret::write(Horde_Secret::getKey('auth'), serialize($credentials));
-
$browser = Horde_Browser::singleton();
$_SESSION['horde_auth'] = array(
'app' => $app_array,
'browser' => $browser->getAgentString(),
'change' => !empty($options['change']),
- 'credentials' => $credentials,
- 'driver' => ($app == 'horde') ? $GLOBALS['conf']['auth']['driver'] : $app,
+ 'credentials' => Horde_Secret::write(Horde_Secret::getKey('auth'), serialize($credentials)),
+ 'driver' => $GLOBALS['conf']['auth']['driver'],
'remoteAddr' => isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : null,
'timestamp' => time(),
'userId' => $userId
*
* @var array
*/
- protected $_credentials = array();
+ protected $_credentials = array(
+ 'credentials' => array(),
+ 'params' => array('change' => false),
+ 'userId' => ''
+ );
/**
* Constructor.
/* Store the credentials being checked so that subclasses can modify
* them if necessary. */
- $this->_credentials = array(
- 'credentials' => $credentials,
- 'params' => array('change' => false),
- 'userId' => $userId
- );
+ $this->_credentials['credentials'] = $credentials;
+ $this->_credentials['userId'] = $userId;
try {
$this->_authenticate($userId, $credentials);
*/
public function transparent()
{
- /* Reset the credentials being checked so that subclasses can modify
- * them if necessary. */
- $this->_credentials = array(
- 'credentials' => array(),
- 'params' => array('change' => false),
- 'userId' => ''
- );
-
if ($this->_transparent()) {
return Horde_Auth::setAuth(
$this->_credentials['userId'],