diff --git a/phpgwapi/inc/functions.inc.php b/phpgwapi/inc/functions.inc.php
index d0f275c3ae..9e8fc7ea13 100644
--- a/phpgwapi/inc/functions.inc.php
+++ b/phpgwapi/inc/functions.inc.php
@@ -85,9 +85,12 @@
echo '
The administrator must upgrade the header.inc.php file before you can continue.';
exit;
}
- reset($GLOBALS['phpgw_domain']);
- list($GLOBALS['phpgw_info']['server']['default_domain']) = each($GLOBALS['phpgw_domain']);
-
+ if (!isset($GLOBALS['phpgw_info']['server']['default_domain']) || // allow to overwrite the default domain
+ !isset($GLOBALS['phpgw_domain'][$GLOBALS['phpgw_info']['server']['default_domain']]))
+ {
+ reset($GLOBALS['phpgw_domain']);
+ list($GLOBALS['phpgw_info']['server']['default_domain']) = each($GLOBALS['phpgw_domain']);
+ }
if (isset($_POST['login'])) // on login
{
$GLOBALS['login'] = $_POST['login'];