From: Duck (Jakob Munih) Date: Sun, 8 Mar 2009 11:37:18 +0000 (+0100) Subject: Catch registry errors X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c2ad70a6f68b80b2737b433bd0cb991e6106cbcd;p=horde.git Catch registry errors --- diff --git a/folks/lib/Auth/folks.php b/folks/lib/Auth/folks.php index b0d41e77d..20304f7d2 100644 --- a/folks/lib/Auth/folks.php +++ b/folks/lib/Auth/folks.php @@ -52,7 +52,12 @@ class Auth_folks extends Auth_application { */ function _getLoginScreen($app = 'folks', $url = '') { - $login = Horde::url($GLOBALS['registry']->get('webroot', 'folks') . '/login.php', true); + $webroot = $GLOBALS['registry']->get('webroot', 'folks'); + if ($webroot instanceof PEAR_Error) { + return $webroot; + } + + $login = Horde::url($webroot . '/login.php', true); if (!empty($url)) { $login = Util::addParameter($login, 'url', $url); } @@ -90,7 +95,12 @@ class Auth_folks extends Auth_application { $password = Auth::genRandomPassword(); /* Process. */ - require_once $GLOBALS['registry']->get('fileroot', 'folks') . '/lib/base.php'; + $fileroot = $GLOBALS['registry']->get('webroot', 'folks'); + if ($fileroot instanceof PEAR_Error) { + return $fileroot; + } + + require_once $fileroot . '/lib/base.php'; $result = $GLOBALS['folks_driver']->changePassword($password, $userId); if ($result instanceof PEAR_Error) { return $result; @@ -112,7 +122,12 @@ class Auth_folks extends Auth_application { return false; } - require_once $GLOBALS['registry']->get('fileroot', 'folks') . '/lib/base.php'; + $fileroot = $GLOBALS['registry']->get('webroot', 'folks'); + if ($fileroot instanceof PEAR_Error) { + return $fileroot; + } + + require_once $fileroot . '/lib/base.php'; if ($_COOKIE['folks_login_code'] != $GLOBALS['folks_driver']->getCookie($_COOKIE['folks_login_user'])) { return false; }