public function setAuthCredential($credential, $value = null, $app = null)
{
global $session;
if (!$this->getAuth()) {
return;
}
if (is_array($credential)) {
$credentials = $credential;
} else {
if (($credentials = $this->_getAuthCredentials($app)) === false) {
return;
}
if (!is_array($credentials)) {
$credentials = array();
}
$credentials[$credential] = $value;
}
$entry = $credentials;
if (($base_app = $session->get('horde', 'auth/credentials')) && $session->get('horde', 'auth_app/' . $base_app) == $entry) {
$entry = true;
}
if (is_null($app)) {
$app = $base_app;
}
/* The auth_app key contains application-specific authentication.
* Session subkeys are the app names, values are an array containing
* credentials. If the value is true, application does not require any
* specific credentials. */
$session->set('horde', 'auth_app/' . $app, $entry, $session::ENCRYPT);
$session->set('horde', 'auth_app_init/' . $app, true);
unset($this->_cache['existing'][$app], $this->_cache['isauth'][$app]);
}