$userId = self::addHook(trim($userId));
if (!empty($GLOBALS['conf']['hooks']['postauthenticate'])) {
- try {
- if (!Horde::callHook('_horde_hook_postauthenticate', array($userId, $credentials, $realm), 'horde')) {
- if (self::getAuthError() != self::REASON_MESSAGE) {
- self::setAuthError(self::REASON_FAILED);
- }
- return false;
+ if (Horde::callHook('_horde_hook_postauthenticate', array($userId, $credentials, $realm), 'horde') === false) {
+ if (self::getAuthError() != self::REASON_MESSAGE) {
+ self::setAuthError(self::REASON_FAILED);
}
- } catch (Horde_Exception $e) {}
+ return false;
+ }
}
/* If we're already set with this userId, don't continue. */
: $_SERVER['HTTP_X_FORWARDED_FOR'];
if (class_exists('Net_DNS')) {
- $resolver = new Net_DNS_Resolver();
- $resolver->retry = isset($GLOBALS['conf']['dns']['retry']) ? $GLOBALS['conf']['dns']['retry'] : 1;
- $resolver->retrans = isset($GLOBALS['conf']['dns']['retrans']) ? $GLOBALS['conf']['dns']['retrans'] : 1;
- $response = $resolver->query($host, 'PTR');
- $ptrdname = $response ? $response->answer[0]->ptrdname : $host;
- } else {
- $ptrdname = @gethostbyaddr($host);
- }
+ $resolver = new Net_DNS_Resolver();
+ $resolver->retry = isset($GLOBALS['conf']['dns']['retry']) ? $GLOBALS['conf']['dns']['retry'] : 1;
+ $resolver->retrans = isset($GLOBALS['conf']['dns']['retrans']) ? $GLOBALS['conf']['dns']['retrans'] : 1;
+ $response = $resolver->query($host, 'PTR');
+ $ptrdname = $response ? $response->answer[0]->ptrdname : $host;
+ } else {
+ $ptrdname = @gethostbyaddr($host);
+ }
$last_login = array('time' => time(), 'host' => $ptrdname);
$GLOBALS['prefs']->setValue('last_login', serialize($last_login));
* @param string $userId The authentication backend's user name.
*
* @return string The internal Horde user name.
- * @throws Horde_Exception
*/
static public function addHook($userId)
{
* @param string $userId The internal Horde user name.
*
* @return string The authentication backend's user name.
- * @throws Horde_Exception
*/
static public function removeHook($userId)
{
$userId = trim($userId);
if (!empty($GLOBALS['conf']['hooks']['preauthenticate'])) {
- try {
- if (!Horde::callHook('_horde_hook_preauthenticate', array($userId, $credentials, $realm), 'horde')) {
- if (Horde_Auth::getAuthError() != Horde_Auth::REASON_MESSAGE) {
- Horde_Auth::setAuthError(Horde_Auth::REASON_FAILED);
- }
- return false;
+ if (!Horde::callHook('_horde_hook_preauthenticate', array($userId, $credentials, $realm), 'horde')) {
+ if (Horde_Auth::getAuthError() != Horde_Auth::REASON_MESSAGE) {
+ Horde_Auth::setAuthError(Horde_Auth::REASON_FAILED);
}
- } catch (Horde_Exception $e) {}
+ return false;
+ }
}
/* Store the credentials being checked so that subclasses can modify
/* Connect to the MSAD server. */
$this->_connect();
- try {
- $entry = Horde::callHook('_horde_hook_authmsad', array($accountName, $credentials), 'horde');
- } catch (Horde_Exception $e) {}
-
+ $entry = Horde::callHook('_horde_hook_authmsad', array($accountName, $credentials), 'horde');
if (!is_null($entry)) {
$dn = $entry['dn'];
unset($entry['dn']);
/* Connect to the MSAD server. */
$this->_connect();
- try {
- $entry = Horde::callHook('_horde_hook_authmsad', array($accountName), 'horde');
- } catch (Horde_Exception $e) {}
-
+ $entry = Horde::callHook('_horde_hook_authmsad', array($accountName), 'horde');
$dn = is_null($entry)
/* Search for the user's full DN. */
? $this->_findDN($accountName)
/* Connect to the MSAD server. */
$this->_connect();
- try {
- $entry = Horde::callHook('_horde_hook_authmsad', array($oldId, $credentials), 'horde');
- } catch (Horde_Exception $e) {}
-
+ $entry = Horde::callHook('_horde_hook_authmsad', array($oldId, $credentials), 'horde');
if (!is_null($entry)) {
$olddn = $entry['dn'];
unset($entry['dn']);
// Perform any preprocessing if requested.
if ($conf['signup']['preprocess']) {
- try {
- $info = Horde::callHook('_horde_hook_signup_preprocess', array($info));
- } catch (Horde_Exception $e) {}
+ $info = Horde::callHook('_horde_hook_signup_preprocess', array($info));
}
// Check to see if the username already exists.
}
if ($conf['signup']['queue']) {
- try {
- $result = Horde::callHook('_horde_hook_signup_queued', array($info['user_name'], $info));
- } catch (Horde_Exception $e) {}
+ $result = Horde::callHook('_horde_hook_signup_queued', array($info['user_name'], $info));
}
if (!empty($conf['signup']['email'])) {
$this->addHidden('', 'url', 'text', false);
/* Use hooks get any extra fields required in signing up. */
- try {
- $extra = Horde::callHook('_horde_hook_signup_getextra');
- } catch (Horde_Exception $e) {}
-
+ $extra = Horde::callHook('_horde_hook_signup_getextra');
if (!empty($extra)) {
if (!isset($extra['user_name'])) {
$this->addVariable(_("Choose a username"), 'user_name', 'text', true);
if (Horde_Auth::getAuth()) {
try {
$this->_cacheob = Horde_Cache::singleton($conf['cache']['driver'], Horde::getDriverConfig('cache', $conf['cache']['driver']));
- } catch (Horde_Exception $e) {}
+ } catch (Horde_Exception $e) {
+ // @TODO Log error
+ }
}
$this->_regmtime = max(filemtime(HORDE_BASE . '/config/registry.php'),
$this->_appStack[] = $app;
/* Call post-push hook. */
- try {
- Horde::callHook('_horde_hook_post_pushapp', array($app), 'horde');
- } catch (Horde_Exception $e) {}
+ Horde::callHook('_horde_hook_post_pushapp', array($app), 'horde');
return true;
}