1) fixed setup-detection, to allow login into setup again

2) $GLOBALS['phpgw{_info}'] ==> $GLOBALS['egw{_info}']
3) moved setup-classes from phpgwapi/inc back to setup/inc (they are not used anywhere else, but in setup)
This commit is contained in:
Ralf Becker 2005-03-04 12:40:28 +00:00
parent 5ea9e21428
commit b6883d59e8
21 changed files with 637 additions and 646 deletions

View File

@ -19,26 +19,26 @@
this will happen without further warning.
*/
$phpgw_info = array();
$GLOBALS['phpgw_info']['flags'] = array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
);
$GLOBALS['egw_info'] = array(
'flags' => array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
));
include ('./inc/functions.inc.php');
@set_time_limit(0);
// Check header and authentication
if (!$GLOBALS['phpgw_setup']->auth('Config'))
if (!$GLOBALS['egw_setup']->auth('Config'))
{
Header('Location: index.php');
exit;
}
// Does not return unless user is authorized
$tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
$tpl_root = $GLOBALS['egw_setup']->html->setup_tpl_dir('setup');
$setup_tpl = CreateObject('setup.Template',$tpl_root);
$setup_tpl->set_file(array(
'T_head' => 'head.tpl',
@ -94,16 +94,16 @@
}
}
$GLOBALS['phpgw_setup']->loaddb();
$GLOBALS['phpgw_info']['setup']['stage']['db'] = $GLOBALS['phpgw_setup']->detection->check_db();
$GLOBALS['egw_setup']->loaddb();
$GLOBALS['egw_info']['setup']['stage']['db'] = $GLOBALS['egw_setup']->detection->check_db();
$setup_info = $GLOBALS['phpgw_setup']->detection->get_versions();
$setup_info = $GLOBALS['egw_setup']->detection->get_versions();
//var_dump($setup_info);exit;
$setup_info = $GLOBALS['phpgw_setup']->detection->get_db_versions($setup_info);
$setup_info = $GLOBALS['egw_setup']->detection->get_db_versions($setup_info);
//var_dump($setup_info);exit;
$setup_info = $GLOBALS['phpgw_setup']->detection->compare_versions($setup_info);
$setup_info = $GLOBALS['egw_setup']->detection->compare_versions($setup_info);
//var_dump($setup_info);exit;
$setup_info = $GLOBALS['phpgw_setup']->detection->check_depends($setup_info);
$setup_info = $GLOBALS['egw_setup']->detection->check_depends($setup_info);
//var_dump($setup_info);exit;
@ksort($setup_info);
@ -115,7 +115,7 @@
if(@get_var('submit',Array('POST')))
{
$GLOBALS['phpgw_setup']->html->show_header(lang('Application Management'),False,'config',$GLOBALS['phpgw_setup']->ConfigDomain . '(' . $phpgw_domain[$GLOBALS['phpgw_setup']->ConfigDomain]['db_type'] . ')');
$GLOBALS['egw_setup']->html->show_header(lang('Application Management'),False,'config',$GLOBALS['egw_setup']->ConfigDomain . '(' . $GLOBALS['egw_domain'][$GLOBALS['egw_setup']->ConfigDomain]['db_type'] . ')');
$setup_tpl->set_var('description',lang('App install/remove/upgrade') . ':');
$setup_tpl->pparse('out','header');
@ -129,7 +129,7 @@
if(!empty($remove) && is_array($remove))
{
$historylog = CreateObject('phpgwapi.historylog');
$historylog->db = $GLOBALS['phpgw_setup']->db;
$historylog->db = $GLOBALS['egw_setup']->db;
foreach($remove as $appname => $key)
{
@ -139,16 +139,16 @@
if ($setup_info[$appname]['tables'])
{
$GLOBALS['phpgw_setup']->process->droptables($terror,$DEBUG);
$GLOBALS['egw_setup']->process->droptables($terror,$DEBUG);
echo '<br>' . $app_title . ' ' . lang('tables dropped') . '.';
}
$GLOBALS['phpgw_setup']->deregister_app($setup_info[$appname]['name']);
$GLOBALS['egw_setup']->deregister_app($setup_info[$appname]['name']);
echo '<br>' . $app_title . ' ' . lang('deregistered') . '.';
if ($setup_info[$appname]['hooks'])
{
$GLOBALS['phpgw_setup']->deregister_hooks($setup_info[$appname]['name']);
$GLOBALS['egw_setup']->deregister_hooks($setup_info[$appname]['name']);
echo '<br>' . $app_title . ' ' . lang('hooks deregistered') . '.';
}
$do_langs = true;
@ -159,8 +159,8 @@
}
// delete all application categories and ACL
$GLOBALS['phpgw_setup']->db->query("DELETE FROM phpgw_categories WHERE cat_appname='$appname'",__LINE__,__FILE__);
$GLOBALS['phpgw_setup']->db->query("DELETE FROM phpgw_acl WHERE acl_appname='$appname'",__LINE__,__FILE__);
$GLOBALS['egw_setup']->db->query("DELETE FROM phpgw_categories WHERE cat_appname='$appname'",__LINE__,__FILE__);
$GLOBALS['egw_setup']->db->query("DELETE FROM phpgw_acl WHERE acl_appname='$appname'",__LINE__,__FILE__);
}
}
@ -174,26 +174,26 @@
if ($setup_info[$appname]['tables'])
{
$terror = $GLOBALS['phpgw_setup']->process->current($terror,$DEBUG);
$terror = $GLOBALS['phpgw_setup']->process->default_records($terror,$DEBUG);
$terror = $GLOBALS['egw_setup']->process->current($terror,$DEBUG);
$terror = $GLOBALS['egw_setup']->process->default_records($terror,$DEBUG);
echo '<br>' . $app_title . ' '
. lang('tables installed, unless there are errors printed above') . '.';
}
else
{
if ($GLOBALS['phpgw_setup']->app_registered($setup_info[$appname]['name']))
if ($GLOBALS['egw_setup']->app_registered($setup_info[$appname]['name']))
{
$GLOBALS['phpgw_setup']->update_app($setup_info[$appname]['name']);
$GLOBALS['egw_setup']->update_app($setup_info[$appname]['name']);
}
else
{
$GLOBALS['phpgw_setup']->register_app($setup_info[$appname]['name']);
$GLOBALS['egw_setup']->register_app($setup_info[$appname]['name']);
}
echo '<br>' . $app_title . ' ' . lang('registered') . '.';
if ($setup_info[$appname]['hooks'])
{
$GLOBALS['phpgw_setup']->register_hooks($setup_info[$appname]['name']);
$GLOBALS['egw_setup']->register_hooks($setup_info[$appname]['name']);
echo '<br>' . $app_title . ' ' . lang('hooks registered') . '.';
}
}
@ -209,7 +209,7 @@
$terror = array();
$terror[] = $setup_info[$appname];
$GLOBALS['phpgw_setup']->process->upgrade($terror,$DEBUG);
$GLOBALS['egw_setup']->process->upgrade($terror,$DEBUG);
if ($setup_info[$appname]['tables'])
{
echo '<br>' . $app_title . ' ' . lang('tables upgraded') . '.';
@ -224,7 +224,7 @@
}
if ($do_langs)
{
$GLOBALS['phpgw_setup']->process->translation->drop_add_all_langs();
$GLOBALS['egw_setup']->process->translation->drop_add_all_langs();
}
//$setup_tpl->set_var('goback',
echo '<br><a href="applications.php?debug='.$DEBUG.'">' . lang('Go back') . '</a>';
@ -234,7 +234,7 @@
}
else
{
$GLOBALS['phpgw_setup']->html->show_header(lang('Application Management'),False,'config',$GLOBALS['phpgw_setup']->ConfigDomain . '(' . $phpgw_domain[$GLOBALS['phpgw_setup']->ConfigDomain]['db_type'] . ')');
$GLOBALS['egw_setup']->html->show_header(lang('Application Management'),False,'config',$GLOBALS['egw_setup']->ConfigDomain . '(' . $GLOBALS['egw_domain'][$GLOBALS['egw_setup']->ConfigDomain]['db_type'] . ')');
}
$detail = get_var('detail',Array('GET'));
@ -411,7 +411,7 @@
case 'C':
$setup_tpl->set_var('remove','<input type="checkbox" name="remove[' . $value['name'] . ']">');
$setup_tpl->set_var('upgrade','&nbsp;');
if (!$GLOBALS['phpgw_setup']->detection->check_app_tables($value['name']))
if (!$GLOBALS['egw_setup']->detection->check_app_tables($value['name']))
{
// App installed and enabled, but some tables are missing
$setup_tpl->set_var('instimg','table.png');
@ -449,7 +449,7 @@
$setup_tpl->set_var('instalt',lang('Not Completed'));
if (!@$value['currentver'])
{
if ($value['tables'] && $GLOBALS['phpgw_setup']->detection->check_app_tables($value['name'],True))
if ($value['tables'] && $GLOBALS['egw_setup']->detection->check_app_tables($value['name'],True))
{
// Some tables missing
$setup_tpl->set_var('remove','<input type="checkbox" name="remove[' . $value['name'] . ']">');
@ -533,6 +533,6 @@
$setup_tpl->set_var('cancel',lang('Cancel'));
$setup_tpl->pparse('out','app_footer');
$setup_tpl->pparse('out','footer');
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_footer();
}
?>

View File

@ -17,22 +17,22 @@
if ($run_by_webserver)
{
$phpgw_info = array();
$GLOBALS['phpgw_info']['flags'] = array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
);
$GLOBALS['egw_info'] = array(
'flags' => array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
));
$safe_er = error_reporting();
include ('./inc/functions.inc.php');
error_reporting($safe_er);
$GLOBALS['phpgw_info']['setup']['stage']['header'] = $GLOBALS['phpgw_setup']->detection->check_header();
if ($GLOBALS['phpgw_info']['setup']['stage']['header'] == '10')
$GLOBALS['egw_info']['setup']['stage']['header'] = $GLOBALS['egw_setup']->detection->check_header();
if ($GLOBALS['egw_info']['setup']['stage']['header'] == '10')
{
// Check header and authentication
if (!$GLOBALS['phpgw_setup']->auth('Config') && !$GLOBALS['phpgw_setup']->auth('Header'))
if (!$GLOBALS['egw_setup']->auth('Config') && !$GLOBALS['egw_setup']->auth('Header'))
{
Header('Location: index.php');
exit;
@ -143,7 +143,7 @@
'header.inc.php' => array(
'func' => 'permission_check',
'is_world_readable' => False,
'only_if_exists' => @$GLOBALS['phpgw_info']['setup']['stage']['header'] != 10
'only_if_exists' => @$GLOBALS['egw_info']['setup']['stage']['header'] != 10
),
'phpgwapi/images' => array(
'func' => 'permission_check',
@ -443,7 +443,7 @@
if ($run_by_webserver)
{
$tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
$tpl_root = $GLOBALS['egw_setup']->html->setup_tpl_dir('setup');
$setup_tpl = CreateObject('setup.Template',$tpl_root);
$setup_tpl->set_file(array(
'T_head' => 'head.tpl',
@ -453,9 +453,9 @@
if (@$_GET['intro']) {
if($ConfigLang = get_var('ConfigLang',array('POST','COOKIE')))
{
$GLOBALS['phpgw_setup']->set_cookie('ConfigLang',$ConfigLang,(int) (time()+(1200*9)),'/');
$GLOBALS['egw_setup']->set_cookie('ConfigLang',$ConfigLang,(int) (time()+(1200*9)),'/');
}
$GLOBALS['phpgw_setup']->html->show_header(lang('Welcome to the eGroupWare Installation'),False,'config');
$GLOBALS['egw_setup']->html->show_header(lang('Welcome to the eGroupWare Installation'),False,'config');
echo '<h1>'.lang('Welcome to the eGroupWare Installation')."</h1>\n";
if(!$ConfigLang)
{
@ -467,7 +467,7 @@
$setup_tpl->pparse('out','T_footer');
exit;
} else {
$GLOBALS['phpgw_setup']->html->show_header(lang('Checking the eGroupWare Installation'),False,'config',$ConfigDomain ? $ConfigDomain . '(' . @$phpgw_domain[$ConfigDomain]['db_type'] . ')' : '');
$GLOBALS['egw_setup']->html->show_header(lang('Checking the eGroupWare Installation'),False,'config',$ConfigDomain ? $ConfigDomain . '(' . @$GLOBALS['egw_domain'][$ConfigDomain]['db_type'] . ')' : '');
echo '<h1>'.lang('Checking the eGroupWare Installation')."</h1>\n";
# echo "<pre style=\"text-align: left;\">\n";;
}
@ -489,7 +489,7 @@
{
# echo "</pre>\n";;
if ($GLOBALS['phpgw_info']['setup']['stage']['header'] != 10)
if ($GLOBALS['egw_info']['setup']['stage']['header'] != 10)
{
if (!$Ok)
{

View File

@ -11,26 +11,26 @@
/* $Id$ */
$phpgw_info = array();
$GLOBALS['phpgw_info']['flags'] = array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
);
$GLOBALS['egw_info'] = array(
'flags' => array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
));
include('./inc/functions.inc.php');
/*
Authorize the user to use setup app and load the database
Does not return unless user is authorized
*/
if(!$GLOBALS['phpgw_setup']->auth('Config') || @$_POST['cancel'])
if(!$GLOBALS['egw_setup']->auth('Config') || @$_POST['cancel'])
{
Header('Location: index.php');
exit;
}
$tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
$tpl_root = $GLOBALS['egw_setup']->html->setup_tpl_dir('setup');
$setup_tpl = CreateObject('setup.Template',$tpl_root);
$setup_tpl->set_file(array(
@ -44,12 +44,12 @@
/* Following to ensure windows file paths are saved correctly */
set_magic_quotes_runtime(0);
$GLOBALS['phpgw_setup']->loaddb();
$GLOBALS['egw_setup']->loaddb();
/* Check api version, use correct table */
$setup_info = $GLOBALS['phpgw_setup']->detection->get_db_versions();
$setup_info = $GLOBALS['egw_setup']->detection->get_db_versions();
if($GLOBALS['phpgw_setup']->alessthanb($setup_info['phpgwapi']['currentver'], '0.9.10pre7'))
if($GLOBALS['egw_setup']->alessthanb($setup_info['phpgwapi']['currentver'], '0.9.10pre7'))
{
$configtbl = 'config';
}
@ -63,7 +63,7 @@
if(@get_var('submit',Array('POST')) && @$newsettings)
{
/* Load hook file with functions to validate each config (one/none/all) */
$GLOBALS['phpgw_setup']->hook('config_validate','setup');
$GLOBALS['egw_setup']->hook('config_validate','setup');
$datetime = CreateObject('phpgwapi.datetime');
switch((int)$newsettings['daytime_port'])
@ -82,14 +82,14 @@
print_debug('TZ_OFFSET',$newsettings['tz_offset']);
$GLOBALS['phpgw_setup']->db->transaction_begin();
$GLOBALS['egw_setup']->db->transaction_begin();
/* This is only temp: */
$GLOBALS['phpgw_setup']->db->query("DELETE FROM $configtbl WHERE config_name='useframes'");
$GLOBALS['phpgw_setup']->db->query("INSERT INTO $configtbl (config_app,config_name, config_value) values ('phpgwapi','useframes','never')");
$GLOBALS['egw_setup']->db->query("DELETE FROM $configtbl WHERE config_name='useframes'");
$GLOBALS['egw_setup']->db->query("INSERT INTO $configtbl (config_app,config_name, config_value) values ('phpgwapi','useframes','never')");
while(list($setting,$value) = @each($newsettings))
{
if($GLOBALS['phpgw_info']['server']['found_validation_hook'] && @function_exists($setting))
if($GLOBALS['egw_info']['server']['found_validation_hook'] && @function_exists($setting))
{
call_user_func($setting,$newsettings);
if($GLOBALS['config_error'])
@ -105,12 +105,12 @@
/* Don't erase passwords, since we also do not print them below */
if($value || (!stristr($setting,'passwd') && !stristr($setting,'password') && !stristr($setting,'root_pw')))
{
@$GLOBALS['phpgw_setup']->db->query("DELETE FROM $configtbl WHERE config_name='" . $setting . "'");
@$GLOBALS['egw_setup']->db->query("DELETE FROM $configtbl WHERE config_name='" . $setting . "'");
}
if($value)
{
$GLOBALS['phpgw_setup']->db->query("INSERT INTO $configtbl (config_app,config_name, config_value) VALUES ('phpgwapi','" . $GLOBALS['phpgw_setup']->db->db_addslashes($setting)
. "','" . $GLOBALS['phpgw_setup']->db->db_addslashes($value) . "')");
$GLOBALS['egw_setup']->db->query("INSERT INTO $configtbl (config_app,config_name, config_value) VALUES ('phpgwapi','" . $GLOBALS['egw_setup']->db->db_addslashes($setting)
. "','" . $GLOBALS['egw_setup']->db->db_addslashes($value) . "')");
}
}
}
@ -118,31 +118,31 @@
{
if($value || (!stristr($setting,'passwd') && !stristr($setting,'password') && !stristr($setting,'root_pw')))
{
@$GLOBALS['phpgw_setup']->db->query("DELETE FROM $configtbl WHERE config_name='" . $setting . "'");
@$GLOBALS['egw_setup']->db->query("DELETE FROM $configtbl WHERE config_name='" . $setting . "'");
}
if($value)
{
$GLOBALS['phpgw_setup']->db->query("INSERT INTO $configtbl (config_app,config_name, config_value) VALUES ('phpgwapi','" . $GLOBALS['phpgw_setup']->db->db_addslashes($setting)
. "','" . $GLOBALS['phpgw_setup']->db->db_addslashes($value) . "')");
$GLOBALS['egw_setup']->db->query("INSERT INTO $configtbl (config_app,config_name, config_value) VALUES ('phpgwapi','" . $GLOBALS['egw_setup']->db->db_addslashes($setting)
. "','" . $GLOBALS['egw_setup']->db->db_addslashes($value) . "')");
}
}
}
if(!$GLOBALS['error'])
{
$GLOBALS['phpgw_setup']->db->transaction_commit();
$GLOBALS['egw_setup']->db->transaction_commit();
/* Add cleaning of app_sessions per skeeter, but with a check for the table being there, just in case */
$tablenames = $GLOBALS['phpgw_setup']->db->table_names();
$tablenames = $GLOBALS['egw_setup']->db->table_names();
while(list($key,$val) = @each($tablenames))
{
$tables[] = $val['table_name'];
}
if(in_array('phpgw_app_sessions',$tables))
{
$GLOBALS['phpgw_setup']->db->lock(array('phpgw_app_sessions'));
@$GLOBALS['phpgw_setup']->db->query("DELETE FROM phpgw_app_sessions WHERE sessionid = '0' and loginid = '0' and app = 'phpgwapi' and location = 'config'",__LINE__,__FILE__);
@$GLOBALS['phpgw_setup']->db->query("DELETE FROM phpgw_app_sessions WHERE app = 'phpgwapi' and location = 'phpgw_info_cache'",__LINE__,__FILE__);
$GLOBALS['phpgw_setup']->db->unlock();
$GLOBALS['egw_setup']->db->lock(array('phpgw_app_sessions'));
@$GLOBALS['egw_setup']->db->query("DELETE FROM phpgw_app_sessions WHERE sessionid = '0' and loginid = '0' and app = 'phpgwapi' and location = 'config'",__LINE__,__FILE__);
@$GLOBALS['egw_setup']->db->query("DELETE FROM phpgw_app_sessions WHERE app = 'phpgwapi' and location = 'phpgw_info_cache'",__LINE__,__FILE__);
$GLOBALS['egw_setup']->db->unlock();
}
if($newsettings['auth_type'] == 'ldap')
@ -158,12 +158,12 @@
}
}
$GLOBALS['phpgw_setup']->html->show_header(lang('Configuration'),False,'config',$GLOBALS['phpgw_setup']->ConfigDomain . '(' . $phpgw_domain[$GLOBALS['phpgw_setup']->ConfigDomain]['db_type'] . ')');
$GLOBALS['egw_setup']->html->show_header(lang('Configuration'),False,'config',$GLOBALS['egw_setup']->ConfigDomain . '(' . $GLOBALS['egw_domain'][$GLOBALS['egw_setup']->ConfigDomain]['db_type'] . ')');
@$GLOBALS['phpgw_setup']->db->query("SELECT * FROM $configtbl");
while(@$GLOBALS['phpgw_setup']->db->next_record())
@$GLOBALS['egw_setup']->db->query("SELECT * FROM $configtbl");
while(@$GLOBALS['egw_setup']->db->next_record())
{
$GLOBALS['current_config'][$GLOBALS['phpgw_setup']->db->f('config_name')] = $GLOBALS['phpgw_setup']->db->f('config_value');
$GLOBALS['current_config'][$GLOBALS['egw_setup']->db->f('config_name')] = $GLOBALS['egw_setup']->db->f('config_value');
}
$setup_tpl->pparse('out','T_config_pre_script');
@ -176,18 +176,18 @@
var $applications;
var $db;
}
$GLOBALS['phpgw'] = new phpgw;
$GLOBALS['phpgw']->common = CreateObject('phpgwapi.common');
$GLOBALS['phpgw']->db = $GLOBALS['phpgw_setup']->db;
$GLOBALS['egw'] = new phpgw;
$GLOBALS['egw']->common = CreateObject('phpgwapi.common');
$GLOBALS['egw']->db = $GLOBALS['egw_setup']->db;
$t = CreateObject('setup.Template',$GLOBALS['phpgw']->common->get_tpl_dir('setup'));
$t = CreateObject('setup.Template',$GLOBALS['egw']->common->get_tpl_dir('setup'));
$t->set_unknowns('keep');
$t->set_file(array('config' => 'config.tpl'));
$t->set_block('config','body','body');
$vars = $t->get_undefined('body');
$GLOBALS['phpgw_setup']->hook('config','setup');
$GLOBALS['egw_setup']->hook('config','setup');
while(list($null,$value) = each($vars))
{
@ -253,12 +253,12 @@
if($GLOBALS['error'] == 'badldapconnection')
{
/* Please check the number and dial again :) */
$GLOBALS['phpgw_setup']->html->show_alert_msg('Error',
$GLOBALS['egw_setup']->html->show_alert_msg('Error',
lang('There was a problem trying to connect to your LDAP server. <br>'
.'please check your LDAP server configuration') . '.');
}
$GLOBALS['phpgw_setup']->html->show_alert_msg('Error',$GLOBALS['error']);
$GLOBALS['egw_setup']->html->show_alert_msg('Error',$GLOBALS['error']);
}
$t->pfp('out','body');
@ -270,5 +270,5 @@
$setup_tpl->set_var('lang_cancel',lang('Cancel'));
$setup_tpl->pparse('out','T_config_post_script');
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_footer();
?>

View File

@ -12,29 +12,30 @@
/* $Id$ */
if (!is_object(@$GLOBALS['phpgw'])) // called from outside eGW ==> setup
if (!is_object(@$GLOBALS['egw'])) // called from outside eGW ==> setup
{
$GLOBALS['phpgw_info'] = array('flags' => array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
$GLOBALS['egw_info'] = array(
'flags' => array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
));
include ('./inc/functions.inc.php');
@set_time_limit(0);
// Check header and authentication
if (!$GLOBALS['phpgw_setup']->auth('Config'))
if (!$GLOBALS['egw_setup']->auth('Config'))
{
Header('Location: index.php');
exit;
}
// Does not return unless user is authorized
$GLOBALS['phpgw_setup']->loaddb();
$GLOBALS['egw_setup']->loaddb();
$tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
$tpl_root = $GLOBALS['egw_setup']->html->setup_tpl_dir('setup');
$self = 'db_backup.php';
}
$db_backup = CreateObject('phpgwapi.db_backup');
@ -67,16 +68,16 @@
$bgcolor = array('#DDDDDD','#EEEEEE');
if (is_object($GLOBALS['phpgw_setup']->html))
if (is_object($GLOBALS['egw_setup']->html))
{
$GLOBALS['phpgw_setup']->html->show_header($stage_title,False,'config',$GLOBALS['phpgw_setup']->ConfigDomain . '(' . $phpgw_domain[$GLOBALS['phpgw_setup']->ConfigDomain]['db_type'] . ')');
$GLOBALS['egw_setup']->html->show_header($stage_title,False,'config',$GLOBALS['egw_setup']->ConfigDomain . '(' . $GLOBALS['egw_domain'][$GLOBALS['egw_setup']->ConfigDomain]['db_type'] . ')');
}
else
{
$setup_tpl->set_block('T_db_backup','setup_header');
$setup_tpl->set_var('setup_header','');
$GLOBALS['phpgw_info']['flags']['app_header'] = $stage_title;
$GLOBALS['phpgw']->common->phpgw_header();
$GLOBALS['egw_info']['flags']['app_header'] = $stage_title;
$GLOBALS['egw']->common->phpgw_header();
parse_navbar();
}
// create a backup now
@ -231,8 +232,8 @@
$setup_tpl->set_var('self',$self);
$setup_tpl->pparse('out','T_db_backup');
if (is_object($GLOBALS['phpgw_setup']->html))
if (is_object($GLOBALS['egw_setup']->html))
{
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_footer();
}
?>

View File

@ -36,13 +36,13 @@
function setup($html=False, $translation=False)
{
$this->detection = CreateObject('phpgwapi.setup_detection');
$this->process = CreateObject('phpgwapi.setup_process');
$this->appreg = CreateObject('phpgwapi.app_registry');
$this->detection = CreateObject('setup.setup_detection');
$this->process = CreateObject('setup.setup_process');
$this->appreg = CreateObject('setup.app_registry');
/* The setup application needs these */
$this->html = $html ? CreateObject('phpgwapi.setup_html') : '';
$this->translation = $translation ? CreateObject('phpgwapi.setup_translation') : '';
$this->html = $html ? CreateObject('setup.setup_html') : '';
$this->translation = $translation ? CreateObject('setup.setup_translation') : '';
// $this->tbl_apps = $this->get_apps_table_name();
// $this->tbl_config = $this->get_config_table_name();
@ -60,19 +60,19 @@
$this->ConfigDomain = get_var('ConfigDomain',array('COOKIE','POST'),$_POST['FormDomain']);
}
$GLOBALS['phpgw_info']['server']['db_type'] = $GLOBALS['phpgw_domain'][$this->ConfigDomain]['db_type'];
$GLOBALS['egw_info']['server']['db_type'] = $GLOBALS['egw_domain'][$this->ConfigDomain]['db_type'];
if ($GLOBALS['phpgw_info']['server']['db_type'] == 'pgsql')
if ($GLOBALS['egw_info']['server']['db_type'] == 'pgsql')
{
$GLOBALS['phpgw_info']['server']['db_persistent'] = False;
$GLOBALS['egw_info']['server']['db_persistent'] = False;
}
$this->db = CreateObject('phpgwapi.db');
$this->db->Host = $GLOBALS['phpgw_domain'][$this->ConfigDomain]['db_host'];
$this->db->Port = $GLOBALS['phpgw_domain'][$this->ConfigDomain]['db_port'];
$this->db->Type = $GLOBALS['phpgw_domain'][$this->ConfigDomain]['db_type'];
$this->db->Database = $GLOBALS['phpgw_domain'][$this->ConfigDomain]['db_name'];
$this->db->User = $GLOBALS['phpgw_domain'][$this->ConfigDomain]['db_user'];
$this->db->Password = $GLOBALS['phpgw_domain'][$this->ConfigDomain]['db_pass'];
$this->db->Host = $GLOBALS['egw_domain'][$this->ConfigDomain]['db_host'];
$this->db->Port = $GLOBALS['egw_domain'][$this->ConfigDomain]['db_port'];
$this->db->Type = $GLOBALS['egw_domain'][$this->ConfigDomain]['db_type'];
$this->db->Database = $GLOBALS['egw_domain'][$this->ConfigDomain]['db_name'];
$this->db->User = $GLOBALS['egw_domain'][$this->ConfigDomain]['db_user'];
$this->db->Password = $GLOBALS['egw_domain'][$this->ConfigDomain]['db_pass'];
$this->db->set_app('phpgwapi');
@ -154,13 +154,13 @@
/* Setup defaults to aid in header upgrade to version 1.26.
* This was the first version to include the following values.
*/
if(!@isset($GLOBALS['phpgw_domain'][$FormDomain]['config_user']) && isset($GLOBALS['phpgw_domain'][$FormDomain]))
if(!@isset($GLOBALS['egw_domain'][$FormDomain]['config_user']) && isset($GLOBALS['egw_domain'][$FormDomain]))
{
@$GLOBALS['phpgw_domain'][$FormDomain]['config_user'] = 'admin';
@$GLOBALS['egw_domain'][$FormDomain]['config_user'] = 'admin';
}
if(!@isset($GLOBALS['phpgw_info']['server']['header_admin_user']))
if(!@isset($GLOBALS['egw_info']['server']['header_admin_user']))
{
@$GLOBALS['phpgw_info']['server']['header_admin_user'] = 'admin';
@$GLOBALS['egw_info']['server']['header_admin_user'] = 'admin';
}
}
@ -177,9 +177,9 @@
$this->set_cookie('ConfigPW','',$expire,'/');
$this->set_cookie('ConfigDomain','',$expire,'/');
$this->set_cookie('ConfigLang','',$expire,'/');
$GLOBALS['phpgw_info']['setup']['LastDomain'] = $_COOKIE['ConfigDomain'];
$GLOBALS['phpgw_info']['setup']['ConfigLoginMSG'] = lang('You have successfully logged out');
$GLOBALS['phpgw_info']['setup']['HeaderLoginMSG'] = '';
$GLOBALS['egw_info']['setup']['LastDomain'] = $_COOKIE['ConfigDomain'];
$GLOBALS['egw_info']['setup']['ConfigLoginMSG'] = lang('You have successfully logged out');
$GLOBALS['egw_info']['setup']['HeaderLoginMSG'] = '';
return False;
case 'header':
/* header admin logout */
@ -187,8 +187,8 @@
$this->set_cookie('HeaderUser','',$expire,'/');
$this->set_cookie('HeaderPW','',$expire,'/');
$this->set_cookie('ConfigLang','',$expire,'/');
$GLOBALS['phpgw_info']['setup']['HeaderLoginMSG'] = lang('You have successfully logged out');
$GLOBALS['phpgw_info']['setup']['ConfigLoginMSG'] = '';
$GLOBALS['egw_info']['setup']['HeaderLoginMSG'] = lang('You have successfully logged out');
$GLOBALS['egw_info']['setup']['ConfigLoginMSG'] = '';
return False;
}
@ -203,8 +203,8 @@
{
/* header admin login */
/* New test is md5, cleartext version is for header < 1.26 */
if ($this->check_auth($FormUser,$FormPW,$GLOBALS['phpgw_info']['server']['header_admin_user'],
$GLOBALS['phpgw_info']['server']['header_admin_password']))
if ($this->check_auth($FormUser,$FormPW,$GLOBALS['egw_info']['server']['header_admin_user'],
$GLOBALS['egw_info']['server']['header_admin_password']))
{
$this->set_cookie('HeaderUser',"$FormUser",$expire,'/');
$this->set_cookie('HeaderPW',"$FormPW",$expire,'/');
@ -213,8 +213,8 @@
}
else
{
$GLOBALS['phpgw_info']['setup']['HeaderLoginMSG'] = lang('Invalid password');
$GLOBALS['phpgw_info']['setup']['ConfigLoginMSG'] = '';
$GLOBALS['egw_info']['setup']['HeaderLoginMSG'] = lang('Invalid password');
$GLOBALS['egw_info']['setup']['ConfigLoginMSG'] = '';
return False;
}
}
@ -222,8 +222,8 @@
{
// Returning after login to header admin
/* New test is md5, cleartext version is for header < 1.26 */
if ($this->check_auth($HeaderUser,$HeaderPW,$GLOBALS['phpgw_info']['server']['header_admin_user'],
$GLOBALS['phpgw_info']['server']['header_admin_password']))
if ($this->check_auth($HeaderUser,$HeaderPW,$GLOBALS['egw_info']['server']['header_admin_user'],
$GLOBALS['egw_info']['server']['header_admin_password']))
{
$this->set_cookie('HeaderUser',"$HeaderUser",$expire,'/');
$this->set_cookie('HeaderPW',"$HeaderPW",$expire,'/');
@ -232,8 +232,8 @@
}
else
{
$GLOBALS['phpgw_info']['setup']['HeaderLoginMSG'] = lang('Invalid password');
$GLOBALS['phpgw_info']['setup']['ConfigLoginMSG'] = '';
$GLOBALS['egw_info']['setup']['HeaderLoginMSG'] = lang('Invalid password');
$GLOBALS['egw_info']['setup']['ConfigLoginMSG'] = '';
return False;
}
}
@ -243,9 +243,9 @@
{
/* config login */
/* New test is md5, cleartext version is for header < 1.26 */
if (isset($GLOBALS['phpgw_domain'][$FormDomain]) &&
$this->check_auth($FormUser,$FormPW,@$GLOBALS['phpgw_domain'][$FormDomain]['config_user'],
@$GLOBALS['phpgw_domain'][$FormDomain]['config_passwd']))
if (isset($GLOBALS['egw_domain'][$FormDomain]) &&
$this->check_auth($FormUser,$FormPW,@$GLOBALS['egw_domain'][$FormDomain]['config_user'],
@$GLOBALS['egw_domain'][$FormDomain]['config_passwd']))
{
$this->set_cookie('ConfigUser',"$FormUser",$expire,'/');
$this->set_cookie('ConfigPW',"$FormPW",$expire,'/');
@ -257,8 +257,8 @@
}
else
{
$GLOBALS['phpgw_info']['setup']['ConfigLoginMSG'] = lang('Invalid password');
$GLOBALS['phpgw_info']['setup']['HeaderLoginMSG'] = '';
$GLOBALS['egw_info']['setup']['ConfigLoginMSG'] = lang('Invalid password');
$GLOBALS['egw_info']['setup']['HeaderLoginMSG'] = '';
return False;
}
}
@ -266,8 +266,8 @@
{
// Returning after login to config
/* New test is md5, cleartext version is for header < 1.26 */
if ($this->check_auth($ConfigUser,$ConfigPW,@$GLOBALS['phpgw_domain'][$this->ConfigDomain]['config_user'],
@$GLOBALS['phpgw_domain'][$this->ConfigDomain]['config_passwd']))
if ($this->check_auth($ConfigUser,$ConfigPW,@$GLOBALS['egw_domain'][$this->ConfigDomain]['config_user'],
@$GLOBALS['egw_domain'][$this->ConfigDomain]['config_passwd']))
{
$this->set_cookie('ConfigUser',"$ConfigUser",$expire,'/');
$this->set_cookie('ConfigPW',"$ConfigPW",$expire,'/');
@ -277,8 +277,8 @@
}
else
{
$GLOBALS['phpgw_info']['setup']['ConfigLoginMSG'] = lang('Invalid password');
$GLOBALS['phpgw_info']['setup']['HeaderLoginMSG'] = '';
$GLOBALS['egw_info']['setup']['ConfigLoginMSG'] = lang('Invalid password');
$GLOBALS['egw_info']['setup']['HeaderLoginMSG'] = '';
return False;
}
}
@ -304,9 +304,9 @@
function checkip($remoteip='')
{
//echo "<p>setup::checkip($remoteip) against setup_acl='".$GLOBALS['phpgw_info']['server']['setup_acl']."'</p>\n";
$allowed_ips = explode(',',@$GLOBALS['phpgw_info']['server']['setup_acl']);
if(empty($GLOBALS['phpgw_info']['server']['setup_acl']) || !is_array($allowed_ips))
//echo "<p>setup::checkip($remoteip) against setup_acl='".$GLOBALS['egw_info']['server']['setup_acl']."'</p>\n";
$allowed_ips = explode(',',@$GLOBALS['egw_info']['server']['setup_acl']);
if(empty($GLOBALS['egw_info']['server']['setup_acl']) || !is_array($allowed_ips))
{
return True; // no test
}
@ -331,8 +331,8 @@
return True; // match
}
}
$GLOBALS['phpgw_info']['setup']['HeaderLoginMSG'] = '';
$GLOBALS['phpgw_info']['setup']['ConfigLoginMSG'] = lang('Invalid IP address');
$GLOBALS['egw_info']['setup']['HeaderLoginMSG'] = '';
$GLOBALS['egw_info']['setup']['ConfigLoginMSG'] = lang('Invalid IP address');
return False;
}
@ -555,7 +555,7 @@
if($tableschanged == True)
{
$GLOBALS['phpgw_info']['setup']['tableschanged'] = True;
$GLOBALS['egw_info']['setup']['tableschanged'] = True;
}
if($setup_info[$appname]['currentver'])
{
@ -848,7 +848,7 @@
function setup_account_object()
{
if (!is_object($GLOBALS['phpgw']->accounts))
if (!is_object($GLOBALS['egw']->accounts))
{
if (!is_object($this->db))
{
@ -859,20 +859,20 @@
. "WHERE config_name LIKE 'ldap%' OR config_name LIKE 'account_%' OR config_name LIKE '%encryption%'",__LINE__,__FILE__);
while($this->db->next_record())
{
$GLOBALS['phpgw_info']['server'][$this->db->f('config_name')] = $this->db->f('config_value');
$GLOBALS['egw_info']['server'][$this->db->f('config_name')] = $this->db->f('config_value');
}
if (!is_object($GLOBALS['phpgw']))
if (!is_object($GLOBALS['egw']))
{
$GLOBALS['phpgw'] = CreateObject('phpgwapi.phpgw');
$GLOBALS['egw'] = CreateObject('phpgwapi.phpgw');
}
copyobj($this->db,$GLOBALS['phpgw']->db);
$GLOBALS['phpgw']->common = CreateObject('phpgwapi.common');
$GLOBALS['phpgw']->accounts = CreateObject('phpgwapi.accounts');
copyobj($this->db,$GLOBALS['egw']->db);
$GLOBALS['egw']->common = CreateObject('phpgwapi.common');
$GLOBALS['egw']->accounts = CreateObject('phpgwapi.accounts');
if(($GLOBALS['phpgw_info']['server']['account_repository'] == 'ldap') &&
!$GLOBALS['phpgw']->accounts->ds)
if(($GLOBALS['egw_info']['server']['account_repository'] == 'ldap') &&
!$GLOBALS['egw']->accounts->ds)
{
printf("<b>Error: Error connecting to LDAP server %s!</b><br>",$GLOBALS['phpgw_info']['server']['ldap_host']);
printf("<b>Error: Error connecting to LDAP server %s!</b><br>",$GLOBALS['egw_info']['server']['ldap_host']);
exit;
}
}
@ -893,11 +893,11 @@
{
$this->setup_account_object();
$groupid = $group ? $GLOBALS['phpgw']->accounts->name2id($group) : False;
$groupid = $group ? $GLOBALS['egw']->accounts->name2id($group) : False;
if(!($accountid = $GLOBALS['phpgw']->accounts->name2id($username)))
if(!($accountid = $GLOBALS['egw']->accounts->name2id($username)))
{
$accountid = $accountid ? $accountid : $GLOBALS['phpgw']->accounts->create(array(
$accountid = $accountid ? $accountid : $GLOBALS['egw']->accounts->create(array(
'account_type' => $group ? 'u' : 'g',
'account_lid' => $username,
'account_passwd' => $passwd,
@ -931,7 +931,7 @@
if (!is_int($account))
{
$this->setup_account_object();
$account = $GLOBALS['phpgw']->accounts->name2id($account);
$account = $GLOBALS['egw']->accounts->name2id($account);
}
$rights = (int)$rights;
if(!is_object($this->db))

View File

@ -18,12 +18,12 @@
{
function get_versions()
{
$d = dir(PHPGW_SERVER_ROOT);
$d = dir(EGW_SERVER_ROOT);
while($entry=$d->read())
{
if($entry != ".." && !ereg('setup',$entry) && is_dir(PHPGW_SERVER_ROOT . '/' . $entry))
if($entry != ".." && !ereg('setup',$entry) && is_dir(EGW_SERVER_ROOT . '/' . $entry))
{
$f = PHPGW_SERVER_ROOT . '/' . $entry . '/setup/setup.inc.php';
$f = EGW_SERVER_ROOT . '/' . $entry . '/setup/setup.inc.php';
if (@file_exists ($f))
{
include($f);
@ -224,29 +224,29 @@
{
if(!file_exists('../header.inc.php'))
{
$GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage One';
$GLOBALS['egw_info']['setup']['header_msg'] = 'Stage One';
return '1';
}
else
{
if(!@isset($GLOBALS['phpgw_info']['server']['header_admin_password']))
if(!@isset($GLOBALS['egw_info']['server']['header_admin_password']))
{
$GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage One (No header admin password set)';
$GLOBALS['egw_info']['setup']['header_msg'] = 'Stage One (No header admin password set)';
return '2';
}
elseif(!@isset($GLOBALS['phpgw_domain']))
elseif(!@isset($GLOBALS['egw_domain']))
{
$GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage One (Add domains to your header.inc.php)';
$GLOBALS['egw_info']['setup']['header_msg'] = 'Stage One (Add domains to your header.inc.php)';
return '3';
}
elseif(@$GLOBALS['phpgw_info']['server']['versions']['header'] != @$GLOBALS['phpgw_info']['server']['versions']['current_header'])
elseif(@$GLOBALS['egw_info']['server']['versions']['header'] != @$GLOBALS['egw_info']['server']['versions']['current_header'])
{
$GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage One (Upgrade your header.inc.php)';
$GLOBALS['egw_info']['setup']['header_msg'] = 'Stage One (Upgrade your header.inc.php)';
return '4';
}
}
/* header.inc.php part settled. Moving to authentication */
$GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage One (Completed)';
$GLOBALS['egw_info']['setup']['header_msg'] = 'Stage One (Completed)';
return '10';
}
@ -266,7 +266,7 @@
}
if (!$GLOBALS['phpgw_setup']->db->Link_ID)
{
$GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 1 (Create Database)';
$GLOBALS['egw_info']['setup']['header_msg'] = 'Stage 1 (Create Database)';
return 1;
}
if(!isset($setup_info['phpgwapi']['currentver']))
@ -278,12 +278,12 @@
{
if(@$setup_info['phpgwapi']['currentver'] == @$setup_info['phpgwapi']['version'])
{
$GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 1 (Tables Complete)';
$GLOBALS['egw_info']['setup']['header_msg'] = 'Stage 1 (Tables Complete)';
return 10;
}
else
{
$GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 1 (Tables need upgrading)';
$GLOBALS['egw_info']['setup']['header_msg'] = 'Stage 1 (Tables need upgrading)';
return 4;
}
}
@ -294,12 +294,12 @@
if(!$GLOBALS['phpgw_setup']->db->Errno)
{
$GLOBALS['phpgw_setup']->db->query('DROP TABLE phpgw_testrights');
$GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 3 (Install Applications)';
$GLOBALS['egw_info']['setup']['header_msg'] = 'Stage 3 (Install Applications)';
return 3;
}
else
{
$GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 1 (Create Database)';
$GLOBALS['egw_info']['setup']['header_msg'] = 'Stage 1 (Create Database)';
return 1;
}
}
@ -308,13 +308,13 @@
function check_config()
{
$GLOBALS['phpgw_setup']->db->Halt_On_Error = 'no';
if(@$GLOBALS['phpgw_info']['setup']['stage']['db'] != 10)
if(@$GLOBALS['egw_info']['setup']['stage']['db'] != 10)
{
return '';
}
/* Since 0.9.10pre6 config table is named as phpgw_config */
$ver = explode('.',@$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
$ver = explode('.',@$GLOBALS['egw_info']['server']['versions']['phpgwapi']);
$config_table = $ver[0] > 0 || (int)$ver[2] > 10 ? 'phpgw_config' : 'config';
if(ereg("([0-9]+)(pre)([0-9]+)",$ver[2],$regs))
@ -329,12 +329,12 @@
$configured = $GLOBALS['phpgw_setup']->db->next_record() ? $GLOBALS['phpgw_setup']->db->f('config_value') : False;
if($configed)
{
$GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 2 (Needs Configuration)';
$GLOBALS['egw_info']['setup']['header_msg'] = 'Stage 2 (Needs Configuration)';
return 1;
}
else
{
$GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 2 (Configuration OK)';
$GLOBALS['egw_info']['setup']['header_msg'] = 'Stage 2 (Configuration OK)';
return 10;
}
}
@ -342,7 +342,7 @@
function check_lang($check = True)
{
$GLOBALS['phpgw_setup']->db->Halt_On_Error = 'no';
if($check && $GLOBALS['phpgw_info']['setup']['stage']['db'] != 10)
if($check && $GLOBALS['egw_info']['setup']['stage']['db'] != 10)
{
return '';
}
@ -364,25 +364,25 @@
$GLOBALS['phpgw_setup']->db->query($q = "SELECT DISTINCT lang FROM $langtbl",__LINE__,__FILE__);
if($GLOBALS['phpgw_setup']->db->num_rows() == 0)
{
$GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 3 (No languages installed)';
$GLOBALS['egw_info']['setup']['header_msg'] = 'Stage 3 (No languages installed)';
return 1;
}
else
{
while(@$GLOBALS['phpgw_setup']->db->next_record())
{
$GLOBALS['phpgw_info']['setup']['installed_langs'][$GLOBALS['phpgw_setup']->db->f('lang')] = $GLOBALS['phpgw_setup']->db->f('lang');
$GLOBALS['egw_info']['setup']['installed_langs'][$GLOBALS['phpgw_setup']->db->f('lang')] = $GLOBALS['phpgw_setup']->db->f('lang');
}
foreach($GLOBALS['phpgw_info']['setup']['installed_langs'] as $key => $value)
foreach($GLOBALS['egw_info']['setup']['installed_langs'] as $key => $value)
{
$sql = "SELECT lang_name FROM $languagestbl WHERE lang_id = '".$value."'";
$GLOBALS['phpgw_setup']->db->query($sql);
if ($GLOBALS['phpgw_setup']->db->next_record())
{
$GLOBALS['phpgw_info']['setup']['installed_langs'][$value] = $GLOBALS['phpgw_setup']->db->f('lang_name');
$GLOBALS['egw_info']['setup']['installed_langs'][$value] = $GLOBALS['phpgw_setup']->db->f('lang_name');
}
}
$GLOBALS['phpgw_info']['setup']['header_msg'] = 'Stage 3 (Completed)';
$GLOBALS['egw_info']['setup']['header_msg'] = 'Stage 3 (Completed)';
return 10;
}
}

View File

@ -97,9 +97,9 @@
function setup_tpl_dir($app_name='setup')
{
/* hack to get tpl dir */
if (is_dir(PHPGW_SERVER_ROOT))
if (is_dir(EGW_SERVER_ROOT))
{
$srv_root = PHPGW_SERVER_ROOT . SEP . "$app_name" . SEP;
$srv_root = EGW_SERVER_ROOT . SEP . "$app_name" . SEP;
}
else
{
@ -155,7 +155,7 @@
}
$GLOBALS['setup_tpl']->set_var('lang_version',lang('version'));
$GLOBALS['setup_tpl']->set_var('pgw_ver',@$GLOBALS['phpgw_info']['server']['versions']['phpgwapi']);
$GLOBALS['setup_tpl']->set_var('pgw_ver',@$GLOBALS['egw_info']['server']['versions']['phpgwapi']);
$GLOBALS['setup_tpl']->set_var(array(
'logoutbutton' => $btn_logout,
'indexbutton' => $index_btn,
@ -204,8 +204,8 @@
function login_form()
{
/* begin use TEMPLATE login_main.tpl */
$GLOBALS['setup_tpl']->set_var('ConfigLoginMSG',@$GLOBALS['phpgw_info']['setup']['ConfigLoginMSG']);
$GLOBALS['setup_tpl']->set_var('HeaderLoginMSG',@$GLOBALS['phpgw_info']['setup']['HeaderLoginMSG']);
$GLOBALS['setup_tpl']->set_var('ConfigLoginMSG',@$GLOBALS['egw_info']['setup']['ConfigLoginMSG']);
$GLOBALS['setup_tpl']->set_var('HeaderLoginMSG',@$GLOBALS['egw_info']['setup']['HeaderLoginMSG']);
$GLOBALS['setup_tpl']->set_var('lang_header_username',lang('Header Username'));
$GLOBALS['setup_tpl']->set_var('lang_header_password',lang('Header Password'));
$GLOBALS['setup_tpl']->set_var('lang_header_login',lang('Header Admin Login'));
@ -216,17 +216,17 @@
$GLOBALS['setup_tpl']->set_var('lang_select',lang_select());
if ($GLOBALS['phpgw_info']['setup']['stage']['header'] == '10')
if ($GLOBALS['egw_info']['setup']['stage']['header'] == '10')
{
/*
Begin use SUB-TEMPLATE login_stage_header,
fills V_login_stage_header used inside of login_main.tpl
*/
if (count($GLOBALS['phpgw_domain']) > 1)
if (count($GLOBALS['egw_domain']) > 1)
{
foreach($GLOBALS['phpgw_domain'] as $domain => $data)
foreach($GLOBALS['egw_domain'] as $domain => $data)
{
$domains .= "<option value=\"$domain\" ".($domain == @$GLOBALS['phpgw_info']['setup']['LastDomain'] ? ' SELECTED' : '').">$domain</option>\n";
$domains .= "<option value=\"$domain\" ".($domain == @$GLOBALS['egw_info']['setup']['LastDomain'] ? ' SELECTED' : '').">$domain</option>\n";
}
$GLOBALS['setup_tpl']->set_var('domains',$domains);
@ -237,8 +237,8 @@
}
else
{
reset($GLOBALS['phpgw_domain']);
$default_domain = each($GLOBALS['phpgw_domain']);
reset($GLOBALS['egw_domain']);
$default_domain = each($GLOBALS['egw_domain']);
$GLOBALS['setup_tpl']->set_var('default_domain_zero',$default_domain[0]);
/* Use BLOCK B_single_domain inside of login_stage_header */
@ -268,18 +268,18 @@
function get_template_list()
{
$d = dir(PHPGW_SERVER_ROOT . '/phpgwapi/templates');
$d = dir(EGW_SERVER_ROOT . '/phpgwapi/templates');
while($entry = $d->read())
{
if ($entry != 'CVS' && $entry != '.' && $entry != '..')
{
$list[$entry]['name'] = $entry;
$f = PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $entry . '/details.inc.php';
$f = EGW_SERVER_ROOT . '/phpgwapi/templates/' . $entry . '/details.inc.php';
if (file_exists ($f))
{
include($f);
$list[$entry]['title'] = 'Use ' . $GLOBALS['phpgw_info']['template'][$entry]['title'] . 'interface';
$list[$entry]['title'] = 'Use ' . $GLOBALS['egw_info']['template'][$entry]['title'] . 'interface';
}
else
{
@ -294,7 +294,7 @@
function list_themes()
{
$dh = dir(PHPGW_SERVER_ROOT . '/phpgwapi/themes');
$dh = dir(EGW_SERVER_ROOT . '/phpgwapi/themes');
while ($file = $dh->read())
{
if (eregi("\.theme$", $file))

View File

@ -98,7 +98,7 @@
{
if (!is_object($this->sql))
{
include_once(PHPGW_API_INC.'/class.translation_sql.inc.php');
include_once(EGW_API_INC.'/class.translation_sql.inc.php');
$this->sql = new translation;
}
}

View File

@ -16,18 +16,6 @@
/* $Id$ */
/* ######## Start security check ########## */
$d1 = strtolower(substr(@$GLOBALS['phpgw_info']['server']['api_inc'],0,3));
$d2 = strtolower(substr(@$GLOBALS['phpgw_info']['server']['server_root'],0,3));
$d3 = strtolower(substr(@$GLOBALS['phpgw_info']['server']['app_inc'],0,3));
if($d1 == 'htt' || $d1 == 'ftp' || $d2 == 'htt' || $d2 == 'ftp' || $d3 == 'htt' || $d3 == 'ftp')
{
echo 'Failed attempt to break in via an old Security Hole!<br>';
exit;
}
unset($d1);unset($d2);unset($d3);
/* ######## End security check ########## */
error_reporting(error_reporting() & ~E_NOTICE);
if(file_exists('../header.inc.php'))
@ -43,13 +31,15 @@
}
/* If we included the header.inc.php, but it is somehow broken, cover ourselves... */
if(!defined('PHPGW_SERVER_ROOT') && !defined('PHPGW_INCLUDE_ROOT'))
if(!defined('EGW_SERVER_ROOT') && !defined('EGW_INCLUDE_ROOT'))
{
define('EGW_SERVER_ROOT','..');
define('EGW_INCLUDE_ROOT','..');
define('PHPGW_SERVER_ROOT','..');
define('PHPGW_INCLUDE_ROOT','..');
}
include(PHPGW_INCLUDE_ROOT . '/phpgwapi/inc/common_functions.inc.php');
include(EGW_INCLUDE_ROOT . '/phpgwapi/inc/common_functions.inc.php');
define('SEP',filesystem_separator());
@ -129,18 +119,18 @@
return $select;
}
if(file_exists(PHPGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php'))
if(file_exists(EGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php'))
{
include(PHPGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php'); /* To set the current core version */
include(EGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php'); /* To set the current core version */
/* This will change to just use setup_info */
$GLOBALS['phpgw_info']['server']['versions']['current_header'] = $setup_info['phpgwapi']['versions']['current_header'];
$GLOBALS['egw_info']['server']['versions']['current_header'] = $setup_info['phpgwapi']['versions']['current_header'];
}
else
{
$GLOBALS['phpgw_info']['server']['versions']['phpgwapi'] = 'Undetected';
$GLOBALS['egw_info']['server']['versions']['phpgwapi'] = 'Undetected';
}
$GLOBALS['phpgw_info']['server']['app_images'] = 'templates/default/images';
$GLOBALS['egw_info']['server']['app_images'] = 'templates/default/images';
$GLOBALS['phpgw_setup'] = CreateObject('phpgwapi.setup',True,True);
?>
$GLOBALS['egw_setup'] = CreateObject('setup.setup',True,True);
$GLOBALS['phpgw_setup'] =& $GLOBALS['egw_setup'];

View File

@ -11,20 +11,19 @@
/* $Id$ */
$GLOBALS['DEBUG'] = False;
$phpgw_info = array();
$GLOBALS['phpgw_info']['flags'] = array
(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True,
'nocachecontrol' => True
);
$GLOBALS['egw_info'] = array(
'flags' => array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True,
'nocachecontrol' => True
));
include('./inc/functions.inc.php');
@set_time_limit(0);
$tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
$tpl_root = $GLOBALS['egw_setup']->html->setup_tpl_dir('setup');
$setup_tpl = CreateObject('setup.Template',$tpl_root);
$setup_tpl->set_file(array
(
@ -52,10 +51,10 @@
$setup_tpl->set_block('T_setup_db_blocks','B_db_stage_default','V_db_stage_default');
// Check header and authentication
$GLOBALS['phpgw_info']['setup']['stage']['header'] = $GLOBALS['phpgw_setup']->detection->check_header();
if ($GLOBALS['phpgw_info']['setup']['stage']['header'] != '10')
$GLOBALS['egw_info']['setup']['stage']['header'] = $GLOBALS['egw_setup']->detection->check_header();
if ($GLOBALS['egw_info']['setup']['stage']['header'] != '10')
{
if ($GLOBALS['phpgw_info']['setup']['stage']['header'] == 4) // header needs update, go there direct
if ($GLOBALS['egw_info']['setup']['stage']['header'] == 4) // header needs update, go there direct
{
Header('Location: manageheader.php');
}
@ -65,42 +64,42 @@
}
exit;
}
elseif(!$GLOBALS['phpgw_setup']->auth('Config'))
elseif(!$GLOBALS['egw_setup']->auth('Config'))
{
$GLOBALS['phpgw_setup']->html->show_header(lang('Please login'),True);
$GLOBALS['phpgw_setup']->html->login_form();
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_header(lang('Please login'),True);
$GLOBALS['egw_setup']->html->login_form();
$GLOBALS['egw_setup']->html->show_footer();
exit;
}
$GLOBALS['phpgw_setup']->loaddb();
$GLOBALS['egw_setup']->loaddb();
$GLOBALS['phpgw_setup']->html->show_header(
$GLOBALS['phpgw_info']['setup']['header_msg'],
$GLOBALS['egw_setup']->html->show_header(
$GLOBALS['egw_info']['setup']['header_msg'],
False,
'config',
$GLOBALS['phpgw_setup']->ConfigDomain . '(' . $GLOBALS['phpgw_domain'][$GLOBALS['phpgw_setup']->ConfigDomain]['db_type'] . ')'
$GLOBALS['egw_setup']->ConfigDomain . '(' . $GLOBALS['egw_domain'][$GLOBALS['egw_setup']->ConfigDomain]['db_type'] . ')'
);
/* Add cleaning of app_sessions per skeeter, but with a check for the table being there, just in case */
/* $GLOBALS['phpgw_setup']->clear_session_cache(); */
/* $GLOBALS['egw_setup']->clear_session_cache(); */
// Database actions
$setup_info = $GLOBALS['phpgw_setup']->detection->get_versions();
$GLOBALS['phpgw_info']['setup']['stage']['db'] = $GLOBALS['phpgw_setup']->detection->check_db($setup_info);
if ($GLOBALS['phpgw_info']['setup']['stage']['db'] != 1)
$setup_info = $GLOBALS['egw_setup']->detection->get_versions();
$GLOBALS['egw_info']['setup']['stage']['db'] = $GLOBALS['egw_setup']->detection->check_db($setup_info);
if ($GLOBALS['egw_info']['setup']['stage']['db'] != 1)
{
$setup_info = $GLOBALS['phpgw_setup']->detection->get_versions();
$setup_info = $GLOBALS['phpgw_setup']->detection->get_db_versions($setup_info);
$GLOBALS['phpgw_info']['setup']['stage']['db'] = $GLOBALS['phpgw_setup']->detection->check_db($setup_info);
$setup_info = $GLOBALS['egw_setup']->detection->get_versions();
$setup_info = $GLOBALS['egw_setup']->detection->get_db_versions($setup_info);
$GLOBALS['egw_info']['setup']['stage']['db'] = $GLOBALS['egw_setup']->detection->check_db($setup_info);
if($GLOBALS['DEBUG'])
{
_debug_array($setup_info);
}
}
if ($GLOBALS['DEBUG']) { echo 'Stage: ' . $GLOBALS['phpgw_info']['setup']['stage']['db']; }
if ($GLOBALS['DEBUG']) { echo 'Stage: ' . $GLOBALS['egw_info']['setup']['stage']['db']; }
// begin DEBUG code
//$GLOBALS['phpgw_info']['setup']['stage']['db'] = 0;
//$GLOBALS['egw_info']['setup']['stage']['db'] = 0;
//$action = 'Upgrade';
// end DEBUG code
@ -110,22 +109,22 @@
$subtitle = lang('Deleting Tables');
$submsg = lang('Are you sure you want to delete your existing tables and data?') . '.';
$subaction = lang('uninstall');
$GLOBALS['phpgw_info']['setup']['currentver']['phpgwapi'] = 'predrop';
$GLOBALS['phpgw_info']['setup']['stage']['db'] = 5;
$GLOBALS['egw_info']['setup']['currentver']['phpgwapi'] = 'predrop';
$GLOBALS['egw_info']['setup']['stage']['db'] = 5;
break;
case 'Create Database':
$subtitle = lang('Create Database');
$submsg = lang('At your request, this script is going to attempt to create the database and assign the db user rights to it');
$subaction = lang('created');
$GLOBALS['phpgw_info']['setup']['currentver']['phpgwapi'] = 'dbcreate';
$GLOBALS['phpgw_info']['setup']['stage']['db'] = 6;
$GLOBALS['egw_info']['setup']['currentver']['phpgwapi'] = 'dbcreate';
$GLOBALS['egw_info']['setup']['stage']['db'] = 6;
break;
case 'REALLY Uninstall all applications':
$subtitle = lang('Deleting Tables');
$submsg = lang('At your request, this script is going to take the evil action of uninstalling all your apps, which deletes your existing tables and data') . '.';
$subaction = lang('uninstalled');
$GLOBALS['phpgw_info']['setup']['currentver']['phpgwapi'] = 'drop';
$GLOBALS['phpgw_info']['setup']['stage']['db'] = 6;
$GLOBALS['egw_info']['setup']['currentver']['phpgwapi'] = 'drop';
$GLOBALS['egw_info']['setup']['stage']['db'] = 6;
break;
case 'Upgrade':
$subtitle = lang('Upgrading Tables');
@ -135,8 +134,8 @@
$submsg .= ' '.lang('After backing up your tables first.');
}
$subaction = lang('upgraded');
$GLOBALS['phpgw_info']['setup']['currentver']['phpgwapi'] = 'oldversion';
$GLOBALS['phpgw_info']['setup']['stage']['db'] = 6;
$GLOBALS['egw_info']['setup']['currentver']['phpgwapi'] = 'oldversion';
$GLOBALS['egw_info']['setup']['stage']['db'] = 6;
break;
case 'Install':
$subtitle = lang('Creating Tables');
@ -149,8 +148,8 @@
$submsg = lang('At your request, this script is going to attempt to install the core tables and the admin and preferences applications for you').'.';
}
$subaction = lang('installed');
$GLOBALS['phpgw_info']['setup']['currentver']['phpgwapi'] = 'new';
$GLOBALS['phpgw_info']['setup']['stage']['db'] = 6;
$GLOBALS['egw_info']['setup']['currentver']['phpgwapi'] = 'new';
$GLOBALS['egw_info']['setup']['stage']['db'] = 6;
break;
}
$setup_tpl->set_var('subtitle',@$subtitle);
@ -160,35 +159,35 @@
// Old PHP
if (!function_exists('version_compare'))//version_compare() is only available in PHP4.1+
{
$GLOBALS['phpgw_setup']->html->show_header($GLOBALS['phpgw_info']['setup']['header_msg'],True);
$GLOBALS['phpgw_setup']->html->show_alert_msg('Error',
$GLOBALS['egw_setup']->html->show_header($GLOBALS['egw_info']['setup']['header_msg'],True);
$GLOBALS['egw_setup']->html->show_alert_msg('Error',
lang('You appear to be running an old version of PHP <br>It its recommend that you upgrade to a new version. <br>Older version of PHP might not run eGroupWare correctly, if at all. <br><br>Please upgrade to at least version %1','4.1'));
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_footer();
exit;
}
// BEGIN setup page
//$GLOBALS['phpgw_setup']->app_status();
$GLOBALS['phpgw_info']['server']['app_images'] = 'templates/default/images';
$incomplete = $GLOBALS['phpgw_info']['server']['app_images'] . '/incomplete.png';
$completed = $GLOBALS['phpgw_info']['server']['app_images'] . '/completed.png';
//$GLOBALS['egw_setup']->app_status();
$GLOBALS['egw_info']['server']['app_images'] = 'templates/default/images';
$incomplete = $GLOBALS['egw_info']['server']['app_images'] . '/incomplete.png';
$completed = $GLOBALS['egw_info']['server']['app_images'] . '/completed.png';
$setup_tpl->set_var('img_incomplete',$incomplete);
$setup_tpl->set_var('img_completed',$completed);
$setup_tpl->set_var('db_step_text',lang('Step %1 - Simple Application Management',1));
switch($GLOBALS['phpgw_info']['setup']['stage']['db'])
switch($GLOBALS['egw_info']['setup']['stage']['db'])
{
case 1:
$setup_tpl->set_var('dbnotexist',lang('Your Database is not working!').':<p>'.$GLOBALS['phpgw_setup']->db->Error);
$setup_tpl->set_var('dbnotexist',lang('Your Database is not working!').':<p>'.$GLOBALS['egw_setup']->db->Error);
$setup_tpl->set_var('makesure',lang('makesure'));
$setup_tpl->set_var('notcomplete',lang('not complete'));
$setup_tpl->set_var('oncesetup',lang('Once the database is setup correctly'));
$setup_tpl->set_var('createdb',lang('Or we can attempt to create the database for you:'));
$setup_tpl->set_var('create_database',lang('Create database'));
$info = $GLOBALS['phpgw_domain'][$GLOBALS['phpgw_setup']->ConfigDomain];
$info = $GLOBALS['egw_domain'][$GLOBALS['egw_setup']->ConfigDomain];
switch ($info['db_type'])
{
case 'mysql':
@ -231,7 +230,7 @@
$setup_tpl->set_var('coreapps',lang('all applications'));
$setup_tpl->set_var('lang_debug',lang('enable for extra debug-messages'));
$setup_tpl->set_var('lang_system_charset',lang('<b>charset to use</b> (use utf-8 if you plan to use languages with different charsets):'));
$setup_tpl->set_var('system_charset',$GLOBALS['phpgw_setup']->translation->get_charsets('system_charset',lang('charset')));
$setup_tpl->set_var('system_charset',$GLOBALS['egw_setup']->translation->get_charsets('system_charset',lang('charset')));
$setup_tpl->set_var('lang_restore',lang('Or you can install a previous backup.'));
$setup_tpl->set_var('upload','<input type="file" name="uploaded" /> &nbsp;'.
'<input type="submit" name="upload" value="'.htmlspecialchars(lang('install backup')).'" title="'.htmlspecialchars(lang("uploads a backup and installs it on your DB")).'" />');
@ -278,16 +277,16 @@
$setup_tpl->set_var('tableshave',lang('If you did not receive any errors, your applications have been'));
// FIXME : CAPTURE THIS OUTPUT
$GLOBALS['phpgw_setup']->db->Halt_On_Error = 'report';
$GLOBALS['egw_setup']->db->Halt_On_Error = 'report';
switch ($GLOBALS['phpgw_info']['setup']['currentver']['phpgwapi'])
switch ($GLOBALS['egw_info']['setup']['currentver']['phpgwapi'])
{
case 'dbcreate':
$GLOBALS['phpgw_setup']->db->create_database($_POST['db_root'], $_POST['db_pass']);
$GLOBALS['egw_setup']->db->create_database($_POST['db_root'], $_POST['db_pass']);
break;
case 'drop':
$setup_info = $GLOBALS['phpgw_setup']->detection->get_versions($setup_info);
$setup_info = $GLOBALS['phpgw_setup']->process->droptables($setup_info);
$setup_info = $GLOBALS['egw_setup']->detection->get_versions($setup_info);
$setup_info = $GLOBALS['egw_setup']->process->droptables($setup_info);
break;
case 'new':
// use uploaded backup, instead installing from scratch
@ -321,14 +320,14 @@
}
else
{
$setup_info = $GLOBALS['phpgw_setup']->detection->upgrade_exclude($setup_info);
$setup_info = $GLOBALS['egw_setup']->detection->upgrade_exclude($setup_info);
// Set the DB's client charset if a system-charset is set
if ($_REQUEST['system_charset'])
{
$GLOBALS['phpgw_setup']->db->Link_ID->SetCharSet($_REQUEST['system_charset']);
$GLOBALS['egw_setup']->db->Link_ID->SetCharSet($_REQUEST['system_charset']);
}
$setup_info = $GLOBALS['phpgw_setup']->process->pass($setup_info,'new',$_REQUEST['debug'],True,$_REQUEST['system_charset']);
$GLOBALS['phpgw_info']['setup']['currentver']['phpgwapi'] = 'oldversion';
$setup_info = $GLOBALS['egw_setup']->process->pass($setup_info,'new',$_REQUEST['debug'],True,$_REQUEST['system_charset']);
$GLOBALS['egw_info']['setup']['currentver']['phpgwapi'] = 'oldversion';
}
break;
case 'oldversion':
@ -352,13 +351,13 @@
}
if (!@$_POST['backup'] || !is_string($f))
{
$setup_info = $GLOBALS['phpgw_setup']->process->pass($setup_info,'upgrade',$_REQUEST['debug']);
$GLOBALS['phpgw_info']['setup']['currentver']['phpgwapi'] = 'oldversion';
$setup_info = $GLOBALS['egw_setup']->process->pass($setup_info,'upgrade',$_REQUEST['debug']);
$GLOBALS['egw_info']['setup']['currentver']['phpgwapi'] = 'oldversion';
}
break;
}
$GLOBALS['phpgw_setup']->db->Halt_On_Error = 'no';
$GLOBALS['egw_setup']->db->Halt_On_Error = 'no';
$setup_tpl->set_var('re-check_my_installation',lang('Re-Check My Installation'));
$setup_tpl->parse('V_db_stage_6_post','B_db_stage_6_post');
@ -397,7 +396,7 @@ function check_dir($dir,&$msg,$check_in_docroot=false)
}
if ($check_in_docroot)
{
$docroots = array(PHPGW_SERVER_ROOT,$_SERVER['DOCUMENT_ROOT']);
$docroots = array(EGW_SERVER_ROOT,$_SERVER['DOCUMENT_ROOT']);
$dir = realpath($dir);
foreach ($docroots as $docroot)
@ -421,18 +420,18 @@ function check_dir($dir,&$msg,$check_in_docroot=false)
// Config Section
$setup_tpl->set_var('config_step_text',lang('Step %1 - Configuration',2));
$GLOBALS['phpgw_info']['setup']['stage']['config'] = $GLOBALS['phpgw_setup']->detection->check_config();
$GLOBALS['egw_info']['setup']['stage']['config'] = $GLOBALS['egw_setup']->detection->check_config();
// begin DEBUG code
//$GLOBALS['phpgw_info']['setup']['stage']['config'] = 10;
//$GLOBALS['egw_info']['setup']['stage']['config'] = 10;
// end DEBUG code
$setup_tpl->set_var('config_status_img',$incomplete);
$setup_tpl->set_var('config_status_alt',lang('not completed'));
switch($GLOBALS['phpgw_info']['setup']['stage']['config'])
switch($GLOBALS['egw_info']['setup']['stage']['config'])
{
case 1:
$btn_config_now = $GLOBALS['phpgw_setup']->html->make_frm_btn_simple(
$btn_config_now = $GLOBALS['egw_setup']->html->make_frm_btn_simple(
lang('Please configure eGroupWare for your environment'),
'POST','config.php',
'submit',lang('Configure Now'),
@ -441,10 +440,10 @@ function check_dir($dir,&$msg,$check_in_docroot=false)
$setup_tpl->set_var('ldap_table_data','&nbsp;');
break;
case 10:
$GLOBALS['phpgw_setup']->db->query("SELECT config_name,config_value FROM phpgw_config WHERE config_app='phpgwapi'");
while($GLOBALS['phpgw_setup']->db->next_record())
$GLOBALS['egw_setup']->db->query("SELECT config_name,config_value FROM phpgw_config WHERE config_app='phpgwapi'");
while($GLOBALS['egw_setup']->db->next_record())
{
$config[$GLOBALS['phpgw_setup']->db->f(0)] = $GLOBALS['phpgw_setup']->db->f(1);
$config[$GLOBALS['egw_setup']->db->f(0)] = $GLOBALS['egw_setup']->db->f(1);
}
// set and create the default backup_dir
if (@is_writeable($config['files_dir']) && !isset($config['backup_dir']) && $config['file_store_contents'] == 'filesystem')
@ -452,7 +451,7 @@ function check_dir($dir,&$msg,$check_in_docroot=false)
$config['backup_dir'] = $config['files_dir'].'/db_backup';
if (!is_dir($config['backup_dir']) && mkdir($config['backup_dir']))
{
$GLOBALS['phpgw_setup']->db->query("INSERT INTO phpgw_config (config_app,config_name,config_value) VALUES ('phpgwapi','backup_dir',".$GLOBALS['phpgw_setup']->db->quote($config['backup_dir']).')',__LINE__,__FILE__);
$GLOBALS['egw_setup']->db->query("INSERT INTO phpgw_config (config_app,config_name,config_value) VALUES ('phpgwapi','backup_dir',".$GLOBALS['egw_setup']->db->quote($config['backup_dir']).')',__LINE__,__FILE__);
}
}
$config_msg = '';
@ -474,7 +473,7 @@ function check_dir($dir,&$msg,$check_in_docroot=false)
$setup_tpl->set_var('config_status_alt',lang('completed'));
$config_msg = lang('Configuration completed');
}
$btn_edit_config = $GLOBALS['phpgw_setup']->html->make_frm_btn_simple(
$btn_edit_config = $GLOBALS['egw_setup']->html->make_frm_btn_simple(
$config_msg,
'POST','config.php',
'submit',lang('Edit Current Configuration'),
@ -484,7 +483,7 @@ function check_dir($dir,&$msg,$check_in_docroot=false)
{
if ($config['ldap_host'] != '')
{
$btn_config_ldap = $GLOBALS['phpgw_setup']->html->make_frm_btn_simple(
$btn_config_ldap = $GLOBALS['egw_setup']->html->make_frm_btn_simple(
lang('LDAP account import/export'),
'POST','ldap.php',
'submit',lang('Configure Now'),
@ -509,16 +508,16 @@ function check_dir($dir,&$msg,$check_in_docroot=false)
// Admin Account Section
$setup_tpl->set_var('admin_step_text',lang('Step %1 - Admin Account',3));
switch($GLOBALS['phpgw_info']['setup']['stage']['config'])
switch($GLOBALS['egw_info']['setup']['stage']['config'])
{
case 10:
// check if there is already a user account (not the anonymous account of sitemgr or a group)
// Note: this does not check the availiblitly of accounts via other auth-methods then sql !!!
$GLOBALS['phpgw_setup']->db->query("SELECT count(*) FROM phpgw_accounts WHERE account_type='u' AND account_lid!='anonymous'",__LINE__,__FILE__);
$no_accounts = !$GLOBALS['phpgw_setup']->db->next_record() || !$GLOBALS['phpgw_setup']->db->f(0);
$GLOBALS['egw_setup']->db->query("SELECT count(*) FROM phpgw_accounts WHERE account_type='u' AND account_lid!='anonymous'",__LINE__,__FILE__);
$no_accounts = !$GLOBALS['egw_setup']->db->next_record() || !$GLOBALS['egw_setup']->db->f(0);
$setup_tpl->set_var('admin_status_img',$no_accounts ? $incomplete : $completed);
$setup_tpl->set_var('admin_status_alt',$no_accounts ? lang('not completed') : lang('completed'));
$setup_tpl->set_var('admin_table_data',$GLOBALS['phpgw_setup']->html->make_frm_btn_simple(
$setup_tpl->set_var('admin_table_data',$GLOBALS['egw_setup']->html->make_frm_btn_simple(
$no_accounts ? lang('No accounts existing') : lang('Accounts existing'),
'POST','setup_demo.php',
'submit',lang('Create admin account'),
@ -534,18 +533,18 @@ function check_dir($dir,&$msg,$check_in_docroot=false)
// Lang Section
$setup_tpl->set_var('lang_step_text',lang('Step %1 - Language Management',4));
$GLOBALS['phpgw_info']['setup']['stage']['lang'] = $GLOBALS['phpgw_setup']->detection->check_lang();
$GLOBALS['egw_info']['setup']['stage']['lang'] = $GLOBALS['egw_setup']->detection->check_lang();
// begin DEBUG code
//$GLOBALS['phpgw_info']['setup']['stage']['lang'] = 0;
//$GLOBALS['egw_info']['setup']['stage']['lang'] = 0;
// end DEBUG code
switch($GLOBALS['phpgw_info']['setup']['stage']['lang'])
switch($GLOBALS['egw_info']['setup']['stage']['lang'])
{
case 1:
$setup_tpl->set_var('lang_status_img',$incomplete);
$setup_tpl->set_var('lang_status_alt','not completed');
$btn_install_lang = $GLOBALS['phpgw_setup']->html->make_frm_btn_simple(
$btn_install_lang = $GLOBALS['egw_setup']->html->make_frm_btn_simple(
lang('You do not have any languages installed. Please install one now <br>'),
'POST','lang.php',
'submit',lang('Install Language'),
@ -555,19 +554,19 @@ function check_dir($dir,&$msg,$check_in_docroot=false)
case 10:
$langs_list = array();
$languages = get_langs();
foreach ($GLOBALS['phpgw_info']['setup']['installed_langs'] as $key => $value)
foreach ($GLOBALS['egw_info']['setup']['installed_langs'] as $key => $value)
{
$langs_list[] = isset($languages[$key]) ? $languages[$key]['descr'] : $value;
}
$setup_tpl->set_var('lang_status_img',$completed);
$setup_tpl->set_var('lang_status_alt','completed');
$btn_manage_lang = $GLOBALS['phpgw_setup']->html->make_frm_btn_simple(
$btn_manage_lang = $GLOBALS['egw_setup']->html->make_frm_btn_simple(
lang('This stage is completed<br>') . lang('Currently installed languages: %1 <br>',implode(', ',$langs_list)),
'POST','lang.php',
'submit',lang('Manage Languages'),
'');
// show system-charset and offer conversation
include_once(PHPGW_API_INC.'/class.translation_sql.inc.php');
include_once(EGW_API_INC.'/class.translation_sql.inc.php');
$translation = new translation;
$btn_manage_lang .= lang('Current system-charset is %1, click %2here%3 to change it.',
$translation->system_charset ? "'$translation->system_charset'" : lang('not set'),
@ -582,8 +581,8 @@ function check_dir($dir,&$msg,$check_in_docroot=false)
}
$setup_tpl->set_var('apps_step_text',lang('Step %1 - Advanced Application Management',5));
// $GLOBALS['phpgw_info']['setup']['stage']['apps'] = $GLOBALS['phpgw_setup']->check_apps();
switch($GLOBALS['phpgw_info']['setup']['stage']['db'])
// $GLOBALS['egw_info']['setup']['stage']['apps'] = $GLOBALS['egw_setup']->check_apps();
switch($GLOBALS['egw_info']['setup']['stage']['db'])
{
case 10:
$setup_tpl->set_var('apps_status_img',$completed);
@ -597,7 +596,7 @@ function check_dir($dir,&$msg,$check_in_docroot=false)
$to_upgrade[] = $app;
}
}
$btn_manage_apps = $GLOBALS['phpgw_setup']->html->make_frm_btn_simple(
$btn_manage_apps = $GLOBALS['egw_setup']->html->make_frm_btn_simple(
count($to_upgrade) ? '<b>'.lang('The following applications need to be upgraded:').'</b> '.implode(', ',$to_upgrade) :
lang('This stage is completed<br>'),
'','applications.php',
@ -613,12 +612,12 @@ function check_dir($dir,&$msg,$check_in_docroot=false)
}
// Backup and restore section
$setup_tpl->set_var('backup_step_text',lang('Step %1 - DB backup and restore',6));
switch($GLOBALS['phpgw_info']['setup']['stage']['db'])
switch($GLOBALS['egw_info']['setup']['stage']['db'])
{
case 10:
$setup_tpl->set_var('backup_status_img',$completed);
$setup_tpl->set_var('backup_status_alt',lang('completed'));
$setup_tpl->set_var('backup_table_data',$GLOBALS['phpgw_setup']->html->make_frm_btn_simple(
$setup_tpl->set_var('backup_table_data',$GLOBALS['egw_setup']->html->make_frm_btn_simple(
''/*lang('This stage is completed<br>')*/,
'','db_backup.php',
'submit',lang('backup and restore'),
@ -632,5 +631,5 @@ function check_dir($dir,&$msg,$check_in_docroot=false)
}
$setup_tpl->pparse('out','T_setup_main');
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_footer();
?>

View File

@ -11,37 +11,37 @@
/* $Id$ */
$phpgw_info = array();
$GLOBALS['phpgw_info']['flags'] = array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
);
$GLOBALS['egw_info'] = array(
'flags' => array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
));
include('./inc/functions.inc.php');
// Authorize the user to use setup app and load the database
// Does not return unless user is authorized
if (!$GLOBALS['phpgw_setup']->auth('Config') || @$_POST['cancel'])
if (!$GLOBALS['egw_setup']->auth('Config') || @$_POST['cancel'])
{
Header('Location: index.php');
exit;
}
$GLOBALS['phpgw_setup']->loaddb();
$GLOBALS['egw_setup']->loaddb();
if (@$_POST['submit'])
{
$GLOBALS['phpgw_setup']->translation->setup_translation_sql();
$GLOBALS['phpgw_setup']->translation->sql->install_langs(@$_POST['lang_selected'],@$_POST['upgrademethod']);
$GLOBALS['egw_setup']->translation->setup_translation_sql();
$GLOBALS['egw_setup']->translation->sql->install_langs(@$_POST['lang_selected'],@$_POST['upgrademethod']);
if( !$GLOBALS['phpgw_setup']->translation->sql->line_rejected )
if( !$GLOBALS['egw_setup']->translation->sql->line_rejected )
{
Header('Location: index.php');
exit;
}
}
$tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
$tpl_root = $GLOBALS['egw_setup']->html->setup_tpl_dir('setup');
$setup_tpl = CreateObject('phpgwapi.Template',$tpl_root);
$setup_tpl->set_file(array(
'T_head' => 'head.tpl',
@ -59,9 +59,9 @@
$td_align = @$newinstall ? ' align="center"' : '';
$hidden_var1 = @$newinstall ? '<input type="hidden" name="newinstall" value="True">' : '';
if (!@$newinstall && !isset($GLOBALS['phpgw_info']['setup']['installed_langs']))
if (!@$newinstall && !isset($GLOBALS['egw_info']['setup']['installed_langs']))
{
$GLOBALS['phpgw_setup']->detection->check_lang(false); // get installed langs
$GLOBALS['egw_setup']->detection->check_lang(false); // get installed langs
}
$select_box_desc = lang('Select which languages you would like to use');
$select_box = '';
@ -72,7 +72,7 @@
$select_box_langs =
@$select_box_langs
.'<option value="' . $id . '"'
.(@$GLOBALS['phpgw_info']['setup']['installed_langs'][$id]?' SELECTED="1"':'').'>'
.(@$GLOBALS['egw_info']['setup']['installed_langs'][$id]?' SELECTED="1"':'').'>'
. $data['descr'] . '</option>'
."\n";
}
@ -97,10 +97,10 @@
}
// Rejected Lines
if($_POST['debug'] && count($GLOBALS['phpgw_setup']->translation->sql->line_rejected))
if($_POST['debug'] && count($GLOBALS['egw_setup']->translation->sql->line_rejected))
{
$str = '';
foreach($GLOBALS['phpgw_setup']->translation->sql->line_rejected as $badline)
foreach($GLOBALS['egw_setup']->translation->sql->line_rejected as $badline)
{
$_f_buffer = split("[/\\]", $badline['appfile']);
$str .= lang('Application: %1, File: %2, Line: "%3"','<b>'.$_f_buffer[count($_f_buffer)-3].'</b>',
@ -123,11 +123,11 @@
$setup_tpl->set_var('lang_install',lang('install'));
$setup_tpl->set_var('lang_cancel',lang('cancel'));
$GLOBALS['phpgw_setup']->html->show_header("$stage_title",False,'config',$GLOBALS['phpgw_setup']->ConfigDomain . '(' . $phpgw_domain[$GLOBALS['phpgw_setup']->ConfigDomain]['db_type'] . ')');
$GLOBALS['egw_setup']->html->show_header("$stage_title",False,'config',$GLOBALS['egw_setup']->ConfigDomain . '(' . $GLOBALS['egw_domain'][$GLOBALS['egw_setup']->ConfigDomain]['db_type'] . ')');
$setup_tpl->pparse('out','T_lang_main');
if($alert)
$setup_tpl->pparse('out','T_alert_msg');
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_footer();
?>

View File

@ -11,17 +11,17 @@
/* $Id$ */
$GLOBALS['phpgw_info'] = array();
$GLOBALS['phpgw_info']['flags'] = array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
);
$GLOBALS['egw_info'] = array(
'flags' => array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
));
include('./inc/functions.inc.php');
// Authorize the user to use setup app and load the database
if (!$GLOBALS['phpgw_setup']->auth('Config'))
if (!$GLOBALS['egw_setup']->auth('Config'))
{
Header('Location: index.php');
exit;
@ -34,7 +34,7 @@
exit;
}
$tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
$tpl_root = $GLOBALS['egw_setup']->html->setup_tpl_dir('setup');
$setup_tpl = CreateObject('setup.Template',$tpl_root);
$setup_tpl->set_file(array(
'ldap' => 'ldap.tpl',
@ -43,12 +43,12 @@
'T_alert_msg' => 'msg_alert_msg.tpl'
));
$GLOBALS['phpgw_setup']->html->show_header(lang('LDAP Config'),False,'config',$GLOBALS['phpgw_setup']->ConfigDomain . '(' . $phpgw_domain[$GLOBALS['phpgw_setup']->ConfigDomain]['db_type'] . ')');
$GLOBALS['egw_setup']->html->show_header(lang('LDAP Config'),False,'config',$GLOBALS['egw_setup']->ConfigDomain . '(' . $GLOBALS['egw_domain'][$GLOBALS['egw_setup']->ConfigDomain]['db_type'] . ')');
if ($GLOBALS['error'])
{
//echo '<br><center><b>Error:</b> '.$error.'</center>';
$GLOBALS['phpgw_setup']->html->show_alert_msg('Error',$GLOBALS['error']);
$GLOBALS['egw_setup']->html->show_alert_msg('Error',$GLOBALS['error']);
}
$setup_tpl->set_block('ldap','header','header');
@ -73,5 +73,5 @@
$setup_tpl->pfp('out','cancel_only');
$setup_tpl->pfp('out','footer');
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_footer();
?>

View File

@ -11,17 +11,17 @@
/* $Id$ */
$phpgw_info = array();
$phpgw_info['flags'] = array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
);
$GLOBALS['egw_info'] = array(
'flags' => array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
));
include('./inc/functions.inc.php');
// Authorize the user to use setup app and load the database
if (!$GLOBALS['phpgw_setup']->auth('Config'))
if (!$GLOBALS['egw_setup']->auth('Config'))
{
Header('Location: index.php');
exit;
@ -39,10 +39,10 @@
$phpgw->common = CreateObject('phpgwapi.common');
$common = $phpgw->common;
$GLOBALS['phpgw_setup']->loaddb();
copyobj($GLOBALS['phpgw_setup']->db,$phpgw->db);
$GLOBALS['egw_setup']->loaddb();
copyobj($GLOBALS['egw_setup']->db,$phpgw->db);
$tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
$tpl_root = $GLOBALS['egw_setup']->html->setup_tpl_dir('setup');
$setup_tpl = CreateObject('setup.Template',$tpl_root);
$setup_tpl->set_file(array(
'ldap' => 'ldap.tpl',
@ -51,10 +51,10 @@
'T_alert_msg' => 'msg_alert_msg.tpl'
));
$GLOBALS['phpgw_setup']->db->query("SELECT config_name,config_value FROM phpgw_config WHERE config_name LIKE 'ldap%'",__LINE__,__FILE__);
while ($GLOBALS['phpgw_setup']->db->next_record())
$GLOBALS['egw_setup']->db->query("SELECT config_name,config_value FROM phpgw_config WHERE config_name LIKE 'ldap%'",__LINE__,__FILE__);
while ($GLOBALS['egw_setup']->db->next_record())
{
$config[$GLOBALS['phpgw_setup']->db->f('config_name')] = $GLOBALS['phpgw_setup']->db->f('config_value');
$config[$GLOBALS['egw_setup']->db->f('config_name')] = $GLOBALS['egw_setup']->db->f('config_value');
}
$phpgw_info['server']['ldap_host'] = $config['ldap_host'];
$phpgw_info['server']['ldap_context'] = $config['ldap_context'];
@ -87,16 +87,16 @@
}
$sql = "SELECT * FROM phpgw_accounts WHERE account_type='u'";
$GLOBALS['phpgw_setup']->db->query($sql,__LINE__,__FILE__);
while($GLOBALS['phpgw_setup']->db->next_record())
$GLOBALS['egw_setup']->db->query($sql,__LINE__,__FILE__);
while($GLOBALS['egw_setup']->db->next_record())
{
$i = $GLOBALS['phpgw_setup']->db->f('account_id');
$account_info[$i]['account_id'] = $GLOBALS['phpgw_setup']->db->f('account_id');
$account_info[$i]['account_lid'] = $GLOBALS['phpgw_setup']->db->f('account_lid');
$account_info[$i]['account_firstname'] = $GLOBALS['phpgw_setup']->db->f('account_firstname');
$account_info[$i]['account_lastname'] = $GLOBALS['phpgw_setup']->db->f('account_lastname');
$account_info[$i]['account_status'] = $GLOBALS['phpgw_setup']->db->f('account_status');
$account_info[$i]['account_expires'] = $GLOBALS['phpgw_setup']->db->f('account_expires');
$i = $GLOBALS['egw_setup']->db->f('account_id');
$account_info[$i]['account_id'] = $GLOBALS['egw_setup']->db->f('account_id');
$account_info[$i]['account_lid'] = $GLOBALS['egw_setup']->db->f('account_lid');
$account_info[$i]['account_firstname'] = $GLOBALS['egw_setup']->db->f('account_firstname');
$account_info[$i]['account_lastname'] = $GLOBALS['egw_setup']->db->f('account_lastname');
$account_info[$i]['account_status'] = $GLOBALS['egw_setup']->db->f('account_status');
$account_info[$i]['account_expires'] = $GLOBALS['egw_setup']->db->f('account_expires');
}
while(list($key,$data) = @each($account_info))
@ -107,16 +107,16 @@
$account_info = $newaccount;
$sql = "SELECT * FROM phpgw_accounts WHERE account_type='g'";
$GLOBALS['phpgw_setup']->db->query($sql,__LINE__,__FILE__);
while($GLOBALS['phpgw_setup']->db->next_record())
$GLOBALS['egw_setup']->db->query($sql,__LINE__,__FILE__);
while($GLOBALS['egw_setup']->db->next_record())
{
$i = $GLOBALS['phpgw_setup']->db->f('account_id');
$group_info[$i]['account_id'] = $GLOBALS['phpgw_setup']->db->f('account_id');
$group_info[$i]['account_lid'] = $GLOBALS['phpgw_setup']->db->f('account_lid');
$group_info[$i]['account_firstname'] = $GLOBALS['phpgw_setup']->db->f('account_firstname');
$group_info[$i]['account_lastname'] = $GLOBALS['phpgw_setup']->db->f('account_lastname');
$group_info[$i]['account_status'] = $GLOBALS['phpgw_setup']->db->f('account_status');
$group_info[$i]['account_expires'] = $GLOBALS['phpgw_setup']->db->f('account_expires');
$i = $GLOBALS['egw_setup']->db->f('account_id');
$group_info[$i]['account_id'] = $GLOBALS['egw_setup']->db->f('account_id');
$group_info[$i]['account_lid'] = $GLOBALS['egw_setup']->db->f('account_lid');
$group_info[$i]['account_firstname'] = $GLOBALS['egw_setup']->db->f('account_firstname');
$group_info[$i]['account_lastname'] = $GLOBALS['egw_setup']->db->f('account_lastname');
$group_info[$i]['account_status'] = $GLOBALS['egw_setup']->db->f('account_status');
$group_info[$i]['account_expires'] = $GLOBALS['egw_setup']->db->f('account_expires');
}
while(list($key,$data) = @each($group_info))
@ -156,7 +156,7 @@
if(!empty($thisacctid) && !empty($thisacctlid))
{
$groups = CreateObject('phpgwapi.accounts',(int)$thisacctid);
copyobj($GLOBALS['phpgw_setup']->db,$groups->db);
copyobj($GLOBALS['egw_setup']->db,$groups->db);
// Check if the account is already there.
// If so, we won't try to create it again.
@ -204,7 +204,7 @@
if(!empty($thisacctid) && !empty($thisacctlid))
{
$accounts = CreateObject('phpgwapi.accounts',(int)$thisacctid);
copyobj($GLOBALS['phpgw_setup']->db,$accounts->db);
copyobj($GLOBALS['egw_setup']->db,$accounts->db);
// Check if the account is already there.
// If so, we won't try to create it again.
@ -238,19 +238,19 @@
$setup_complete = True;
}
$GLOBALS['phpgw_setup']->html->show_header(lang('LDAP Export'),False,'config',$GLOBALS['phpgw_setup']->ConfigDomain . '(' . $phpgw_domain[$GLOBALS['phpgw_setup']->ConfigDomain]['db_type'] . ')');
$GLOBALS['egw_setup']->html->show_header(lang('LDAP Export'),False,'config',$GLOBALS['egw_setup']->ConfigDomain . '(' . $GLOBALS['egw_domain'][$GLOBALS['egw_setup']->ConfigDomain]['db_type'] . ')');
if($error)
{
//echo '<br><center><b>Error:</b> '.$error.'</center>';
$GLOBALS['phpgw_setup']->html->show_alert_msg('Error',$error);
$GLOBALS['egw_setup']->html->show_alert_msg('Error',$error);
}
if($setup_complete)
{
echo '<br><center>'.lang('Export has been completed! You will need to set the user passwords manually.').'</center>';
echo '<br><center>'.lang('Click <a href="index.php">here</a> to return to setup.').'</center>';
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_footer();
exit;
}
@ -309,5 +309,5 @@
$setup_tpl->pfp('out','submit');
$setup_tpl->pfp('out','footer');
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_footer();
?>

View File

@ -11,17 +11,17 @@
/* $Id$ */
$phpgw_info = array();
$phpgw_info["flags"] = array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
);
$GLOBALS['egw_info'] = array(
'flags' => array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
));
include('./inc/functions.inc.php');
// Authorize the user to use setup app and load the database
if(!$GLOBALS['phpgw_setup']->auth('Config'))
if(!$GLOBALS['egw_setup']->auth('Config'))
{
Header('Location: index.php');
exit;
@ -39,10 +39,10 @@
$phpgw->common = CreateObject('phpgwapi.common');
$common = $phpgw->common;
$GLOBALS['phpgw_setup']->loaddb();
$phpgw->db = $GLOBALS['phpgw_setup']->db;
$GLOBALS['egw_setup']->loaddb();
$phpgw->db = $GLOBALS['egw_setup']->db;
$tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
$tpl_root = $GLOBALS['egw_setup']->html->setup_tpl_dir('setup');
$setup_tpl = CreateObject('setup.Template',$tpl_root);
$setup_tpl->set_file(array(
'ldap' => 'ldap.tpl',
@ -56,10 +56,10 @@
$phpgw->applications = CreateObject('phpgwapi.applications');
$applications = $phpgw->applications;
$GLOBALS['phpgw_setup']->db->query("SELECT config_name,config_value FROM phpgw_config WHERE config_name LIKE 'ldap%' OR config_name='account_repository'",__LINE__,__FILE__);
while($GLOBALS['phpgw_setup']->db->next_record())
$GLOBALS['egw_setup']->db->query("SELECT config_name,config_value FROM phpgw_config WHERE config_name LIKE 'ldap%' OR config_name='account_repository'",__LINE__,__FILE__);
while($GLOBALS['egw_setup']->db->next_record())
{
$config[$GLOBALS['phpgw_setup']->db->f('config_name')] = $GLOBALS['phpgw_setup']->db->f('config_value');
$config[$GLOBALS['egw_setup']->db->f('config_name')] = $GLOBALS['egw_setup']->db->f('config_value');
}
$phpgw_info['server']['ldap_host'] = $config['ldap_host'];
$phpgw_info['server']['ldap_context'] = $config['ldap_context'];
@ -128,10 +128,10 @@
$group_info = array();
}
$GLOBALS['phpgw_setup']->db->query("SELECT app_name FROM phpgw_applications WHERE app_enabled!='0' AND app_enabled!='3' ORDER BY app_name",__LINE__,__FILE__);
while($GLOBALS['phpgw_setup']->db->next_record())
$GLOBALS['egw_setup']->db->query("SELECT app_name FROM phpgw_applications WHERE app_enabled!='0' AND app_enabled!='3' ORDER BY app_name",__LINE__,__FILE__);
while($GLOBALS['egw_setup']->db->next_record())
{
$apps[$GLOBALS['phpgw_setup']->db->f('app_name')] = lang($GLOBALS['phpgw_setup']->db->f('app_name'));
$apps[$GLOBALS['egw_setup']->db->f('app_name')] = lang($GLOBALS['egw_setup']->db->f('app_name'));
}
$cancel = get_var('cancel','POST');
@ -176,7 +176,7 @@
if(!empty($thisacctid) && !empty($thisacctlid))
{
$accounts = CreateObject('phpgwapi.accounts',(int)$thisacctid);
copyobj($GLOBALS['phpgw_setup']->db,$accounts->db);
copyobj($GLOBALS['egw_setup']->db,$accounts->db);
// Check if the account is already there.
// If so, we won't try to create it again.
@ -210,7 +210,7 @@
// these rights. Instead, we make the user a member of the Default group
// below.
$acl = CreateObject('phpgwapi.acl',(int)$thisacctid);
$acl->db = $GLOBALS['phpgw_setup']->db;
$acl->db = $GLOBALS['egw_setup']->db;
$acl->read_repository();
// Only give them admin if we asked for them to have it.
@ -258,7 +258,7 @@
if(!empty($thisacctid) && !empty($thisacctlid))
{
$groups = CreateObject('phpgwapi.accounts',(int)$thisacctid);
copyobj($GLOBALS['phpgw_setup']->db,$groups->db);
copyobj($GLOBALS['egw_setup']->db,$groups->db);
// Check if the account is already there.
// If so, we won't try to create it again.
@ -313,7 +313,7 @@
if($tmpid)
{
$acl = CreateObject('phpgwapi.acl',$tmpid);
copyobj($GLOBALS['phpgw_setup']->db,$acl->db);
copyobj($GLOBALS['egw_setup']->db,$acl->db);
$acl->account_id = (int)$tmpid;
$acl->read_repository();
@ -330,7 +330,7 @@
App access is added below.
*/
$pref = CreateObject('phpgwapi.preferences',$tmpid);
$pref->db = $GLOBALS['phpgw_setup']->db;
$pref->db = $GLOBALS['egw_setup']->db;
$pref->account_id = (int)$tmpid;
$pref->read_repository();
@reset($s_apps);
@ -344,7 +344,7 @@
/* Now give this group some rights */
$phpgw_info['user']['account_id'] = $thisacctid;
$acl = CreateObject('phpgwapi.acl');
copyobj($GLOBALS['phpgw_setup']->db,$acl->db);
copyobj($GLOBALS['egw_setup']->db,$acl->db);
$acl->account_id = (int)$thisacctid;
$acl->read_repository();
@reset($s_apps);
@ -362,7 +362,7 @@
{
/* Create the 'Default' group */
$groups = CreateObject('phpgwapi.accounts',$defaultgroupid);
copyobj($GLOBALS['phpgw_setup']->db,$groups->db);
copyobj($GLOBALS['egw_setup']->db,$groups->db);
// Check if the group account is already there.
// If so, set our group_id to that account's id for use below.
@ -391,7 +391,7 @@
$defaultgroupid = $acct->name2id('Default');
$acl = CreateObject('phpgwapi.acl',$defaultgroupid);
copyobj($GLOBALS['phpgw_setup']->db,$acl->db);
copyobj($GLOBALS['egw_setup']->db,$acl->db);
$acl->account_id = (int)$defaultgroupid;
$acl->read_repository();
@reset($s_apps);
@ -406,18 +406,18 @@
$setup_complete = True;
}
$GLOBALS['phpgw_setup']->html->show_header(lang('LDAP Import'),False,'config',$GLOBALS['phpgw_setup']->ConfigDomain . '(' . $phpgw_domain[$GLOBALS['phpgw_setup']->ConfigDomain]['db_type'] . ')');
$GLOBALS['egw_setup']->html->show_header(lang('LDAP Import'),False,'config',$GLOBALS['egw_setup']->ConfigDomain . '(' . $GLOBALS['egw_domain'][$GLOBALS['egw_setup']->ConfigDomain]['db_type'] . ')');
if($error)
{
//echo '<br><center><b>Error:</b> '.$error.'</center>';
$GLOBALS['phpgw_setup']->html->show_alert_msg('Error',$error);
$GLOBALS['egw_setup']->html->show_alert_msg('Error',$error);
}
if($setup_complete)
{
echo '<br><center>'.lang('Import has been completed!').' '.lang('Click <a href="index.php">here</a> to return to setup.').'</center>';
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_footer();
exit;
}
@ -494,5 +494,5 @@
$setup_tpl->pfp('out','submit');
$setup_tpl->pfp('out','footer');
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_footer();
?>

View File

@ -11,17 +11,17 @@
/* $Id$ */
$phpgw_info = array();
$phpgw_info["flags"] = array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
);
$GLOBALS['egw_info'] = array(
'flags' => array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
));
include('./inc/functions.inc.php');
/* Authorize the user to use setup app and load the database */
if(!$GLOBALS['phpgw_setup']->auth('Config'))
if(!$GLOBALS['egw_setup']->auth('Config'))
{
Header('Location: index.php');
exit;
@ -39,10 +39,10 @@
$phpgw->common = CreateObject('phpgwapi.common');
$common = $phpgw->common;
$GLOBALS['phpgw_setup']->loaddb();
copyobj($GLOBALS['phpgw_setup']->db,$phpgw->db);
$GLOBALS['egw_setup']->loaddb();
copyobj($GLOBALS['egw_setup']->db,$phpgw->db);
$tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
$tpl_root = $GLOBALS['egw_setup']->html->setup_tpl_dir('setup');
$setup_tpl = CreateObject('setup.Template',$tpl_root);
$setup_tpl->set_file(array(
'ldap' => 'ldap.tpl',
@ -51,10 +51,10 @@
'T_alert_msg' => 'msg_alert_msg.tpl'
));
$GLOBALS['phpgw_setup']->db->query("SELECT config_name,config_value FROM phpgw_config WHERE config_name LIKE 'ldap%' OR config_name='account_repository'",__LINE__,__FILE__);
while($GLOBALS['phpgw_setup']->db->next_record())
$GLOBALS['egw_setup']->db->query("SELECT config_name,config_value FROM phpgw_config WHERE config_name LIKE 'ldap%' OR config_name='account_repository'",__LINE__,__FILE__);
while($GLOBALS['egw_setup']->db->next_record())
{
$config[$GLOBALS['phpgw_setup']->db->f('config_name')] = $GLOBALS['phpgw_setup']->db->f('config_value');
$config[$GLOBALS['egw_setup']->db->f('config_name')] = $GLOBALS['egw_setup']->db->f('config_value');
}
$phpgw_info['server']['ldap_host'] = $config['ldap_host'];
$phpgw_info['server']['ldap_context'] = $config['ldap_context'];
@ -111,10 +111,10 @@
$group_info = array();
}
$GLOBALS['phpgw_setup']->db->query("SELECT app_name FROM phpgw_applications WHERE app_enabled!='0' AND app_enabled!='3' ORDER BY app_name",__LINE__,__FILE__);
while($GLOBALS['phpgw_setup']->db->next_record())
$GLOBALS['egw_setup']->db->query("SELECT app_name FROM phpgw_applications WHERE app_enabled!='0' AND app_enabled!='3' ORDER BY app_name",__LINE__,__FILE__);
while($GLOBALS['egw_setup']->db->next_record())
{
$apps[$GLOBALS['phpgw_setup']->db->f('app_name')] = lang($GLOBALS['phpgw_setup']->db->f('app_name'));
$apps[$GLOBALS['egw_setup']->db->f('app_name')] = lang($GLOBALS['egw_setup']->db->f('app_name'));
}
if($cancel)
@ -123,16 +123,16 @@
exit;
}
$GLOBALS['phpgw_setup']->html->show_header(lang('LDAP Modify'),False,'config',$GLOBALS['phpgw_setup']->ConfigDomain . '(' . $phpgw_domain[$GLOBALS['phpgw_setup']->ConfigDomain]['db_type'] . ')');
$GLOBALS['egw_setup']->html->show_header(lang('LDAP Modify'),False,'config',$GLOBALS['egw_setup']->ConfigDomain . '(' . $GLOBALS['egw_domain'][$GLOBALS['egw_setup']->ConfigDomain]['db_type'] . ')');
$setup_complete = False;
if(isset($_POST['submit']))
{
$acl = CreateObject('phpgwapi.acl');
copyobj($GLOBALS['phpgw_setup']->db,$acl->db);
copyobj($GLOBALS['egw_setup']->db,$acl->db);
if(isset($_POST['ldapgroups']))
{
$groups = CreateObject('phpgwapi.accounts');
copyobj($GLOBALS['phpgw_setup']->db,$groups->db);
copyobj($GLOBALS['egw_setup']->db,$groups->db);
while(list($key,$groupid) = each($_POST['ldapgroups']))
{
$id_exist = 0;
@ -248,7 +248,7 @@
if(isset($_POST['users']))
{
$accounts = CreateObject('phpgwapi.accounts');
copyobj($GLOBALS['phpgw_setup']->db,$accounts->db);
copyobj($GLOBALS['egw_setup']->db,$accounts->db);
while(list($key,$id) = each($_POST['users']))
{
$id_exist = 0;
@ -350,13 +350,13 @@
if(isset($_GET['error']))
{
/* echo '<br><center><b>Error:</b> '.$error.'</center>'; */
$GLOBALS['phpgw_setup']->html->show_alert_msg('Error',$_GET['error']);
$GLOBALS['egw_setup']->html->show_alert_msg('Error',$_GET['error']);
}
if($setup_complete)
{
echo '<br><center>'.lang('Modifications have been completed!').' '.lang('Click <a href="index.php">here</a> to return to setup.').'<br><center>';
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_footer();
exit;
}
@ -430,5 +430,5 @@
$setup_tpl->pfp('out','submit');
$setup_tpl->pfp('out','footer');
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_footer();
?>

View File

@ -11,14 +11,14 @@
/* $Id$ */
$phpgw_info = array();
$GLOBALS['phpgw_info']['flags'] = array(
'nocachecontrol' => True,
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
);
$GLOBALS['egw_info'] = array(
'flags' => array(
'nocachecontrol' => True,
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
));
include('./inc/functions.inc.php');
// some constanst for pre php4.3
@ -39,8 +39,8 @@
function_exists('dl') && @dl(PHP_SHLIB_PREFIX.$extension.'.'.PHP_SHLIB_SUFFIX);
}
$GLOBALS['phpgw_info']['server']['versions']['current_header'] = $setup_info['phpgwapi']['versions']['current_header'];
$GLOBALS['phpgw_info']['server']['versions']['phpgwapi'] = $setup_info['phpgwapi']['version'];
$GLOBALS['egw_info']['server']['versions']['current_header'] = $setup_info['phpgwapi']['versions']['current_header'];
$GLOBALS['egw_info']['server']['versions']['phpgwapi'] = $setup_info['phpgwapi']['version'];
unset($setup_info);
/* Fetch the current real path.
@ -121,7 +121,7 @@
if($errors)
{
$GLOBALS['phpgw_setup']->html->show_header('Error',True);
$GLOBALS['egw_setup']->html->show_header('Error',True);
echo $errors;
echo '<p><input type="submit" value="'.lang('Back to the previous screen').'" onClick="history.back()"></p>';
exit;
@ -129,10 +129,10 @@
}
/* authentication phase */
$GLOBALS['phpgw_info']['setup']['stage']['header'] = $GLOBALS['phpgw_setup']->detection->check_header();
$GLOBALS['egw_info']['setup']['stage']['header'] = $GLOBALS['egw_setup']->detection->check_header();
// added these to let the app work, need to templatize still
$tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
$tpl_root = $GLOBALS['egw_setup']->html->setup_tpl_dir('setup');
$setup_tpl = CreateObject('setup.Template',$tpl_root);
$setup_tpl->set_file(array(
'T_head' => 'head.tpl',
@ -148,50 +148,50 @@
$setup_tpl->set_block('T_setup_manage','domain','domain');
/* Detect current mode */
switch($GLOBALS['phpgw_info']['setup']['stage']['header'])
switch($GLOBALS['egw_info']['setup']['stage']['header'])
{
case '1':
$GLOBALS['phpgw_info']['setup']['HeaderFormMSG'] = lang('Create your header.inc.php');
$GLOBALS['phpgw_info']['setup']['PageMSG'] = lang('You have not created your header.inc.php yet!<br> You can create it now.');
$GLOBALS['egw_info']['setup']['HeaderFormMSG'] = lang('Create your header.inc.php');
$GLOBALS['egw_info']['setup']['PageMSG'] = lang('You have not created your header.inc.php yet!<br> You can create it now.');
break;
case '2':
$GLOBALS['phpgw_info']['setup']['HeaderFormMSG'] = 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!');
$GLOBALS['egw_info']['setup']['HeaderFormMSG'] = lang('Your header admin password is NOT set. Please set it now!');
$GLOBALS['egw_info']['setup']['PageMSG'] = lang('Your header admin password is NOT set. Please set it now!');
break;
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['egw_info']['setup']['HeaderFormMSG'] = lang('You need to add some domains to your header.inc.php.');
$GLOBALS['egw_info']['setup']['PageMSG'] = lang('You need to add some domains to your header.inc.php.');
$GLOBALS['egw_info']['setup']['HeaderLoginMSG'] = lang('You need to add some domains to your header.inc.php.');
if(!$GLOBALS['egw_setup']->auth('Header'))
{
$GLOBALS['phpgw_setup']->html->show_header('Please login',True);
$GLOBALS['phpgw_setup']->html->login_form();
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_header('Please login',True);
$GLOBALS['egw_setup']->html->login_form();
$GLOBALS['egw_setup']->html->show_footer();
exit;
}
break;
case '4':
$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']['HeaderLoginMSG'] = lang('Your header.inc.php needs upgrading.');
if(!$GLOBALS['phpgw_setup']->auth('Header'))
$GLOBALS['egw_info']['setup']['HeaderFormMSG'] = lang('Your header.inc.php needs upgrading.');
$GLOBALS['egw_info']['setup']['PageMSG'] = lang('Your header.inc.php needs upgrading.<br><blink><b class="msg">WARNING!</b></blink><br><b>MAKE BACKUPS!</b>');
$GLOBALS['egw_info']['setup']['HeaderLoginMSG'] = lang('Your header.inc.php needs upgrading.');
if(!$GLOBALS['egw_setup']->auth('Header'))
{
$GLOBALS['phpgw_setup']->html->show_header('Please login',True);
$GLOBALS['phpgw_setup']->html->login_form();
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_header('Please login',True);
$GLOBALS['egw_setup']->html->login_form();
$GLOBALS['egw_setup']->html->show_footer();
exit;
}
break;
case '10':
if(!$GLOBALS['phpgw_setup']->auth('Header'))
if(!$GLOBALS['egw_setup']->auth('Header'))
{
$GLOBALS['phpgw_setup']->html->show_header('Please login',True);
$GLOBALS['phpgw_setup']->html->login_form();
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_header('Please login',True);
$GLOBALS['egw_setup']->html->login_form();
$GLOBALS['egw_setup']->html->show_footer();
exit;
}
$GLOBALS['phpgw_info']['setup']['HeaderFormMSG'] = lang('Edit your header.inc.php');
$GLOBALS['phpgw_info']['setup']['PageMSG'] = lang('Edit your existing header.inc.php');
$GLOBALS['egw_info']['setup']['HeaderFormMSG'] = lang('Edit your header.inc.php');
$GLOBALS['egw_info']['setup']['PageMSG'] = lang('Edit your existing header.inc.php');
break;
}
@ -210,16 +210,16 @@
header('Pragma: no-cache');
header('Expires: 0');
*/
$newheader = $GLOBALS['phpgw_setup']->html->generate_header();
$newheader = $GLOBALS['egw_setup']->html->generate_header();
echo $newheader;
break;
case 'view':
check_form_values();
$header_template = CreateObject('setup.Template','../');
$GLOBALS['phpgw_setup']->html->show_header('Generated header.inc.php', False, 'header');
$GLOBALS['egw_setup']->html->show_header('Generated header.inc.php', False, 'header');
echo '<table width="90%"><tr><td>';
echo '<br>' . lang('Save this text as contents of your header.inc.php') . '<br><hr>';
$newheader = $GLOBALS['phpgw_setup']->html->generate_header();
$newheader = $GLOBALS['egw_setup']->html->generate_header();
echo '<pre>';
echo htmlentities($newheader);
echo '</pre><hr>';
@ -229,18 +229,18 @@
echo '<input type="submit" name="junk" value="'.lang('Continue').'">';
echo '</form>';
echo '</td></tr></table>';
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_footer();
break;
case 'write':
check_form_values();
$header_template = CreateObject('setup.Template','../');
if(is_writeable('../header.inc.php') || (!file_exists('../header.inc.php') && is_writeable('../')))
{
$newheader = $GLOBALS['phpgw_setup']->html->generate_header();
$newheader = $GLOBALS['egw_setup']->html->generate_header();
$fsetup = fopen('../header.inc.php','wb');
fwrite($fsetup,$newheader);
fclose($fsetup);
$GLOBALS['phpgw_setup']->html->show_header('Saved header.inc.php', False, 'header');
$GLOBALS['egw_setup']->html->show_header('Saved header.inc.php', False, 'header');
echo '<form action="index.php" method="post">';
echo '<br>' . lang('Created header.inc.php!');
echo '<input type="hidden" name="FormLogout" value="header">';
@ -251,14 +251,14 @@
}
else
{
$GLOBALS['phpgw_setup']->html->show_header('Error generating header.inc.php', False, 'header');
$GLOBALS['egw_setup']->html->show_header('Error generating header.inc.php', False, 'header');
echo lang('Could not open header.inc.php for writing!') . '<br>' . "\n";
echo lang('Please check read/write permissions on directories, or back up and use another option.') . '<br>';
echo '</td></tr></table></body></html>';
}
break;
default:
$GLOBALS['phpgw_setup']->html->show_header($GLOBALS['phpgw_info']['setup']['HeaderFormMSG'], False, 'header');
$GLOBALS['egw_setup']->html->show_header($GLOBALS['egw_info']['setup']['HeaderFormMSG'], False, 'header');
$detected = '';
@ -269,7 +269,7 @@
$detected .= '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "\n";
$detected .= '<tr><td colspan="2"><p>' . $GLOBALS['phpgw_info']['setup']['PageMSG'] . '<br />&nbsp;</p></td></tr>';
$detected .= '<tr><td colspan="2"><p>' . $GLOBALS['egw_info']['setup']['PageMSG'] . '<br />&nbsp;</p></td></tr>';
$detected .= '<tr class="th"><td colspan="2">' . lang('Analysis') . '</td></tr><tr><td colspan="2">'. "\n";
@ -374,13 +374,13 @@
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...') . '<br>' . "\n";
$GLOBALS['phpgw_info']['flags']['noapi'] = True;
$GLOBALS['egw_info']['flags']['noapi'] = True;
$no_guess = true;
/* This code makes sure the newer multi-domain supporting header.inc.php is being used */
if(!isset($GLOBALS['phpgw_domain']))
if(!isset($GLOBALS['egw_domain']))
{
$detected .= lang('You need to add some domains to your header.inc.php.') . '<br>' . "\n";
$GLOBALS['phpgw_domain']['default'] = array();
$GLOBALS['egw_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');
@ -402,49 +402,49 @@
}
else
{
if(@$GLOBALS['phpgw_info']['server']['header_version'] != @$GLOBALS['phpgw_info']['server']['current_header_version'])
if(@$GLOBALS['egw_info']['server']['header_version'] != @$GLOBALS['egw_info']['server']['current_header_version'])
{
$detected .= lang("You're using an old header.inc.php version...") . '<br>' . "\n";
$detected .= lang('Importing old settings into the new format....') . '<br>' . "\n";
}
reset($GLOBALS['phpgw_domain']);
$default_domain = each($GLOBALS['phpgw_domain']);
$GLOBALS['phpgw_info']['server']['default_domain'] = $default_domain[0];
reset($GLOBALS['egw_domain']);
$default_domain = each($GLOBALS['egw_domain']);
$GLOBALS['egw_info']['server']['default_domain'] = $default_domain[0];
unset($default_domain); // we kill this for security reasons
$GLOBALS['phpgw_info']['server']['config_passwd'] = $GLOBALS['phpgw_domain'][$GLOBALS['phpgw_info']['server']['default_domain']]['config_passwd'];
$GLOBALS['phpgw_info']['server']['config_user'] = $GLOBALS['phpgw_domain'][$GLOBALS['phpgw_info']['server']['default_domain']]['config_user'];
$GLOBALS['egw_info']['server']['config_passwd'] = $GLOBALS['egw_domain'][$GLOBALS['egw_info']['server']['default_domain']]['config_passwd'];
$GLOBALS['egw_info']['server']['config_user'] = $GLOBALS['egw_domain'][$GLOBALS['egw_info']['server']['default_domain']]['config_user'];
if(@$adddomain)
{
$GLOBALS['phpgw_domain'][lang('new')] = array();
$GLOBALS['egw_domain'][lang('new')] = array();
}
reset($GLOBALS['phpgw_domain']);
while(list($key,$val) = each($GLOBALS['phpgw_domain']))
reset($GLOBALS['egw_domain']);
while(list($key,$val) = each($GLOBALS['egw_domain']))
{
$setup_tpl->set_var('lang_domain',lang('Domain'));
$setup_tpl->set_var('lang_delete',lang('Delete'));
$setup_tpl->set_var('db_domain',$key);
$setup_tpl->set_var('db_host',$GLOBALS['phpgw_domain'][$key]['db_host']);
$setup_tpl->set_var('db_host',$GLOBALS['egw_domain'][$key]['db_host']);
/* Set default here if the admin didn't set a port yet */
$setup_tpl->set_var('db_port',$GLOBALS['phpgw_domain'][$key]['db_port']
? $GLOBALS['phpgw_domain'][$key]['db_port']
: @$default_db_ports[$GLOBALS['phpgw_domain'][$key]['db_type']]
$setup_tpl->set_var('db_port',$GLOBALS['egw_domain'][$key]['db_port']
? $GLOBALS['egw_domain'][$key]['db_port']
: @$default_db_ports[$GLOBALS['egw_domain'][$key]['db_type']]
);
$setup_tpl->set_var('db_name',$GLOBALS['phpgw_domain'][$key]['db_name']);
$setup_tpl->set_var('db_user',$GLOBALS['phpgw_domain'][$key]['db_user']);
$setup_tpl->set_var('db_pass',$GLOBALS['phpgw_domain'][$key]['db_pass']);
$setup_tpl->set_var('db_type',$GLOBALS['phpgw_domain'][$key]['db_type']);
if(!@isset($GLOBALS['phpgw_domain'][$key]['config_user']))
$setup_tpl->set_var('db_name',$GLOBALS['egw_domain'][$key]['db_name']);
$setup_tpl->set_var('db_user',$GLOBALS['egw_domain'][$key]['db_user']);
$setup_tpl->set_var('db_pass',$GLOBALS['egw_domain'][$key]['db_pass']);
$setup_tpl->set_var('db_type',$GLOBALS['egw_domain'][$key]['db_type']);
if(!@isset($GLOBALS['egw_domain'][$key]['config_user']))
{
$setup_tpl->set_var('config_user','admin');
}
else
{
$setup_tpl->set_var('config_user',$GLOBALS['phpgw_domain'][$key]['config_user']);
$setup_tpl->set_var('config_user',$GLOBALS['egw_domain'][$key]['config_user']);
}
$setup_tpl->set_var('config_pass','');
$setup_tpl->set_var('config_password',$GLOBALS['phpgw_domain'][$key]['config_passwd']);
$setup_tpl->set_var('config_password',$GLOBALS['egw_domain'][$key]['config_passwd']);
$selected = '';
$dbtype_options = '';
@ -452,7 +452,7 @@
@reset($supported_db);
while(list($k,$v) = @each($supported_db))
{
if($v == $GLOBALS['phpgw_domain'][$key]['db_type'])
if($v == $GLOBALS['egw_domain'][$key]['db_type'])
{
$selected = ' selected ';
$found_dbtype = true;
@ -471,25 +471,25 @@
}
if(defined('PHPGW_SERVER_ROOT'))
{
$GLOBALS['phpgw_info']['server']['server_root'] = (PHPGW_SERVER_ROOT == '..') ? $realpath : PHPGW_SERVER_ROOT;
$GLOBALS['phpgw_info']['server']['include_root'] = (PHPGW_INCLUDE_ROOT == '..') ? $realpath : PHPGW_SERVER_ROOT;
$GLOBALS['egw_info']['server']['server_root'] = (PHPGW_SERVER_ROOT == '..') ? $realpath : PHPGW_SERVER_ROOT;
$GLOBALS['egw_info']['server']['include_root'] = (PHPGW_INCLUDE_ROOT == '..') ? $realpath : PHPGW_SERVER_ROOT;
}
elseif(!@isset($GLOBALS['phpgw_info']['server']['include_root']) && @$GLOBALS['phpgw_info']['server']['header_version'] <= 1.6)
elseif(!@isset($GLOBALS['egw_info']['server']['include_root']) && @$GLOBALS['egw_info']['server']['header_version'] <= 1.6)
{
$GLOBALS['phpgw_info']['server']['include_root'] = @$GLOBALS['phpgw_info']['server']['server_root'];
$GLOBALS['egw_info']['server']['include_root'] = @$GLOBALS['egw_info']['server']['server_root'];
}
elseif(!@isset($GLOBALS['phpgw_info']['server']['header_version']) && @$GLOBALS['phpgw_info']['server']['header_version'] <= 1.6)
elseif(!@isset($GLOBALS['egw_info']['server']['header_version']) && @$GLOBALS['egw_info']['server']['header_version'] <= 1.6)
{
$GLOBALS['phpgw_info']['server']['include_root'] = @$GLOBALS['phpgw_info']['server']['server_root'];
$GLOBALS['egw_info']['server']['include_root'] = @$GLOBALS['egw_info']['server']['server_root'];
}
}
else
{
$detected .= lang('Sample configuration not found. using built in defaults') . '<br>' . "\n";
$GLOBALS['phpgw_info']['server']['server_root'] = $realpath;
$GLOBALS['phpgw_info']['server']['include_root'] = $realpath;
$GLOBALS['egw_info']['server']['server_root'] = $realpath;
$GLOBALS['egw_info']['server']['include_root'] = $realpath;
/* This is the basic include needed on each page for eGroupWare application compliance */
$GLOBALS['phpgw_info']['flags']['htmlcompliant'] = True;
$GLOBALS['egw_info']['flags']['htmlcompliant'] = True;
/* These are the settings for the database system */
$setup_tpl->set_var('lang_domain',lang('Domain'));
@ -518,9 +518,9 @@
$setup_tpl->set_var('comment_r',' -->');
/* These are a few of the advanced settings */
$GLOBALS['phpgw_info']['server']['db_persistent'] = True;
$GLOBALS['phpgw_info']['server']['mcrypt_enabled'] = check_load_extension('mcrypt');
$GLOBALS['phpgw_info']['server']['versions']['mcrypt'] = '';
$GLOBALS['egw_info']['server']['db_persistent'] = True;
$GLOBALS['egw_info']['server']['mcrypt_enabled'] = check_load_extension('mcrypt');
$GLOBALS['egw_info']['server']['versions']['mcrypt'] = '';
srand((double)microtime()*1000000);
$random_char = array(
@ -532,7 +532,7 @@
for($i=0; $i<30; $i++)
{
$GLOBALS['phpgw_info']['server']['mcrypt_iv'] .= $random_char[rand(1,count($random_char))];
$GLOBALS['egw_info']['server']['mcrypt_iv'] .= $random_char[rand(1,count($random_char))];
}
}
@ -542,28 +542,28 @@
$detected .= lang('Now guessing better values for defaults...') . '<br>' . "\n";
$this_dir = dirname($_SERVER['SCRIPT_FILENAME']);
$updir = str_replace('/setup','',$this_dir);
$GLOBALS['phpgw_info']['server']['server_root'] = $updir;
$GLOBALS['phpgw_info']['server']['include_root'] = $updir;
$GLOBALS['egw_info']['server']['server_root'] = $updir;
$GLOBALS['egw_info']['server']['include_root'] = $updir;
}
$setup_tpl->set_var('detected',$detected);
/* End of detected settings, now display the form with the detected or prior values */
$setup_tpl->set_var('server_root',@$GLOBALS['phpgw_info']['server']['server_root']);
$setup_tpl->set_var('include_root',@$GLOBALS['phpgw_info']['server']['include_root']);
if(!@isset($GLOBALS['phpgw_info']['server']['header_admin_user']))
$setup_tpl->set_var('server_root',@$GLOBALS['egw_info']['server']['server_root']);
$setup_tpl->set_var('include_root',@$GLOBALS['egw_info']['server']['include_root']);
if(!@isset($GLOBALS['egw_info']['server']['header_admin_user']))
{
$setup_tpl->set_var('header_admin_user','admin');
}
else
{
$setup_tpl->set_var('header_admin_user',@$GLOBALS['phpgw_info']['server']['header_admin_user']);
$setup_tpl->set_var('header_admin_user',@$GLOBALS['egw_info']['server']['header_admin_user']);
}
$setup_tpl->set_var('header_admin_pass',@$GLOBALS['phpgw_info']['server']['header_admin_password']);
$setup_tpl->set_var('header_admin_pass',@$GLOBALS['egw_info']['server']['header_admin_password']);
$setup_tpl->set_var('header_admin_password','');
if(@$GLOBALS['phpgw_info']['server']['db_persistent'])
if(@$GLOBALS['egw_info']['server']['db_persistent'])
{
$setup_tpl->set_var('db_persistent_yes',' selected');
}
@ -576,7 +576,7 @@
$session_options = '';
while(list($k,$v) = each($supported_sessions_type))
{
if($v == @$GLOBALS['phpgw_info']['server']['sessions_type'])
if($v == @$GLOBALS['egw_info']['server']['sessions_type'])
{
$selected = ' selected ';
}
@ -588,7 +588,7 @@
}
$setup_tpl->set_var('session_options',$session_options);
if(@$GLOBALS['phpgw_info']['server']['mcrypt_enabled'])
if(@$GLOBALS['egw_info']['server']['mcrypt_enabled'])
{
$setup_tpl->set_var('mcrypt_enabled_yes',' selected');
}
@ -597,13 +597,13 @@
$setup_tpl->set_var('mcrypt_enabled_no',' selected');
}
$setup_tpl->set_var('mcrypt',$GLOBALS['phpgw_info']['server']['versions']['mcrypt']);
$setup_tpl->set_var('mcrypt_iv',$GLOBALS['phpgw_info']['server']['mcrypt_iv']);
$setup_tpl->set_var('mcrypt',$GLOBALS['egw_info']['server']['versions']['mcrypt']);
$setup_tpl->set_var('mcrypt_iv',$GLOBALS['egw_info']['server']['mcrypt_iv']);
$setup_tpl->set_var('lang_setup_acl',lang('Limit access to setup to the following addresses, networks or hostnames (e.g. 127.0.0.1,10.1.1,myhost.dnydns.org)'));
$setup_tpl->set_var('setup_acl',$GLOBALS['phpgw_info']['server']['setup_acl']);
$setup_tpl->set_var('setup_acl',$GLOBALS['egw_info']['server']['setup_acl']);
if(@$GLOBALS['phpgw_info']['server']['show_domain_selectbox'])
if(@$GLOBALS['egw_info']['server']['show_domain_selectbox'])
{
$setup_tpl->set_var('domain_selectbox_yes',' selected');
}
@ -617,7 +617,7 @@
{
/*
$errors .= '<br><font color="red">' . lang('Warning!') . '<br>'
. lang('The db_type in defaults (%1) is not supported on this server. using first supported type.',$GLOBALS['phpgw_info']['server']['db_type'])
. lang('The db_type in defaults (%1) is not supported on this server. using first supported type.',$GLOBALS['egw_info']['server']['db_type'])
. '</font>';
*/
}
@ -637,12 +637,12 @@
. '</form>';
}
// set domain and password for the continue button
@reset($GLOBALS['phpgw_domain']);
list($firstDomain) = @each($GLOBALS['phpgw_domain']);
@reset($GLOBALS['egw_domain']);
list($firstDomain) = @each($GLOBALS['egw_domain']);
$setup_tpl->set_var(array(
'FormDomain' => $firstDomain,
'FormUser' => $GLOBALS['phpgw_domain'][$firstDomain]['config_user'],
'FormPW' => $GLOBALS['phpgw_domain'][$firstDomain]['config_passwd']
'FormUser' => $GLOBALS['egw_domain'][$firstDomain]['config_user'],
'FormPW' => $GLOBALS['egw_domain'][$firstDomain]['config_passwd']
));
$setup_tpl->set_var('errors',$errors);
@ -686,7 +686,7 @@
$setup_tpl->pfp('out','manageheader');
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_footer();
break; // ending the switch default
}

View File

@ -13,24 +13,24 @@
$GLOBALS['DEBUG'] = True;
$phpgw_info = array();
$GLOBALS['phpgw_info']['flags'] = array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
);
$GLOBALS['egw_info'] = array(
'flags' => array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
));
include ('./inc/functions.inc.php');
// Check header and authentication
if (!$GLOBALS['phpgw_setup']->auth('Config'))
if (!$GLOBALS['egw_setup']->auth('Config'))
{
Header('Location: index.php');
exit;
}
// Does not return unless user is authorized
$tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
$tpl_root = $GLOBALS['egw_setup']->html->setup_tpl_dir('setup');
$GLOBALS['setup_tpl'] = CreateObject('setup.Template',$tpl_root);
$GLOBALS['setup_tpl']->set_file(array(
'T_head' => 'head.tpl',
@ -86,16 +86,16 @@
}
}
$GLOBALS['phpgw_setup']->loaddb();
$GLOBALS['phpgw_info']['setup']['stage']['db'] = $GLOBALS['phpgw_setup']->detection->check_db();
$GLOBALS['egw_setup']->loaddb();
$GLOBALS['egw_info']['setup']['stage']['db'] = $GLOBALS['egw_setup']->detection->check_db();
$GLOBALS['setup_info'] = $GLOBALS['phpgw_setup']->detection->get_versions();
$GLOBALS['setup_info'] = $GLOBALS['egw_setup']->detection->get_versions();
//var_dump($GLOBALS['setup_info']);exit;
$GLOBALS['setup_info'] = $GLOBALS['phpgw_setup']->detection->get_db_versions($GLOBALS['setup_info']);
$GLOBALS['setup_info'] = $GLOBALS['egw_setup']->detection->get_db_versions($GLOBALS['setup_info']);
//var_dump($GLOBALS['setup_info']);exit;
$GLOBALS['setup_info'] = $GLOBALS['phpgw_setup']->detection->compare_versions($GLOBALS['setup_info']);
$GLOBALS['setup_info'] = $GLOBALS['egw_setup']->detection->compare_versions($GLOBALS['setup_info']);
//var_dump($GLOBALS['setup_info']);exit;
$GLOBALS['setup_info'] = $GLOBALS['phpgw_setup']->detection->check_depends($GLOBALS['setup_info']);
$GLOBALS['setup_info'] = $GLOBALS['egw_setup']->detection->check_depends($GLOBALS['setup_info']);
//var_dump($GLOBALS['setup_info']);exit;
@ksort($GLOBALS['setup_info']);
@ -105,7 +105,7 @@
exit;
}
$GLOBALS['phpgw_setup']->html->show_header(lang("Developers' Table Schema Toy"),False,'config',$GLOBALS['phpgw_setup']['ConfigDomain']);
$GLOBALS['egw_setup']->html->show_header(lang("Developers' Table Schema Toy"),False,'config',$GLOBALS['egw_setup']['ConfigDomain']);
if(get_var('submit',Array('POST')))
{
@ -127,7 +127,7 @@
// Drop newest tables
$terror[$appname]['tables'] = $GLOBALS['setup_info'][$appname]['tables'];
$GLOBALS['phpgw_setup']->process->droptables($terror,$GLOBALS['DEBUG']);
$GLOBALS['egw_setup']->process->droptables($terror,$GLOBALS['DEBUG']);
$terror[$appname]['tables'] = array();
// Reset tables field to baseline table names
@ -145,13 +145,13 @@
{
echo '<br>Processing ' . $terror[$appname]['name'] . ' to ' . $version[$appname];
$terror = $GLOBALS['phpgw_setup']->process->droptables($terror,$GLOBALS['DEBUG']);
$GLOBALS['phpgw_setup']->deregister_app($terror[$appname]['name']);
$terror = $GLOBALS['egw_setup']->process->droptables($terror,$GLOBALS['DEBUG']);
$GLOBALS['egw_setup']->deregister_app($terror[$appname]['name']);
$terror = $GLOBALS['phpgw_setup']->process->baseline($terror,$GLOBALS['DEBUG']);
$terror = $GLOBALS['phpgw_setup']->process->test_data($terror,$GLOBALS['DEBUG']);
$terror = $GLOBALS['egw_setup']->process->baseline($terror,$GLOBALS['DEBUG']);
$terror = $GLOBALS['egw_setup']->process->test_data($terror,$GLOBALS['DEBUG']);
$terror = $GLOBALS['phpgw_setup']->process->upgrade($terror,$GLOBALS['DEBUG']);
$terror = $GLOBALS['egw_setup']->process->upgrade($terror,$GLOBALS['DEBUG']);
$terror[$appname]['version'] = $version[$appname];
}
else
@ -162,7 +162,7 @@
. lang('tables installed, unless there are errors printed above') . '.';
$GLOBALS['setup_info'][$appname]['version'] = $terror[$appname]['version'];
$GLOBALS['phpgw_setup']->register_app($appname);
$GLOBALS['egw_setup']->register_app($appname);
echo '<br>' . $terror[$appname]['title'] . ' ' . lang('registered') . '.';
}
@ -272,5 +272,5 @@
$GLOBALS['setup_tpl']->set_var('cancel',lang('Cancel'));
$GLOBALS['setup_tpl']->pparse('out','app_footer');
$GLOBALS['setup_tpl']->pparse('out','footer');
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_footer();
?>

View File

@ -13,17 +13,18 @@
// Little file to setup a demo install
$GLOBALS['phpgw_info']['flags'] = array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
);
$GLOBALS['egw_info'] = array(
'flags' => array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
));
include('./inc/functions.inc.php');
// Authorize the user to use setup app and load the database
// Does not return unless user is authorized
if(!$GLOBALS['phpgw_setup']->auth('Config') || get_var('cancel',Array('POST')))
if(!$GLOBALS['egw_setup']->auth('Config') || get_var('cancel',Array('POST')))
{
Header('Location: index.php');
exit;
@ -31,7 +32,7 @@
if(!get_var('submit',Array('POST')))
{
$tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
$tpl_root = $GLOBALS['egw_setup']->html->setup_tpl_dir('setup');
$setup_tpl = CreateObject('setup.Template',$tpl_root);
$setup_tpl->set_file(array(
'T_head' => 'head.tpl',
@ -44,7 +45,7 @@
$setup_tpl->set_block('T_login_stage_header','B_multi_domain','V_multi_domain');
$setup_tpl->set_block('T_login_stage_header','B_single_domain','V_single_domain');
$GLOBALS['phpgw_setup']->html->show_header(lang('Demo Server Setup'));
$GLOBALS['egw_setup']->html->show_header(lang('Demo Server Setup'));
$setup_tpl->set_var('action_url','setup_demo.php');
$setup_tpl->set_var('description',lang('<b>This will create 1 admin account and 3 demo accounts</b><br>The username/passwords are: demo/guest, demo2/guest and demo3/guest.'));
@ -61,7 +62,7 @@
$setup_tpl->set_var('lang_submit',lang('Save'));
$setup_tpl->set_var('lang_cancel',lang('Cancel'));
$setup_tpl->pparse('out','T_setup_demo');
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_footer();
}
else
{
@ -83,40 +84,40 @@
exit;
}
$GLOBALS['phpgw_setup']->loaddb();
$GLOBALS['egw_setup']->loaddb();
/* Begin transaction for acl, etc */
$GLOBALS['phpgw_setup']->db->transaction_begin();
$GLOBALS['egw_setup']->db->transaction_begin();
if($_POST['delete_all'])
{
/* Now, clear out existing tables */
$GLOBALS['phpgw_setup']->db->query('DELETE FROM phpgw_accounts');
$GLOBALS['phpgw_setup']->db->query('DELETE FROM phpgw_preferences');
$GLOBALS['phpgw_setup']->db->query('DELETE FROM phpgw_acl');
$GLOBALS['egw_setup']->db->query('DELETE FROM phpgw_accounts');
$GLOBALS['egw_setup']->db->query('DELETE FROM phpgw_preferences');
$GLOBALS['egw_setup']->db->query('DELETE FROM phpgw_acl');
}
/* Create the demo groups */
$defaultgroupid = (int)$GLOBALS['phpgw_setup']->add_account('Default','Default','Group',False,False);
$admingroupid = (int)$GLOBALS['phpgw_setup']->add_account('Admins','Admin','Group',False,False);
$defaultgroupid = (int)$GLOBALS['egw_setup']->add_account('Default','Default','Group',False,False);
$admingroupid = (int)$GLOBALS['egw_setup']->add_account('Admins','Admin','Group',False,False);
if (!$defaultgroupid || !$admingroupid)
{
echo '<p><b>'.lang('Error in group-creation !!!')."</b></p>\n";
echo '<p>'.lang('click <a href="index.php">here</a> to return to setup.')."</p>\n";
$GLOBALS['phpgw_setup']->db->transaction_abort();
$GLOBALS['egw_setup']->db->transaction_abort();
exit;
}
/* Group perms for the default group */
$GLOBALS['phpgw_setup']->add_acl(array('addressbook','calendar','infolog','email','preferences','manual'),'run',$defaultgroupid);
$GLOBALS['egw_setup']->add_acl(array('addressbook','calendar','infolog','email','preferences','manual'),'run',$defaultgroupid);
// give admin access to all apps, to save us some support requests
$all_apps = array();
$GLOBALS['phpgw_setup']->db->query('SELECT app_name FROM phpgw_applications WHERE app_enabled<3');
while ($GLOBALS['phpgw_setup']->db->next_record())
$GLOBALS['egw_setup']->db->query('SELECT app_name FROM phpgw_applications WHERE app_enabled<3');
while ($GLOBALS['egw_setup']->db->next_record())
{
$all_apps[] = $GLOBALS['phpgw_setup']->db->f('app_name');
$all_apps[] = $GLOBALS['egw_setup']->db->f('app_name');
}
$GLOBALS['phpgw_setup']->add_acl($all_apps,'run',$admingroupid);
$GLOBALS['egw_setup']->add_acl($all_apps,'run',$admingroupid);
function insert_default_prefs($accountid)
{
@ -146,8 +147,8 @@
foreach ($defaultprefs as $app => $prefs)
{
$prefs = $GLOBALS['phpgw_setup']->db->db_addslashes(serialize($prefs));
$GLOBALS['phpgw_setup']->db->query("INSERT INTO phpgw_preferences(preference_owner,preference_app,preference_value) VALUES($accountid,'$app','$prefs')",__FILE__,__LINE__);
$prefs = $GLOBALS['egw_setup']->db->db_addslashes(serialize($prefs));
$GLOBALS['egw_setup']->db->query("INSERT INTO phpgw_preferences(preference_owner,preference_app,preference_value) VALUES($accountid,'$app','$prefs')",__FILE__,__LINE__);
}
}
insert_default_prefs(-2); // set some default prefs
@ -156,27 +157,27 @@
if(get_var('create_demo',Array('POST')))
{
// Create 3 demo accounts
$GLOBALS['phpgw_setup']->add_account('demo','Demo','Account','guest');
$GLOBALS['phpgw_setup']->add_account('demo2','Demo2','Account','guest');
$GLOBALS['phpgw_setup']->add_account('demo3','Demo3','Account','guest');
$GLOBALS['egw_setup']->add_account('demo','Demo','Account','guest');
$GLOBALS['egw_setup']->add_account('demo2','Demo2','Account','guest');
$GLOBALS['egw_setup']->add_account('demo3','Demo3','Account','guest');
}
/* Create records for administrator account, with Admins as primary and Default as additional group */
$accountid = $GLOBALS['phpgw_setup']->add_account($username,$fname,$lname,$passwd,'Admins',True);
$accountid = $GLOBALS['egw_setup']->add_account($username,$fname,$lname,$passwd,'Admins',True);
if (!$accountid)
{
echo '<p><b>'.lang('Error in admin-creation !!!')."</b></p>\n";
echo '<p>'.lang('click <a href="index.php">here</a> to return to setup.')."</p>\n";
$GLOBALS['phpgw_setup']->db->transaction_abort();
$GLOBALS['egw_setup']->db->transaction_abort();
exit;
}
$GLOBALS['phpgw_setup']->add_acl('phpgw_group',$admingroupid,$accountid);
$GLOBALS['phpgw_setup']->add_acl('phpgw_group',$defaultgroupid,$accountid);
$GLOBALS['egw_setup']->add_acl('phpgw_group',$admingroupid,$accountid);
$GLOBALS['egw_setup']->add_acl('phpgw_group',$defaultgroupid,$accountid);
/* Clear the access log, since these are all new users anyway */
$GLOBALS['phpgw_setup']->db->query('DELETE FROM phpgw_access_log');
$GLOBALS['egw_setup']->db->query('DELETE FROM phpgw_access_log');
$GLOBALS['phpgw_setup']->db->transaction_commit();
$GLOBALS['egw_setup']->db->transaction_commit();
Header('Location: index.php');
exit;

View File

@ -11,24 +11,24 @@
/* $Id$ */
$phpgw_info = array();
$GLOBALS['phpgw_info']['flags'] = array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
);
$GLOBALS['egw_info'] = array(
'flags' => array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
));
include('./inc/functions.inc.php');
/* Check header and authentication */
if(!$GLOBALS['phpgw_setup']->auth('Config'))
if(!$GLOBALS['egw_setup']->auth('Config'))
{
Header('Location: index.php');
exit;
}
// Does not return unless user is authorized
$tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
$tpl_root = $GLOBALS['egw_setup']->html->setup_tpl_dir('setup');
$setup_tpl = CreateObject('setup.Template',$tpl_root);
$apps = get_var('apps','GET');
@ -71,14 +71,14 @@
$setup_tpl->set_block('sqlarr','sqlfooter','sqlfooter');
}
$GLOBALS['phpgw_setup']->loaddb();
$GLOBALS['egw_setup']->loaddb();
function parse_vars($table,$term)
{
$GLOBALS['setup_tpl']->set_var('table', $table);
$GLOBALS['setup_tpl']->set_var('term',$term);
list($arr,$pk,$fk,$ix,$uc) = $GLOBALS['phpgw_setup']->process->sql_to_array($table);
list($arr,$pk,$fk,$ix,$uc) = $GLOBALS['egw_setup']->process->sql_to_array($table);
$GLOBALS['setup_tpl']->set_var('arr',$arr);
foreach(array('pk','fk','ix','uc') as $kind)
@ -147,7 +147,7 @@
if(!$download)
{
$GLOBALS['phpgw_setup']->html->show_header();
$GLOBALS['egw_setup']->html->show_header();
}
if($showall)
@ -160,8 +160,8 @@
$term = ',';
$dlstring .= printout('sqlheader');
$GLOBALS['phpgw_setup']->db->connect();
foreach($GLOBALS['phpgw_setup']->db->Link_ID->MetaTables() as $table)
$GLOBALS['egw_setup']->db->connect();
foreach($GLOBALS['egw_setup']->db->Link_ID->MetaTables() as $table)
{
parse_vars($table,$term);
$dlstring .= printout('sqlbody');
@ -215,7 +215,7 @@
}
else
{
$GLOBALS['phpgw_setup']->html->show_header();
$GLOBALS['egw_setup']->html->show_header();
$setup_tpl->set_var('action_url','sqltoarray.php');
$setup_tpl->set_var('lang_submit','Show selected');

View File

@ -14,28 +14,28 @@
$diagnostics = 1; // can be set to 0=non, 1=some (default for now), 2=all
$phpgw_info = array();
$GLOBALS['phpgw_info']['flags'] = array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
);
$GLOBALS['egw_info'] = array(
'flags' => array(
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
));
include('./inc/functions.inc.php');
// Authorize the user to use setup app and load the database
// Does not return unless user is authorized
if (!$GLOBALS['phpgw_setup']->auth('Config') || @$_POST['cancel'])
if (!$GLOBALS['egw_setup']->auth('Config') || @$_POST['cancel'])
{
Header('Location: index.php');
exit;
}
$GLOBALS['phpgw_setup']->loaddb();
$GLOBALS['egw_setup']->loaddb();
$GLOBALS['phpgw_setup']->translation->setup_translation_sql();
$translation = &$GLOBALS['phpgw_setup']->translation->sql;
$GLOBALS['egw_setup']->translation->setup_translation_sql();
$translation = &$GLOBALS['egw_setup']->translation->sql;
$translation->translation(True); // to get the mbstring warnings
$tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
$tpl_root = $GLOBALS['egw_setup']->html->setup_tpl_dir('setup');
$setup_tpl = CreateObject('phpgwapi.Template',$tpl_root);
$setup_tpl->set_file(array(
'T_head' => 'head.tpl',
@ -48,14 +48,14 @@
if ($diagnostics || !@$_POST['convert'])
{
$GLOBALS['phpgw_setup']->html->show_header($stage_title,False,'config',$GLOBALS['phpgw_setup']->ConfigDomain . '(' . $phpgw_domain[$GLOBALS['phpgw_setup']->ConfigDomain]['db_type'] . ')');
$GLOBALS['egw_setup']->html->show_header($stage_title,False,'config',$GLOBALS['egw_setup']->ConfigDomain . '(' . $GLOBALS['egw_domain'][$GLOBALS['egw_setup']->ConfigDomain]['db_type'] . ')');
}
if (@$_POST['convert'])
{
if (empty($_POST['current_charset']))
{
$errors[] = lang('You need to select your current charset!');
$GLOBALS['phpgw_setup']->html->show_header($stage_title,False,'config',$GLOBALS['phpgw_setup']->ConfigDomain . '(' . $phpgw_domain[$GLOBALS['phpgw_setup']->ConfigDomain]['db_type'] . ')');
$GLOBALS['egw_setup']->html->show_header($stage_title,False,'config',$GLOBALS['egw_setup']->ConfigDomain . '(' . $GLOBALS['egw_domain'][$GLOBALS['egw_setup']->ConfigDomain]['db_type'] . ')');
}
else
{
@ -77,9 +77,9 @@
@set_time_limit(0); // this might take a while
$db2 = $GLOBALS['phpgw_setup']->db;
$setup_info = $GLOBALS['phpgw_setup']->detection->get_versions();
$setup_info = $GLOBALS['phpgw_setup']->detection->get_db_versions($setup_info);
$db2 = $GLOBALS['egw_setup']->db;
$setup_info = $GLOBALS['egw_setup']->detection->get_versions();
$setup_info = $GLOBALS['egw_setup']->detection->get_db_versions($setup_info);
// Visit each app/setup dir, look for a phpgw_lang file
foreach($setup_info as $app => $data)
@ -87,7 +87,7 @@
if ($diagnostics) echo "<p><b>$app</b>: ";
if (!isset($data['tables']) || !count($data['tables']) ||
!$GLOBALS['phpgw_setup']->app_registered($app) ||
!$GLOBALS['egw_setup']->app_registered($app) ||
!($table_definitions = $db2->get_table_definitions($app)))
{
if ($diagnostics) echo "skipping (no tables or not installed)</p>\n";
@ -98,8 +98,8 @@
if ($diagnostics) { echo "<br>start converting table '$table' ... "; }
$db2->set_column_definitions($definitions['fd']);
$updates = 0;
$GLOBALS['phpgw_setup']->db->query("SELECT * FROM $table",__LINE__,__FILE__);
while($columns = $GLOBALS['phpgw_setup']->db->row(True))
$GLOBALS['egw_setup']->db->query("SELECT * FROM $table",__LINE__,__FILE__);
while($columns = $GLOBALS['egw_setup']->db->row(True))
{
$update = array();
foreach($columns as $name => $data)
@ -137,15 +137,15 @@
}
if ($diagnostics)
{
$GLOBALS['phpgw_setup']->db->query("SELECT count(*) FROM $table",__LINE__,__FILE__);
$GLOBALS['phpgw_setup']->db->next_record();
$total = $GLOBALS['phpgw_setup']->db->f(0);
$GLOBALS['egw_setup']->db->query("SELECT count(*) FROM $table",__LINE__,__FILE__);
$GLOBALS['egw_setup']->db->next_record();
$total = $GLOBALS['egw_setup']->db->f(0);
echo " done, $updates/$total rows updated";
}
}
}
@$GLOBALS['phpgw_setup']->db->query("DELETE FROM phpgw_config WHERE config_app='phpgwapi' AND config_name='system_charset'",__LINE__,__FILE__);
$GLOBALS['phpgw_setup']->db->query("INSERT INTO phpgw_config (config_app,config_name,config_value) VALUES ('phpgwapi','system_charset','$to')",__LINE__,__FILE__);
@$GLOBALS['egw_setup']->db->query("DELETE FROM phpgw_config WHERE config_app='phpgwapi' AND config_name='system_charset'",__LINE__,__FILE__);
$GLOBALS['egw_setup']->db->query("INSERT INTO phpgw_config (config_app,config_name,config_value) VALUES ('phpgwapi','system_charset','$to')",__LINE__,__FILE__);
}
$setup_tpl->set_var('stage_title',$stage_title);
@ -206,5 +206,5 @@
$setup_tpl->set_var('new_charset',"<select name=\"new_charset\">\n$options</select>\n");
}
$setup_tpl->pparse('out','T_system_charset');
$GLOBALS['phpgw_setup']->html->show_footer();
$GLOBALS['egw_setup']->html->show_footer();
?>