From a53b69af40983321dd86c8ab8f1fecf57de8a6e8 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 6 Mar 2008 06:03:18 +0000 Subject: [PATCH] setting the session.save_path to /tmp only for session.save_handler=files and !is_writable(session.save_path) --- admin/admin-cli.php | 2 +- filemanager/cli.php | 10 ++++++++-- setup/setup-cli.php | 4 ++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/admin/admin-cli.php b/admin/admin-cli.php index 68101e3727..95f50899b1 100755 --- a/admin/admin-cli.php +++ b/admin/admin-cli.php @@ -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 } diff --git a/filemanager/cli.php b/filemanager/cli.php index 171d2c7a80..c0c6406187 100755 --- a/filemanager/cli.php +++ b/filemanager/cli.php @@ -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( diff --git a/setup/setup-cli.php b/setup/setup-cli.php index 4227bde720..9f6fbbd149 100755 --- a/setup/setup-cli.php +++ b/setup/setup-cli.php @@ -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(