installation check if session.save_path is writable by the webserver: might help people who cant log into eGW because of "session could not be verified"

This commit is contained in:
Ralf Becker 2006-07-09 18:39:01 +00:00
parent 6b327c6c4f
commit 9b32a9ac76
3 changed files with 46 additions and 20 deletions

View File

@ -141,7 +141,7 @@
'session' => array( 'session' => array(
'func' => 'extension_check', 'func' => 'extension_check',
'warning' => lang('The session extension is needed to use php sessions (db-sessions work without).') 'warning' => lang('The session extension is needed to use php sessions (db-sessions work without).')
), ),
// leave SyncML checks here for now, as it is no app atm. // leave SyncML checks here for now, as it is no app atm.
'' => array( '' => array(
'func' => 'pear_check', 'func' => 'pear_check',
@ -150,18 +150,30 @@
'Log' => array( 'Log' => array(
'func' => 'pear_check', 'func' => 'pear_check',
'from' => 'SyncML', 'from' => 'SyncML',
), ),
/*
'.' => array( '.' => array(
'func' => 'permission_check', 'func' => 'permission_check',
'is_world_writable' => False, 'is_world_writable' => False,
'recursiv' => True 'recursiv' => True
), ),
*/
'header.inc.php' => array( 'header.inc.php' => array(
'func' => 'permission_check', 'func' => 'permission_check',
'is_world_readable' => False, 'is_world_readable' => False,
'only_if_exists' => @$GLOBALS['egw_info']['setup']['stage']['header'] != 10 'only_if_exists' => @$GLOBALS['egw_info']['setup']['stage']['header'] != 10
), ),
); );
if (extension_loaded('session'))
{
//ini_set('session.save_path','/hugo');
$checks[session_save_path()] = array(
'func' => 'permission_check',
'is_writable' => true,
'msg' => lang("Checking if php.ini setting session.save_path='%1' is writable by the webserver",session_save_path()),
'error' => lang('You will NOT be able to log into eGroupWare using PHP sessions: "session could not be verified" !!!'),
);
}
$setup_info = $GLOBALS['egw_setup']->detection->get_versions(); $setup_info = $GLOBALS['egw_setup']->detection->get_versions();
foreach($setup_info as $app => $app_data) foreach($setup_info as $app => $app_data)
{ {
@ -362,12 +374,12 @@
global $passed_icon, $error_icon, $warning_icon,$is_windows; global $passed_icon, $error_icon, $warning_icon,$is_windows;
//echo "<p>permision_check('$name',".print_r($args,True).",'$verbose')</p>\n"; //echo "<p>permision_check('$name',".print_r($args,True).",'$verbose')</p>\n";
if (substr($name,0,3) != '../') // add a ../ for non-absolute pathes
$rel_name = $name;
if (substr($name,0,3) != '../' && $name{0} != '/' && $name{0} != '\\' && strstr($name,':') === false)
{ {
$name = '../'.$name; $name = '../'.$name;
} }
$rel_name = substr($name,3);
if (!file_exists($name) && isset($args['only_if_exists']) && $args['only_if_exists']) if (!file_exists($name) && isset($args['only_if_exists']) && $args['only_if_exists'])
{ {
return True; return True;
@ -384,32 +396,42 @@
$checks = array(); $checks = array();
if (isset($args['is_readable'])) if (isset($args['is_readable']))
{ {
$checks[] = lang('readable by the webserver'); $checks[] = lang('readable by the webserver');
$check_not = (!$args['is_readable']?lang('not'):''); $check_not = (!$args['is_readable']?lang('not'):'');
} }
if (isset($args['is_writable'])) if (isset($args['is_writable']))
{ {
$checks[] = lang('writable by the webserver'); $checks[] = lang('writable by the webserver');
$check_not = (!$args['is_writable']?lang('not'):''); $check_not = (!$args['is_writable']?lang('not'):'');
} }
if (isset($args['is_world_readable'])) if (isset($args['is_world_readable']))
{ {
$checks[] = lang('world readable'); $checks[] = lang('world readable');
$check_not = (!$args['is_world_readable']?lang('not'):''); $check_not = (!$args['is_world_readable']?lang('not'):'');
} }
if (isset($args['is_world_writable'])) if (isset($args['is_world_writable']))
{ {
$checks[] = lang('world writable'); $checks[] = lang('world writable');
$check_not = (!$args['is_world_writable']?lang('not'):''); $check_not = (!$args['is_world_writable']?lang('not'):'');
} }
$checks = implode(', ',$checks); $checks = implode(', ',$checks);
$icon = $passed_icon; $icon = $passed_icon;
$msg = lang('Checking file-permissions of %1 for %2 %3: %4',$rel_name,$check_not,$checks,$perms)."<br />\n"; if (($msg = $args['msg']))
{
$msg .= ': '.$perms."<br />\n";
}
else
{
$msg = lang('Checking file-permissions of %1 for %2 %3: %4',$rel_name,$check_not,$checks,$perms)."<br />\n";
}
if ($args['error'])
{
$extra_error_msg = "<br />\n".$args['error'];
}
if (!file_exists($name)) if (!file_exists($name))
{ {
echo '<div>'. $error_icon . '<span class="setup_error">' . $msg . lang('%1 does not exist !!!',$rel_name)."</span></div>\n"; echo '<div>'. $error_icon . '<span class="setup_error">' . $msg . lang('%1 does not exist !!!',$rel_name).$extra_error_msg."</span></div>\n";
return False; return False;
} }
$warning = False; $warning = False;
@ -423,22 +445,22 @@
$Ok = True; $Ok = True;
if (isset($args['is_writable']) && is_writable($name) != $args['is_writable']) if (isset($args['is_writable']) && is_writable($name) != $args['is_writable'])
{ {
echo '<div>'.$error_icon.' <span class="setup_error">'.$msg.' '.lang('%1 is %2%3 !!!',$rel_name,$args['is_writable']?lang('not').' ':'',lang('writable by the webserver'))."</span></div>\n"; echo '<div>'.$error_icon.' <span class="setup_error">'.$msg.' '.lang('%1 is %2%3 !!!',$rel_name,$args['is_writable']?lang('not').' ':'',lang('writable by the webserver')).$extra_error_msg."</span></div>\n";
$Ok = False; $Ok = False;
} }
if (isset($args['is_readable']) && is_readable($name) != $args['is_readable']) if (isset($args['is_readable']) && is_readable($name) != $args['is_readable'])
{ {
echo '<div>'.$error_icon.' <span class="setup_error">'.$msg.' '.lang('%1 is %2%3 !!!',$rel_name,$args['is_readable']?lang('not').' ':'',lang('readable by the webserver'))."</span></div>\n"; echo '<div>'.$error_icon.' <span class="setup_error">'.$msg.' '.lang('%1 is %2%3 !!!',$rel_name,$args['is_readable']?lang('not').' ':'',lang('readable by the webserver')).$extra_error_msg."</span></div>\n";
$Ok = False; $Ok = False;
} }
if (!$is_windows && isset($args['is_world_readable']) && !(fileperms($name) & 04) == $args['is_world_readable']) if (!$is_windows && isset($args['is_world_readable']) && !(fileperms($name) & 04) == $args['is_world_readable'])
{ {
echo '<div>'.$error_icon.' <span class="setup_error">'.$msg.' '.lang('%1 is %2%3 !!!',$rel_name,$args['is_world_readable']?lang('not').' ':'',lang('world readable'))."</span></div>\n"; echo '<div>'.$error_icon.' <span class="setup_error">'.$msg.' '.lang('%1 is %2%3 !!!',$rel_name,$args['is_world_readable']?lang('not').' ':'',lang('world readable')).$extra_error_msg."</span></div>\n";
$Ok = False; $Ok = False;
} }
if (!$is_windows && isset($args['is_world_writable']) && !(fileperms($name) & 02) == $args['is_world_writable']) if (!$is_windows && isset($args['is_world_writable']) && !(fileperms($name) & 02) == $args['is_world_writable'])
{ {
echo '<div>'.$error_icon.' <span class="setup_error">'.$msg.' '.lang('%1 is %2%3 !!!',$rel_name,$args['is_world_writable']?lang('not').' ':'',lang('world writable'))."</span></div>\n"; echo '<div>'.$error_icon.' <span class="setup_error">'.$msg.' '.lang('%1 is %2%3 !!!',$rel_name,$args['is_world_writable']?lang('not').' ':'',lang('world writable')).$extra_error_msg."</span></div>\n";
$Ok = False; $Ok = False;
} }
if ($Ok && !$warning && $verbose) if ($Ok && !$warning && $verbose)

View File

@ -109,6 +109,7 @@ check ip address of all sessions setup de IP Adresse bei allen Sessions
checking extension %1 is loaded or loadable setup de Überprüfe ob die Erweiterung %1 geladen oder ladbar ist checking extension %1 is loaded or loadable setup de Überprüfe ob die Erweiterung %1 geladen oder ladbar ist
checking file-permissions of %1 for %2 %3: %4 setup de Überprüfe Datei Zugriffsrechte von %1 für %2 %3: %4 checking file-permissions of %1 for %2 %3: %4 setup de Überprüfe Datei Zugriffsrechte von %1 für %2 %3: %4
checking for gd support... setup de Überprüfe die GD Unterstützung... checking for gd support... setup de Überprüfe die GD Unterstützung...
checking if php.ini setting session.save_path='%1' is writable by the webserver setup de Überprüfe ob der Webserver auf die php.ini Einstellung session.save_path='%1' schreiben kann
checking pear%1 is installed setup de Überprüfe ob PEAR%1 installiert ist checking pear%1 is installed setup de Überprüfe ob PEAR%1 installiert ist
checking php.ini setup de Überprüfe die php.ini Datei checking php.ini setup de Überprüfe die php.ini Datei
checking required php version %1 (recommended %2) setup de Überprüfe benötigte PHP Version %1 (empfohlen %2) checking required php version %1 (recommended %2) setup de Überprüfe benötigte PHP Version %1 (empfohlen %2)
@ -615,6 +616,7 @@ you need to fix the above errors, before the configuration file header.inc.php c
you need to save the settings you made here first! setup de Sie müssen die hier vorgenommenen Einstellungen zuerst speichern! you need to save the settings you made here first! setup de Sie müssen die hier vorgenommenen Einstellungen zuerst speichern!
you need to select your current charset! setup de Sie müssen Ihren aktuellen Zeichensatz auswählen! you need to select your current charset! setup de Sie müssen Ihren aktuellen Zeichensatz auswählen!
you should either uninstall and then reinstall it, or attempt manual repairs setup de Sie sollten entweder de- und neuinstallieren, oder manuelle Reparaturen versuchen you should either uninstall and then reinstall it, or attempt manual repairs setup de Sie sollten entweder de- und neuinstallieren, oder manuelle Reparaturen versuchen
you will not be able to log into egroupware using php sessions: "session could not be verified" !!! setup de Sie werden sich NICHT mit PHP Sitzungen in die eGroupWare einlogen: "Ihre Sitzung konnte nicht verifiziert werden" !!!
you're using an old configuration file format... setup de Sie verwenden ein altes Format der Konfigurationsdatei ... you're using an old configuration file format... setup de Sie verwenden ein altes Format der Konfigurationsdatei ...
you're using an old header.inc.php version... setup de Sie verwenden eine alte header.inc.php Version ... you're using an old header.inc.php version... setup de Sie verwenden eine alte header.inc.php Version ...
your applications are current setup de Ihre Anwendungen sind aktuell your applications are current setup de Ihre Anwendungen sind aktuell

View File

@ -109,6 +109,7 @@ check ip address of all sessions setup en check ip address of all sessions
checking extension %1 is loaded or loadable setup en Checking extension %1 is loaded or loadable checking extension %1 is loaded or loadable setup en Checking extension %1 is loaded or loadable
checking file-permissions of %1 for %2 %3: %4 setup en Checking file-permissions of %1 for %2 %3: %4 checking file-permissions of %1 for %2 %3: %4 setup en Checking file-permissions of %1 for %2 %3: %4
checking for gd support... setup en Checking for GD support... checking for gd support... setup en Checking for GD support...
checking if php.ini setting session.save_path='%1' is writable by the webserver setup en Checking if php.ini setting session.save_path='%1' is writable by the webserver
checking pear%1 is installed setup en Checking PEAR%1 is installed checking pear%1 is installed setup en Checking PEAR%1 is installed
checking php.ini setup en Checking php.ini checking php.ini setup en Checking php.ini
checking required php version %1 (recommended %2) setup en Checking required PHP version %1 (recommended %2) checking required php version %1 (recommended %2) setup en Checking required PHP version %1 (recommended %2)
@ -613,6 +614,7 @@ you need to fix the above errors, before the configuration file header.inc.php c
you need to save the settings you made here first! setup en You need to save the settings you made here first! you need to save the settings you made here first! setup en You need to save the settings you made here first!
you need to select your current charset! setup en You need to select your current charset! you need to select your current charset! setup en You need to select your current charset!
you should either uninstall and then reinstall it, or attempt manual repairs setup en You should either uninstall and then reinstall it, or attempt manual repairs you should either uninstall and then reinstall it, or attempt manual repairs setup en You should either uninstall and then reinstall it, or attempt manual repairs
you will not be able to log into egroupware using php sessions: "session could not be verified" !!! setup en You will NOT be able to log into eGroupWare using PHP sessions: "session could not be verified" !!!
you're using an old configuration file format... setup en You're using an old configuration file format... you're using an old configuration file format... setup en You're using an old configuration file format...
you're using an old header.inc.php version... setup en You're using an old header.inc.php version... you're using an old header.inc.php version... setup en You're using an old header.inc.php version...
your applications are current setup en Your applications are current your applications are current setup en Your applications are current