From b6996bee01be2f80bed8bb0310ef0f8158abdb8c Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 9 Oct 2008 16:22:42 +0000 Subject: [PATCH] reworked manageheader: - removed include_root (is now always identical to server_root) - removed mcrypt_version (not relevant to todays php versions) - replaced session_type with session_handler - look is now a bit more like setup and eGroupware itself --> updated header-version to 1.29 forcing everyone to update --- header.inc.php.template | 2 +- phpgwapi/setup/setup.inc.php | 2 +- setup/inc/class.setup_detection.inc.php | 14 +- setup/manageheader.php | 81 ++---- setup/templates/default/head.tpl | 37 +-- setup/templates/default/manageheader.tpl | 309 ++++++++++------------- 6 files changed, 167 insertions(+), 278 deletions(-) diff --git a/header.inc.php.template b/header.inc.php.template index 1b54ae2819..67f0a9eb4a 100644 --- a/header.inc.php.template +++ b/header.inc.php.template @@ -92,7 +92,7 @@ include(EGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php'); $GLOBALS['egw_info']['server']['versions']['phpgwapi'] = $setup_info['phpgwapi']['version']; $GLOBALS['egw_info']['server']['versions']['current_header'] = $setup_info['phpgwapi']['versions']['current_header']; unset($setup_info); -$GLOBALS['egw_info']['server']['versions']['header'] = '1.28'; +$GLOBALS['egw_info']['server']['versions']['header'] = '1.29'; if(!isset($GLOBALS['egw_info']['flags']['noapi']) || !$GLOBALS['egw_info']['flags']['noapi']) { diff --git a/phpgwapi/setup/setup.inc.php b/phpgwapi/setup/setup.inc.php index 03bf810d90..861c56bf99 100755 --- a/phpgwapi/setup/setup.inc.php +++ b/phpgwapi/setup/setup.inc.php @@ -13,7 +13,7 @@ $setup_info['phpgwapi']['name'] = 'phpgwapi'; $setup_info['phpgwapi']['title'] = 'eGroupWare API'; $setup_info['phpgwapi']['version'] = '1.5.015'; -$setup_info['phpgwapi']['versions']['current_header'] = '1.28'; +$setup_info['phpgwapi']['versions']['current_header'] = '1.29'; $setup_info['phpgwapi']['enable'] = 3; $setup_info['phpgwapi']['app_order'] = 1; diff --git a/setup/inc/class.setup_detection.inc.php b/setup/inc/class.setup_detection.inc.php index c747c8242a..dd72da1bea 100755 --- a/setup/inc/class.setup_detection.inc.php +++ b/setup/inc/class.setup_detection.inc.php @@ -38,7 +38,7 @@ class setup_detection { $tname = Array(); $GLOBALS['egw_setup']->db->Halt_On_Error = 'no'; - + $GLOBALS['egw_setup']->set_table_names(); if($GLOBALS['egw_setup']->table_exist(array($GLOBALS['egw_setup']->applications_table))) @@ -342,8 +342,8 @@ class setup_detection $config_errors[] = lang("Your temporary directory '%1' %2",$config['temp_dir'],$error_msg); } - if ((!isset($config['file_repository']) || $config['file_repository'] == 'sql') && - (!isset($config['file_store_contents']) || $config['file_store_contents'] == 'filesystem') && + if ((!isset($config['file_repository']) || $config['file_repository'] == 'sql') && + (!isset($config['file_store_contents']) || $config['file_store_contents'] == 'filesystem') && !$this->check_dir($config['files_dir'],$error_msg,true)) { $config_errors[] = lang("Your files directory '%1' %2",$config['files_dir'],$error_msg); @@ -487,7 +487,7 @@ class setup_detection return True; } } - + /** * Checks if a directory exists, is writable by the webserver and optionaly is in the docroot * @@ -512,15 +512,15 @@ class setup_detection { $docroots = array(realpath(EGW_SERVER_ROOT),realpath($_SERVER['DOCUMENT_ROOT'])); $dir = realpath($dir); - + foreach ($docroots as $docroot) { $len = strlen($docroot); - + if ($docroot == substr($dir,0,$len) && $len>0) { $rest = substr($dir,$len); - + if (!strlen($rest) || $rest[0] == DIRECTORY_SEPARATOR) { $msg = lang('is in the webservers docroot'); diff --git a/setup/manageheader.php b/setup/manageheader.php index 16bc665d9a..a0b6d8eeb6 100644 --- a/setup/manageheader.php +++ b/setup/manageheader.php @@ -31,6 +31,7 @@ $setup_tpl->set_block('T_setup_manage','domain','domain'); // authentication phase $GLOBALS['egw_info']['setup']['stage']['header'] = $GLOBALS['egw_setup']->detection->check_header(); + if ($GLOBALS['egw_info']['setup']['stage']['header'] > 2 && !$GLOBALS['egw_setup']->auth('Header')) { $GLOBALS['egw_setup']->html->show_header('Please login',True); @@ -72,7 +73,6 @@ if (!file_exists('../header.inc.php') || !is_readable('../header.inc.php')) else { $GLOBALS['egw_info']['server']['server_root'] = EGW_SERVER_ROOT; - $GLOBALS['egw_info']['server']['include_root'] = EGW_INCLUDE_ROOT; } if (isset($_POST['setting'])) // Post of the header-form { @@ -159,8 +159,6 @@ function check_header_form() case 'new_admin_password': if ($value) $GLOBALS['egw_info']['server']['header_admin_password'] = md5($value); break; - case 'mcrypt_version': - $GLOBALS['egw_info']['server']['versions']['mcrypt'] = $value; default: $GLOBALS['egw_info']['server'][$name] = $value; break; @@ -187,8 +185,7 @@ function check_header_form() // validate the input and return errors $validation_errors = $GLOBALS['egw_setup']->header->validation_errors( - $GLOBALS['egw_info']['server']['server_root'], - $GLOBALS['egw_info']['server']['include_root']); + $GLOBALS['egw_info']['server']['server_root'],$GLOBALS['egw_info']['server']['server_root']); //echo "egw_info[server]=
".print_r($GLOBALS['egw_info']['server'],true)."
\n"; //echo "egw_domain=
".print_r($GLOBALS['egw_domain'],true)."
\n"; @@ -225,15 +222,6 @@ function show_header_form($validation_errors) $GLOBALS['egw_setup']->html->show_footer(); exit; } - if((float) PHP_VERSION < $GLOBALS['egw_setup']->required_php_version) - { - echo '

' . - lang('You are using PHP version %1. eGroupWare now requires %2 or later, recommended is PHP %3.', - PHP_VERSION,$GLOBALS['egw_setup']->required_php_version,$GLOBALS['egw_setup']->recommended_php_version) . - "

\n"; - $GLOBALS['egw_setup']->html->show_footer(); - exit; - } $supported_db = $GLOBALS['egw_setup']->header->check_db_support($detected); if (!count($supported_db)) @@ -253,40 +241,7 @@ function show_header_form($validation_errors) } $setup_tpl->set_var('js_default_db_ports',$js_default_db_ports); - // checking PHP session support - if ($GLOBALS['egw_setup']->header->check_load_extension('session')) - { - $detected[] = lang('You appear to have PHP session support. Enabling PHP sessions.'); - $supported_sessions_type['php4'] = 'PHP'; // makeing php sessions the default - $supported_sessions_type['php4-restore'] = lang('PHP plus restore'); // php-sessions with restore of egw_info array and egw object from the session - } - $supported_sessions_type['db'] = lang('Database'); - - if (file_exists('../header.inc.php') && is_file('../header.inc.php') && is_readable('../header.inc.php')) - { - $detected[] = lang('Found existing configuration file. Loading settings from the file...'); - - // This code makes sure the newer multi-domain supporting header.inc.php is being used - if(!isset($GLOBALS['egw_domain'])) - { - $detected[] = lang('You need to add some domains to your header.inc.php.'); - - $GLOBALS['egw_domain']['default'] = $GLOBALS['egw_setup']->header->domain_defaults( - $GLOBALS['egw_info']['server']['header_admin_user'], - $GLOBALS['egw_info']['server']['header_admin_password'],$supported_db); - } - elseif(@$GLOBALS['egw_info']['server']['header_version'] != @$GLOBALS['egw_info']['server']['current_header_version']) - { - $detected[] = lang("You're using an old header.inc.php version..."); - $detected[] = lang('Importing old settings into the new format....'); - } - } - else // no config file found => using or detecting the defaults - { - $detected[] = lang('Sample configuration not found. Using built in defaults'); - } - if ($validation_errors) $detected = $validation_errors; - $setup_tpl->set_var('detected','\n"); + if ($validation_errors) $setup_tpl->set_var('detected','\n"); if ($_POST['adddomain']) { @@ -305,18 +260,22 @@ function show_header_form($validation_errors) case 'mcrypt_enabled': $setup_tpl->set_var($name.($GLOBALS['egw_info']['server'][$name] ? '_yes' : '_no'),' selected="selected"'); break; - case 'versions': - $setup_tpl->set_var('mcrypt_version',htmlspecialchars($GLOBALS['egw_info']['server']['versions']['mcrypt'])); - break; default: - $setup_tpl->set_var($name,htmlspecialchars($value)); + if (!is_array($value)) $setup_tpl->set_var($name,htmlspecialchars($value)); break; } } - $options = array(); - foreach($supported_sessions_type as $type => $label) + $supported_session_handler = array( + 'egw_session_files' => lang('PHP session handler enabled in php.ini'), + ); + if (!isset($supported_session_handler[$GLOBALS['egw_info']['server']['sessions_handler']])) { - $options[] = ''; } $setup_tpl->set_var('session_options',implode("\n",$options)); @@ -367,15 +326,13 @@ function show_header_form($validation_errors) )); $setup_tpl->set_var(array( - 'lang_analysis' => $validation_errors ? lang('Validation errors') : lang('Analysis'), + 'lang_analysis' => $validation_errors ? lang('Validation errors') : '', 'lang_settings' => lang('Settings'), 'lang_domain' => lang('Database instance (eGW domain)'), 'lang_delete' => lang('Delete'), 'lang_adddomain' => lang('Add new database instance (eGW domain)'), 'lang_serverroot' => lang('Server Root'), 'lang_serverroot_descr'=> lang('Path (not URL!) to your eGroupWare installation.'), - 'lang_includeroot' => lang('Include Root'), - 'lang_includeroot_descr'=>lang('Should be the same as Server Root unless you know what you are doing.'), 'lang_adminuser' => lang('Header username'), 'lang_adminuser_descr' => lang('Admin user for header manager'), 'lang_adminpass' => lang('Header password'), @@ -403,14 +360,10 @@ function show_header_form($validation_errors) 'lang_passforconfig' => lang('Password needed for domain configuration.'), 'lang_persist' => lang('Persistent connections'), 'lang_persistdescr' => lang('Do you want persistent connections (higher performance, but consumes more resources)'), - 'lang_sesstype' => lang('Sessions Type'), - 'lang_sesstypedescr' => lang('What type of sessions management do you want to use (PHP session management may perform better)?'). - ' '.lang('PHP plus restore gives by far the best performance, as it stores the eGW enviroment completly in the session.'). - ' '.lang('Unfortunally some PHP/Apache packages have problems with it (Apache dies and you cant login anymore).'), + 'lang_session' => lang('Sessions Handler'), + 'lang_session_descr' => lang('Session handler class used.'), 'lang_enablemcrypt' => lang('Enable MCrypt'), 'lang_mcrypt_warning' => lang('Not all mcrypt algorithms and modes work with eGroupWare. If you experience problems try switching it off.'), - 'lang_mcryptversion' => lang('MCrypt version'), - 'lang_mcryptversiondescr' => lang('Set this to "old" for versions < 2.4, otherwise the exact mcrypt version you use.'), 'lang_mcryptiv' => lang('MCrypt initialization vector'), 'lang_mcryptivdescr' => lang('This should be around 30 bytes in length.
Note: The default has been randomly generated.'), 'lang_domselect' => lang('Domain select box on login'), diff --git a/setup/templates/default/head.tpl b/setup/templates/default/head.tpl index 594fedaf90..45c5aeca96 100644 --- a/setup/templates/default/head.tpl +++ b/setup/templates/default/head.tpl @@ -1,24 +1,6 @@ - - - eGroupWare Setup - {lang_setup} {configdomain} @@ -49,29 +31,16 @@ td { - /*font-size:12px;*/ line-height:170%; } /* some styles specially for setup */ #tbl_manage_header td { - border:solid 0px green; - vertical-align:top; - padding-bottom:10px; + vertical-align: top; + padding-bottom: 3px; + padding-left: 5px; } - .th th, - .th td - { - padding:3px; - } - .table_domains - { - border:solid 1px #cccccc; - width:100%; - margin-bottom:10px; - } - --> diff --git a/setup/templates/default/manageheader.tpl b/setup/templates/default/manageheader.tpl index 70c3051c77..57720c6c78 100644 --- a/setup/templates/default/manageheader.tpl +++ b/setup/templates/default/manageheader.tpl @@ -16,179 +16,146 @@ function setDefaultDBPort(selectBox,portField) //--> - - - {lang_select} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {comment_l} - - - - {comment_r} - - - - - - + +

{pagemsg}

{lang_analysis}
- {detected} -
{lang_settings}
- {lang_serverroot} {lang_serverroot_descr}
- -
- {lang_includeroot} {lang_includeroot_descr}
- -
{lang_adminuser}
{lang_adminuser_descr}
{lang_adminpass}
- -
{lang_adminpass_descr}
{lang_leave_empty}
{lang_setup_acl}
{lang_setup_acl_descr}
{lang_persist}
- -
{lang_persistdescr}
{lang_sesstype}
- -
{lang_sesstypedescr}
{lang_enablemcrypt}
- -
{lang_mcrypt_warning}
{lang_mcryptversion}
{lang_mcryptversiondescr}
{lang_mcryptiv}
{lang_mcryptivdescr}
{lang_domselect}
-
{lang_domselect_descr}
- {domains} -
{actions}
+ + {lang_select} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +{domains} + {comment_l} + + + + {comment_r} + + + + +
+

{pagemsg}

+

{lang_analysis}

+ {detected} +
{lang_settings}
+ {lang_serverroot} {lang_serverroot_descr}
+ +
{lang_adminuser}
{lang_adminuser_descr}
{lang_adminpass}
+ +
{lang_adminpass_descr}
{lang_leave_empty}
{lang_setup_acl}
{lang_setup_acl_descr}
{lang_persist}
+ +
{lang_persistdescr}
{lang_session}
+ +
{lang_session_descr}
{lang_enablemcrypt}
+ +
{lang_mcrypt_warning}
{lang_mcryptiv}
{lang_mcryptivdescr}
{lang_domselect}
+
{lang_domselect_descr}
{actions}
+ - - -
- - - - - - -
-
{lang_finaldescr}
- - - - - - -
-
- - - - +
+ + + + + + +
+
{lang_finaldescr}
+ + + + + + +
+
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
{lang_domain}:    {lang_delete}
{lang_dbtype}
- -
{lang_whichdb}
{lang_dbhost}
{lang_dbhostdescr}
{lang_dbport}
{lang_dbportdescr}
{lang_dbname}
{lang_dbnamedescr}
{lang_dbuser}
{lang_dbuserdescr}
{lang_dbpass}
{lang_dbpassdescr}
{lang_configuser}
{lang_configuser_descr}
{lang_configpass}
- -
{lang_passforconfig}
{lang_leave_empty}
+ + {lang_domain}: +    {lang_delete} + + + {lang_dbtype}
+ + + {lang_whichdb} + + + {lang_dbhost}
{lang_dbhostdescr} + + + {lang_dbport}
{lang_dbportdescr} + + + {lang_dbname}
{lang_dbnamedescr} + + + {lang_dbuser}
{lang_dbuserdescr} + + + {lang_dbpass}
{lang_dbpassdescr} + + + {lang_configuser}
+ {lang_configuser_descr} + + + {lang_configpass}
+ + + {lang_passforconfig}
{lang_leave_empty} + - - - - -