setting the session.save_path to /tmp only for session.save_handler=files and !is_writable(session.save_path)

This commit is contained in:
Ralf Becker 2008-03-06 06:03:18 +00:00
parent 60a65bb560
commit a53b69af40
3 changed files with 13 additions and 3 deletions

View File

@ -33,7 +33,7 @@ else
$arg0s = explode(',',@array_shift($arguments));
@list(,$_GET['domain']) = explode('@',$arg0s[0]);
if (!is_writable(ini_get('session.save_path')) && is_dir('/tmp') && is_writable('/tmp'))
if (ini_get('session.save_handler') == 'files' && !is_writable(ini_get('session.save_path')) && is_dir('/tmp') && is_writable('/tmp'))
{
ini_set('session.save_path','/tmp'); // regular users may have no rights to apache's session dir
}

View File

@ -427,6 +427,9 @@ function load_wrapper($url)
case 'webdav':
require_once('HTTP/WebDAV/Client.php');
break;
case 'smb':
require_once('../phpgwapi/inc/class.smb_stream_wrapper.inc.php');
break;
case 'oldvfs':
case 'vfs':
case 'sqlfs':
@ -456,7 +459,7 @@ function load_wrapper($url)
*/
function load_egw($user,$passwd,$domain='default')
{
echo "load_egw($user,$passwd,$domain)\n";
//echo "load_egw($user,$passwd,$domain)\n";
$_GET['domain'] = $domain;
$GLOBALS['egw_login_data'] = array(
'login' => $user,
@ -464,7 +467,10 @@ function load_egw($user,$passwd,$domain='default')
'passwd_type' => 'text',
);
if (is_dir('/tmp')) ini_set('session.save_path','/tmp'); // regular users may have no rights to apache's session dir
if (ini_get('session.save_handler') == 'files' && !is_writable(ini_get('session.save_path')) && is_dir('/tmp') && is_writable('/tmp'))
{
ini_set('session.save_path','/tmp'); // regular users may have no rights to apache's session dir
}
$GLOBALS['egw_info'] = array(
'flags' => array(

View File

@ -32,6 +32,10 @@ else
$_POST['ConfigLang'] = get_lang($charset);
create_http_enviroment(); // guessing the docroot etc.
if (ini_get('session.save_handler') == 'files' && !is_writable(ini_get('session.save_path')) && is_dir('/tmp') && is_writable('/tmp'))
{
ini_set('session.save_path','/tmp'); // regular users may have no rights to apache's session dir
}
// setting up the $GLOBALS['egw_setup'] object AND including the header.inc.php if it exists
$GLOBALS['egw_info'] = array(
'flags' => array(