True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
);
$safe_er = error_reporting();
include ('./inc/functions.inc.php');
error_reporting($safe_er);
$GLOBALS['phpgw_info']['setup']['stage']['header'] = $GLOBALS['phpgw_setup']->detection->check_header();
if ($GLOBALS['phpgw_info']['setup']['stage']['header'] == '10')
{
// Check header and authentication
if (!$GLOBALS['phpgw_setup']->auth('Config') && !$GLOBALS['phpgw_setup']->auth('Header'))
{
Header('Location: index.php');
exit;
}
}
$passed_icon = ' ';
$error_icon = '';
$warning_icon = ' ';
}
else
{
$passed_icon = '>>> Passed ';
$error_icon = '*** Error: ';
$warning_icon = '!!! Warning: ';
function lang($msg,$arg1=NULL,$arg2=NULL,$arg3=NULL,$arg4=NULL)
{
return is_null($arg1) ? $msg : str_replace(array('%1','%2','%3','%4'),array($arg1,$arg2,$arg3,$arg4),$msg);
}
}
$checks = array(
'safe_mode' => array(
'func' => 'php_ini_check',
'value' => 0,
'verbose_value' => 'Off',
'warning' => lang('safe_mode is turned on, which is generaly a good thing as it makes your install more secure.')."\n".
lang('If safe_mode is turned on, eGW is not able to change certain settings on runtime, nor can we load any not yet loaded module.')."\n".
lang('*** You have to do the changes manualy in your php.ini (usualy in /etc on linux) in order to get eGW fully working !!!')."\n".
lang('*** Do NOT update your database via setup, as the update might be interrupted by the max_execution_time, which leaves your DB in an unrecoverable state (your data is lost) !!!')
),
/* not longer needed, as it gets set now on runtime (works even with safe_mode)
'error_reporting' => array(
'func' => 'php_ini_check',
'value' => E_NOTICE,
'verbose_value' => 'E_NOTICE',
'check' => 'not set',
'safe_mode' => 'error_reporting = E_ALL & ~E_NOTICE'
),
*/
'magic_quotes_runtime' => array(
'func' => 'php_ini_check',
'value' => 0,
'verbose_value' => 'Off',
'safe_mode' => 'magic_quotes_runtime = Off'
),
'register_globals' => array(
'func' => 'php_ini_check',
'value' => 0,
'verbose_value' => 'Off',
'warning' => lang("register_globals is turned On, eGroupWare does NOT require it and it's generaly more secure to have it turned Off")
),
'memory_limit' => array(
'func' => 'php_ini_check',
'value' => '16M',
'check' => '>=',
'error' => lang('memory_limit is set to less than 16M: some applications of eGroupWare need more than the recommend 8M, expect occasional failures'),
'change' => 'memory_limit = 16M'
),
'max_execution_time' => array(
'func' => 'php_ini_check',
'value' => 30,
'check' => '>=',
'error' => lang('max_execution_time is set to less than 30 (seconds): eGroupWare sometimes needs a higher execution_time, expect occasional failures'),
'safe_mode' => 'max_execution_time = 30'
),
'include_path' => array(
'func' => 'php_ini_check',
'value' => '.',
'check' => 'contain',
'error' => lang('include_path need to contain "." - the current directory'),
'save_mode' => 'max_execution_time = 30'
),
'mysql' => array(
'func' => 'extension_check',
'warning' => " permision_check('$name',".print_r($args,True).",'$verbose')
\n";
if (!$availible)
{
echo $args['warning'];
}
echo "\n";
return $availible;
}
function verbosePerms( $in_Perms )
{
if($in_Perms & 0x1000) // FIFO pipe
{
$sP = 'p';
}
elseif($in_Perms & 0x2000) // Character special
{
$sP = 'c';
}
elseif($in_Perms & 0x4000) // Directory
{
$sP = 'd';
}
elseif($in_Perms & 0x6000) // Block special
{
$sP = 'b';
}
elseif($in_Perms & 0x8000) // Regular
{
$sP = '-';
}
elseif($in_Perms & 0xA000) // Symbolic Link
{
$sP = 'l';
}
elseif($in_Perms & 0xC000) // Socket
{
$sP = 's';
}
else // UNKNOWN
{
$sP = 'u';
}
// owner
$sP .= (($in_Perms & 0x0100) ? 'r' : '-') .
(($in_Perms & 0x0080) ? 'w' : '-') .
(($in_Perms & 0x0040) ? (($in_Perms & 0x0800) ? 's' : 'x' ) :
(($in_Perms & 0x0800) ? 'S' : '-'));
// group
$sP .= (($in_Perms & 0x0020) ? 'r' : '-') .
(($in_Perms & 0x0010) ? 'w' : '-') .
(($in_Perms & 0x0008) ? (($in_Perms & 0x0400) ? 's' : 'x' ) :
(($in_Perms & 0x0400) ? 'S' : '-'));
// world
$sP .= (($in_Perms & 0x0004) ? 'r' : '-') .
(($in_Perms & 0x0002) ? 'w' : '-') .
(($in_Perms & 0x0001) ? (($in_Perms & 0x0200) ? 't' : 'x' ) :
(($in_Perms & 0x0200) ? 'T' : '-'));
return $sP;
}
function permission_check($name,$args,$verbose=True)
{
global $passed_icon, $error_icon, $warning_icon,$is_windows;
//echo "
\n";
if (!file_exists($name))
{
echo $error_icon . $msg . lang('%1 does not exist !!!',$rel_name)."
\n";
return False;
}
$warning = False;
if (!$GLOBALS['run_by_webserver'] && (@$args['is_readable'] || @$args['is_writable']))
{
echo $warning_icon.' '.$msg. lang('Check can only be performed, if called via a webserver, as the user-id/-name of the webserver is not known.')."
\n";
unset($args['is_readable']);
unset($args['is_writable']);
$warning = True;
}
$Ok = True;
if (isset($args['is_writable']) && is_writable($name) != $args['is_writable'])
{
echo "$error_icon $msg ".lang('%1 is %2%3 !!!',$rel_name,$args['is_writable']?lang('not').' ':'',lang('writable by the webserver'))."
\n";
$Ok = False;
}
if (isset($args['is_readable']) && is_readable($name) != $args['is_readable'])
{
echo "$error_icon $msg ". lang('%1 is %2%3 !!!',$rel_name,$args['is_readable']?lang('not').' ':'',lang('readable by the webserver'))."
\n";
$Ok = False;
}
if (!$is_windows && isset($args['is_world_readable']) && !(fileperms($name) & 04) == $args['is_world_readable'])
{
echo "$error_icon $msg" . lang('%1 is %2%3 !!!',$rel_name,$args['is_world_readable']?lang('not').' ':'',lang('world readable'))."
\n";
$Ok = False;
}
if (!$is_windows && isset($args['is_world_writable']) && !(fileperms($name) & 02) == $args['is_world_writable'])
{
echo "$error_icon $msg " . lang('%1 is %2%3 !!!',$rel_name,$args['is_world_writable']?lang('not').' ':'',lang('world writable'))."
\n";
$Ok = False;
}
if ($Ok && !$warning && $verbose)
{
echo $passed_icon.' '.$msg;
}
if ($Ok && @$args['recursiv'] && is_dir($name))
{
if ($verbose)
{
echo "
'.lang('The first step in installing eGroupWare is to ensure your environment has the necessary settings to correctly run the application.');
echo '
'.lang('We will now run a series of tests, which may take a few minutes. Click the link below to proceed.');
echo '
\n";; } } else { echo "Checking the eGroupWare Installation\n"; echo "====================================\n\n"; } $Ok = True; foreach ($checks as $name => $args) { $check_ok = $args['func']($name,$args); $Ok = $Ok && $check_ok; } if ($run_by_webserver) { # echo "\n";; if ($GLOBALS['phpgw_info']['setup']['stage']['header'] != 10) { if (!$Ok) { echo '