Add another case for manageheader when domains are not defined in header.inc.php, also some formatting updates

This commit is contained in:
Miles Lott 2003-10-22 11:28:17 +00:00
parent b6578a3c3d
commit 4b4afd3c23
5 changed files with 83 additions and 45 deletions

View File

@ -1,17 +1,17 @@
<?php <?php
/**************************************************************************\ /**************************************************************************\
* phpGroupWare - Setup * * phpGroupWare - Setup *
* http://www.phpgroupware.org * * http://www.phpgroupware.org *
* -------------------------------------------- * * -------------------------------------------- *
* This file written by Joseph Engo<jengo@phpgroupware.org> * * This file written by Joseph Engo<jengo@phpgroupware.org> *
* and Dan Kuykendall<seek3r@phpgroupware.org> * * and Dan Kuykendall<seek3r@phpgroupware.org> *
* and Mark Peters<skeeter@phpgroupware.org> * * and Mark Peters<skeeter@phpgroupware.org> *
* and Miles Lott<milosch@phpgroupware.org> * * and Miles Lott<milosch@phpgroupware.org> *
* -------------------------------------------- * * -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it * * This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the * * under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your * * Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. * * option) any later version. *
\**************************************************************************/ \**************************************************************************/
/* $Id$ */ /* $Id$ */
@ -27,7 +27,7 @@
var $html = ''; var $html = '';
var $appreg = ''; var $appreg = '';
/* table name vars */ /* table name vars */
var $tbl_apps; var $tbl_apps;
var $tbl_config; var $tbl_config;
var $tbl_hooks; var $tbl_hooks;
@ -39,7 +39,7 @@
$this->appreg = CreateObject('phpgwapi.app_registry'); $this->appreg = CreateObject('phpgwapi.app_registry');
/* The setup application needs these */ /* The setup application needs these */
$this->html = $html ? CreateObject('phpgwapi.setup_html') : ''; $this->html = $html ? CreateObject('phpgwapi.setup_html') : '';
$this->translation = $translation ? CreateObject('phpgwapi.setup_translation') : ''; $this->translation = $translation ? CreateObject('phpgwapi.setup_translation') : '';
// $this->tbl_apps = $this->get_apps_table_name(); // $this->tbl_apps = $this->get_apps_table_name();
@ -57,7 +57,7 @@
$GLOBALS['phpgw_info']['server']['db_type'] = $GLOBALS['phpgw_domain'][$GLOBALS['ConfigDomain']]['db_type']; $GLOBALS['phpgw_info']['server']['db_type'] = $GLOBALS['phpgw_domain'][$GLOBALS['ConfigDomain']]['db_type'];
$this->db = CreateObject('phpgwapi.db'); $this->db = CreateObject('phpgwapi.db');
$this->db->Host = $GLOBALS['phpgw_domain'][$GLOBALS['ConfigDomain']]['db_host']; $this->db->Host = $GLOBALS['phpgw_domain'][$GLOBALS['ConfigDomain']]['db_host'];
$this->db->Type = $GLOBALS['phpgw_domain'][$GLOBALS['ConfigDomain']]['db_type']; $this->db->Type = $GLOBALS['phpgw_domain'][$GLOBALS['ConfigDomain']]['db_type'];
$this->db->Database = $GLOBALS['phpgw_domain'][$GLOBALS['ConfigDomain']]['db_name']; $this->db->Database = $GLOBALS['phpgw_domain'][$GLOBALS['ConfigDomain']]['db_name'];
@ -352,7 +352,7 @@
if ($setup_info[$appname]['tables_use_prefix'] == True) if ($setup_info[$appname]['tables_use_prefix'] == True)
{ {
echo $setup_info[$appname]['name'] . ' uses tables_use_prefix, storing ' echo $setup_info[$appname]['name'] . ' uses tables_use_prefix, storing '
. $setup_info[$appname]['tables_prefix'] . $setup_info[$appname]['tables_prefix']
. ' as prefix for ' . $setup_info[$appname]['name'] . " tables\n"; . ' as prefix for ' . $setup_info[$appname]['name'] . " tables\n";
$sql = "INSERT INTO phpgw_config (config_app,config_name,config_value) " $sql = "INSERT INTO phpgw_config (config_app,config_name,config_value) "

View File

@ -229,20 +229,20 @@
} }
else else
{ {
if (!isset($GLOBALS['phpgw_info']['server']['header_admin_password'])) if(!@isset($GLOBALS['phpgw_info']['server']['header_admin_password']))
{ {
$GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage One (No header admin password set)'; $GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage One (No header admin password set)';
return '2'; return '2';
} }
elseif (!isset($GLOBALS['phpgw_domain'])) elseif(!@isset($GLOBALS['phpgw_domain']))
{ {
$GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage One (Upgrade your header.inc.php)'; $GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage One (Add domains to your header.inc.php)';
return '3'; return '3';
} }
elseif (@$GLOBALS['phpgw_info']['server']['versions']['header'] != @$GLOBALS['phpgw_info']['server']['versions']['current_header']) elseif(@$GLOBALS['phpgw_info']['server']['versions']['header'] != @$GLOBALS['phpgw_info']['server']['versions']['current_header'])
{ {
$GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage One (Upgrade your header.inc.php)'; $GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage One (Upgrade your header.inc.php)';
return '3'; return '4';
} }
} }
/* header.inc.php part settled. Moving to authentication */ /* header.inc.php part settled. Moving to authentication */

View File

@ -75,13 +75,14 @@
function show_header($title='',$nologoutbutton=False, $logoutfrom='config', $configdomain='') function show_header($title='',$nologoutbutton=False, $logoutfrom='config', $configdomain='')
{ {
$GLOBALS['setup_tpl']->set_var('lang_charset',lang('charset')); $GLOBALS['setup_tpl']->set_var('lang_charset',lang('charset'));
$style = array('th_bg' => '#486591', $style = array(
'th_text' => '#FFFFFF', 'th_bg' => '#486591',
'row_on' => '#DDDDDD', 'th_text' => '#FFFFFF',
'row_off' => '#EEEEEE', 'row_on' => '#DDDDDD',
'banner_bg' => '#4865F1', 'row_off' => '#EEEEEE',
'msg' => '#FF0000', 'banner_bg' => '#4865F1',
); 'msg' => '#FF0000',
);
$GLOBALS['setup_tpl']->set_var($style); $GLOBALS['setup_tpl']->set_var($style);
if ($nologoutbutton) if ($nologoutbutton)
{ {

View File

@ -374,6 +374,7 @@ you have not created your header.inc.php yet!<br> you can create it now. setup e
you have successfully logged out setup en You have successfully logged out you have successfully logged out setup en You have successfully logged out
you must enter a username for the admin setup en You must enter a username for the admin you must enter a username for the admin setup en You must enter a username for the admin
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 need to add some domains to your header.inc.php. setup en You need to add some domains to your header.inc.php.
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'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...

View File

@ -96,10 +96,22 @@
$GLOBALS['phpgw_info']['setup']['PageMSG'] = lang('Your header admin password is NOT set. Please set it now!'); $GLOBALS['phpgw_info']['setup']['PageMSG'] = lang('Your header admin password is NOT set. Please set it now!');
break; break;
case '3': case '3':
$GLOBALS['phpgw_info']['setup']['HeaderFormMSG'] = lang('You need to add some domains to your header.inc.php.');
$GLOBALS['phpgw_info']['setup']['PageMSG'] = lang('You need to add some domains to your header.inc.php.');
$GLOBALS['phpgw_info']['setup']['HeaderLoginMSG'] = lang('You need to add some domains to your header.inc.php.');
if(!$GLOBALS['phpgw_setup']->auth('Header'))
{
$GLOBALS['phpgw_setup']->html->show_header('Please login',True);
$GLOBALS['phpgw_setup']->html->login_form();
$GLOBALS['phpgw_setup']->html->show_footer();
exit;
}
break;
case '4':
$GLOBALS['phpgw_info']['setup']['HeaderFormMSG'] = lang('Your header.inc.php needs upgrading.'); $GLOBALS['phpgw_info']['setup']['HeaderFormMSG'] = lang('Your header.inc.php needs upgrading.');
$GLOBALS['phpgw_info']['setup']['PageMSG'] = lang('Your header.inc.php needs upgrading.<br><blink><b class="msg">WARNING!</b></blink><br><b>MAKE BACKUPS!</b>'); $GLOBALS['phpgw_info']['setup']['PageMSG'] = lang('Your header.inc.php needs upgrading.<br><blink><b class="msg">WARNING!</b></blink><br><b>MAKE BACKUPS!</b>');
$GLOBALS['phpgw_info']['setup']['HeaderLoginMSG'] = lang('Your header.inc.php needs upgrading.'); $GLOBALS['phpgw_info']['setup']['HeaderLoginMSG'] = lang('Your header.inc.php needs upgrading.');
if (!$GLOBALS['phpgw_setup']->auth('Header')) if(!$GLOBALS['phpgw_setup']->auth('Header'))
{ {
$GLOBALS['phpgw_setup']->html->show_header('Please login',True); $GLOBALS['phpgw_setup']->html->show_header('Please login',True);
$GLOBALS['phpgw_setup']->html->login_form(); $GLOBALS['phpgw_setup']->html->login_form();
@ -108,7 +120,7 @@
} }
break; break;
case '10': case '10':
if (!$GLOBALS['phpgw_setup']->auth('Header')) if(!$GLOBALS['phpgw_setup']->auth('Header'))
{ {
$GLOBALS['phpgw_setup']->html->show_header('Please login',True); $GLOBALS['phpgw_setup']->html->show_header('Please login',True);
$GLOBALS['phpgw_setup']->html->login_form(); $GLOBALS['phpgw_setup']->html->login_form();
@ -187,7 +199,7 @@
$detected = ''; $detected = '';
if (!get_var('ConfigLang',array('POST','COOKIE'))) if(!get_var('ConfigLang',array('POST','COOKIE')))
{ {
$detected .= '<br><form action="manageheader.php" method="Post">Please Select your language '.lang_select(True,'en')."</form>\n"; $detected .= '<br><form action="manageheader.php" method="Post">Please Select your language '.lang_select(True,'en')."</form>\n";
} }
@ -201,7 +213,7 @@
$detected .= '<tr class="th"><td colspan="2">' . lang('Analysis') . '</td></tr><tr><td colspan="2">'. "\n"; $detected .= '<tr class="th"><td colspan="2">' . lang('Analysis') . '</td></tr><tr><td colspan="2">'. "\n";
$supported_db = array(); $supported_db = array();
if (extension_loaded('mysql') || function_exists('mysql_connect')) if(extension_loaded('mysql') || function_exists('mysql_connect'))
{ {
$detected .= lang('You appear to have MySQL support enabled') . '<br>' . "\n"; $detected .= lang('You appear to have MySQL support enabled') . '<br>' . "\n";
$supported_db[] = 'mysql'; $supported_db[] = 'mysql';
@ -210,7 +222,7 @@
{ {
$detected .= lang('No MySQL support found. Disabling') . '<br>' . "\n"; $detected .= lang('No MySQL support found. Disabling') . '<br>' . "\n";
} }
if (extension_loaded('pgsql') || function_exists('pg_connect')) if(extension_loaded('pgsql') || function_exists('pg_connect'))
{ {
$detected .= lang('You appear to have Postgres-DB support enabled') . '<br>' . "\n"; $detected .= lang('You appear to have Postgres-DB support enabled') . '<br>' . "\n";
$supported_db[] = 'pgsql'; $supported_db[] = 'pgsql';
@ -219,7 +231,7 @@
{ {
$detected .= lang('No Postgres-DB support found. Disabling') . '<br>' . "\n"; $detected .= lang('No Postgres-DB support found. Disabling') . '<br>' . "\n";
} }
if (extension_loaded('mssql') || function_exists('mssql_connect')) if(extension_loaded('mssql') || function_exists('mssql_connect'))
{ {
$detected .= lang('You appear to have Microsoft SQL Server support enabled') . '<br>' . "\n"; $detected .= lang('You appear to have Microsoft SQL Server support enabled') . '<br>' . "\n";
$supported_db[] = 'mssql'; $supported_db[] = 'mssql';
@ -228,7 +240,7 @@
{ {
$detected .= lang('No Microsoft SQL Server support found. Disabling') . '<br>' . "\n"; $detected .= lang('No Microsoft SQL Server support found. Disabling') . '<br>' . "\n";
} }
if (extension_loaded('oci8')) if(extension_loaded('oci8'))
{ {
$detected .= lang('You appear to have Oracle V8 (OCI) support enabled') . '<br>' . "\n"; $detected .= lang('You appear to have Oracle V8 (OCI) support enabled') . '<br>' . "\n";
$supported_db[] = 'oracle'; $supported_db[] = 'oracle';
@ -256,7 +268,7 @@
exit; exit;
} }
if (!function_exists('version_compare')) if(!function_exists('version_compare'))
{ {
$detected .= '<b><p align="center" class="msg">' $detected .= '<b><p align="center" class="msg">'
. lang('You appear to be using PHP earlier than 4.1.0. phpGroupWare now requires 4.1.0 or later'). "\n" . lang('You appear to be using PHP earlier than 4.1.0. phpGroupWare now requires 4.1.0 or later'). "\n"
@ -272,7 +284,7 @@
} }
/* /*
if (extension_loaded('xml') || function_exists('xml_parser_create')) if(extension_loaded('xml') || function_exists('xml_parser_create'))
{ {
$detected .= lang('You appear to have XML support enabled') . '<br>' . "\n"; $detected .= lang('You appear to have XML support enabled') . '<br>' . "\n";
$xml_enabled = 'True'; $xml_enabled = 'True';
@ -292,8 +304,32 @@
/* This code makes sure the newer multi-domain supporting header.inc.php is being used */ /* This code makes sure the newer multi-domain supporting header.inc.php is being used */
if(!isset($GLOBALS['phpgw_domain'])) if(!isset($GLOBALS['phpgw_domain']))
{ {
$detected .= lang("You're using an old configuration file format...") . '<br>' . "\n"; $detected .= lang('You need to add some domains to your header.inc.php.') . '<br>' . "\n";
$detected .= lang('Importing old settings into the new format....') . '<br>' . "\n"; $GLOBALS['phpgw_domain']['default'] = array();
$setup_tpl->set_var('lang_domain',lang('Domain'));
$setup_tpl->set_var('lang_delete',lang('Delete'));
$setup_tpl->set_var('db_domain','default');
$setup_tpl->set_var('db_host','localhost');
$setup_tpl->set_var('db_name','egroupware');
$setup_tpl->set_var('db_user','egroupware');
$setup_tpl->set_var('db_pass','your_password');
$setup_tpl->set_var('db_type','mysql');
$setup_tpl->set_var('config_pass','changeme');
while(list($k,$v) = @each($supported_db))
{
if($v == $GLOBALS['phpgw_domain'][$key]['db_type'])
{
$selected = ' selected ';
$found_dbtype = true;
}
else
{
$selected = '';
}
$dbtype_options .= '<option ' . $selected . 'value="' . $v . '">' . $v . "\n";
}
$setup_tpl->set_var('dbtype_options',$dbtype_options);
$setup_tpl->parse('domains','domain',True);
} }
else else
{ {
@ -349,10 +385,12 @@
} }
$setup_tpl->set_var('domain',''); $setup_tpl->set_var('domain','');
} }
if (defined('PHPGW_SERVER_ROOT')) if(defined('PHPGW_SERVER_ROOT'))
{ {
$GLOBALS['phpgw_info']['server']['server_root'] = PHPGW_SERVER_ROOT; $GLOBALS['phpgw_info']['server']['server_root'] = PHPGW_SERVER_ROOT == '..'
$GLOBALS['phpgw_info']['server']['include_root'] = PHPGW_INCLUDE_ROOT; ? '/path/to/egroupware' : PHPGW_SERVER_ROOT;
$GLOBALS['phpgw_info']['server']['include_root'] = PHPGW_INCLUDE_ROOT == '..'
? '/path/to/egroupware' : PHPGW_INCLUDE_ROOT;
} }
elseif(!@isset($GLOBALS['phpgw_info']['server']['include_root']) && @$GLOBALS['phpgw_info']['server']['header_version'] <= 1.6) elseif(!@isset($GLOBALS['phpgw_info']['server']['include_root']) && @$GLOBALS['phpgw_info']['server']['header_version'] <= 1.6)
{ {
@ -542,7 +580,6 @@
$setup_tpl->set_var('lang_finaldescr',lang('After retrieving the file, put it into place as the header.inc.php. Then, click "continue".')); $setup_tpl->set_var('lang_finaldescr',lang('After retrieving the file, put it into place as the header.inc.php. Then, click "continue".'));
$setup_tpl->set_var('lang_continue',lang('Continue')); $setup_tpl->set_var('lang_continue',lang('Continue'));
$setup_tpl->pfp('out','manageheader'); $setup_tpl->pfp('out','manageheader');
$GLOBALS['phpgw_setup']->html->show_footer(); $GLOBALS['phpgw_setup']->html->show_footer();
@ -550,4 +587,3 @@
break; // ending the switch default break; // ending the switch default
} }
?> ?>