diff --git a/header.inc.php.template b/header.inc.php.template index fda5023796..07ec27b0a0 100644 --- a/header.inc.php.template +++ b/header.inc.php.template @@ -22,6 +22,7 @@ define('PHPGW_INCLUDE_ROOT','{INCLUDE_ROOT}'); $GLOBALS['phpgw_info']['server']['header_admin_user'] = '{HEADER_ADMIN_USER}'; $GLOBALS['phpgw_info']['server']['header_admin_password'] = '{HEADER_ADMIN_PASSWORD}'; + $GLOBALS['phpgw_info']['server']['setup_acl'] = '{SETUP_ACL}'; /* eGroupWare domain-specific db settings */{domains} /* diff --git a/phpgwapi/inc/class.setup.inc.php b/phpgwapi/inc/class.setup.inc.php index 1517f69573..2d9abc5302 100644 --- a/phpgwapi/inc/class.setup.inc.php +++ b/phpgwapi/inc/class.setup.inc.php @@ -114,8 +114,6 @@ function auth($auth_type='Config') { #phpinfo(); - #$remoteip = $_SERVER['REMOTE_ADDR']; - $FormLogout = get_var('FormLogout', array('GET','POST')); if(!$FormLogout) { @@ -145,7 +143,8 @@ } } - /* if(!empty($remoteip) && !$this->checkip($remoteip)) { return False; } */ + $remoteip = $_SERVER['REMOTE_ADDR']; + if(!empty($remoteip) && !$this->checkip($remoteip)) { return False; } /* If FormLogout is set, simply invalidate the cookies (LOGOUT) */ switch(strtolower($FormLogout)) @@ -285,11 +284,15 @@ function checkip($remoteip='') { $allowed_ips = split(',',$GLOBALS['phpgw_info']['server']['setup_acl']); - if(is_array($allowed_ips)) + if(!empty($GLOBALS['phpgw_info']['server']['setup_acl']) && is_array($allowed_ips) && count($allowed_ips) > 0) { $foundip = False; - while(list(,$value) = @each($allowed_ips)) + foreach($allowed_ips as $value) { + if (!preg_match('/^[0-9.]$/',$value)) + { + $value = gethostbyname($value); // resolve domain-name, eg. a dyndns account + } $test = split("\.",$value); if(count($test) < 3) { diff --git a/setup/templates/default/manageheader.tpl b/setup/templates/default/manageheader.tpl index 4ada6b2c26..b040500224 100644 --- a/setup/templates/default/manageheader.tpl +++ b/setup/templates/default/manageheader.tpl @@ -40,7 +40,9 @@