True,
'noheader' => True,
'nonavbar' => True,
'currentapp' => 'home',
'noapi' => True
);
include('./inc/functions.inc.php');
include('../phpgwapi/setup/setup.inc.php');
$phpgw_info['server']['versions']['current_header'] = $setup_info['phpgwapi']['versions']['current_header'];
unset($setup_info);
#include('../version.inc.php');
function check_form_values()
{
if (! $GLOBALS['HTTP_POST_VARS']['setting']['config_pass'])
{
$errors .= "
You didn't enter a config password";
}
if (! $GLOBALS['HTTP_POST_VARS']['setting']['HEADER_ADMIN_PASSWORD'])
{
$errors .= "
You didn't enter a header admin password";
}
if ($errors)
{
$GLOBALS['phpgw_setup']->show_header('Error',True);
echo $errors;
exit;
}
}
/* authentication phase */
$phpgw_info['setup']['stage']['header'] = $phpgw_setup->check_header();
// added these to let the app work, need to templatize still
$tpl_root = $phpgw_setup->setup_tpl_dir('setup');
$setup_tpl = CreateObject('phpgwapi.Template',$tpl_root);
$setup_tpl->set_file(array(
'T_head' => 'head.tpl',
'T_footer' => 'footer.tpl',
'T_alert_msg' => 'msg_alert_msg.tpl',
'T_login_main' => 'login_main.tpl',
'T_login_stage_header' => 'login_stage_header.tpl',
'T_setup_main' => 'setup_main.tpl',
'T_setup_db_blocks' => 'setup_db_blocks.tpl'
));
$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');
switch($phpgw_info['setup']['stage']['header'])
{
case '1':
$phpgw_info['setup']['HeaderFormMSG'] = 'Create your header.inc.php';
$phpgw_info['setup']['PageMSG'] = 'You have not created your header.inc.php yet!
You can create it now.';
break;
case '2':
$phpgw_info['setup']['HeaderFormMSG'] = 'Your header admin password is NOT set. Please set it now!';
$phpgw_info['setup']['PageMSG'] = 'Your header admin password is NOT set. Please set it now!';
break;
case '3':
$phpgw_info['setup']['HeaderFormMSG'] = 'Your header.inc.php needs upgrading.';
$phpgw_info['setup']['PageMSG'] = 'Your header.inc.php needs upgrading.
If you are using virtual domain support, this will NOT copy those domains over. You will need to do this manually, MAKE BACKUPS!';
$phpgw_info['setup']['HeaderLoginMSG'] = 'Your header.inc.php needs upgrading.';
if (!$phpgw_setup->auth('Header'))
{
$phpgw_setup->show_header('Please login',True);
$phpgw_setup->login_form();
exit;
}
break;
case '10':
if (!$phpgw_setup->auth('Header'))
{
$phpgw_setup->show_header('Please login',True);
$phpgw_setup->login_form();
exit;
}
$phpgw_info['setup']['HeaderFormMSG'] = 'Edit your header.inc.php';
$phpgw_info['setup']['PageMSG'] = 'Edit your existing header.inc.php';
break;
}
switch($HTTP_POST_VARS['action'])
{
case 'download':
check_form_values();
$header_template = CreateObject('phpgwapi.Template','../');
header('Content-disposition: attachment; filename="header.inc.php"');
header('Content-type: application/octet-stream');
header('Pragma: no-cache');
header('Expires: 0');
$newheader = $phpgw_setup->generate_header();
echo $newheader;
break;
case 'view':
check_form_values();
$header_template = CreateObject('phpgwapi.Template','../');
$phpgw_setup->show_header('Generated header.inc.php', False, 'header');
echo '
Save this text as contents of your header.inc.php
'; echo htmlentities($newheader); echo '