Converting to get_var() for all HTTP_*_VARS.

This commit is contained in:
skeeter 2002-04-29 19:49:24 +00:00
parent 254e9087ba
commit aa1398fd6b
9 changed files with 61 additions and 58 deletions

View File

@ -38,7 +38,7 @@
}
// Does not return unless user is authorized
$ConfigDomain = $HTTP_COOKIE_VARS['ConfigDomain'] ? $HTTP_COOKIE_VARS['ConfigDomain'] : $HTTP_POST_VARS['ConfigDomain'];
$ConfigDomain = get_var('ConfigDomain',Array('POST','COOKIE'));
$tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
$setup_tpl = CreateObject('phpgwapi.Template',$tpl_root);
@ -109,22 +109,22 @@
//var_dump($setup_info);exit;
@ksort($setup_info);
if(@$HTTP_POST_VARS['cancel'])
if(@get_var('cancel',Array('POST')))
{
Header("Location: index.php");
exit;
}
if(@$HTTP_POST_VARS['submit'])
if(@get_var('submit',Array('POST')))
{
$GLOBALS['phpgw_setup']->html->show_header(lang('Application Management'),False,'config',$ConfigDomain . '(' . $phpgw_domain[$ConfigDomain]['db_type'] . ')');
$setup_tpl->set_var('description',lang('App install/remove/upgrade') . ':');
$setup_tpl->pparse('out','header');
$appname = $HTTP_POST_VARS['appname'];
$remove = $HTTP_POST_VARS['remove'];
$install = $HTTP_POST_VARS['install'];
$upgrade = $HTTP_POST_VARS['upgrade'];
$appname = get_var('appname',Array('POST'));
$remove = get_var('remove',Array('POST'));
$install = get_var('install',Array('POST'));
$upgrade = get_var('upgrade',Array('POST'));
while (list($appname,$key) = @each($remove))
{
@ -220,9 +220,10 @@
$GLOBALS['phpgw_setup']->html->show_header(lang('Application Management'),False,'config',$ConfigDomain . '(' . $phpgw_domain[$ConfigDomain]['db_type'] . ')');
}
if(@$HTTP_GET_VARS['detail'])
$detail = get_var('detail',Array('GET'));
$resolve = get_var('resolve',Array('GET'));
if(@$detail)
{
$detail = $HTTP_GET_VARS['detail'];
@ksort($setup_info[$detail]);
@reset($setup_info[$detail]);
$setup_tpl->set_var('description',lang('App details') . ':');
@ -258,15 +259,14 @@
$setup_tpl->pparse('out','footer');
exit;
}
elseif (@$HTTP_GET_VARS['resolve'])
elseif (@$resolve)
{
$resolve = $HTTP_GET_VARS['resolve'];
$version = $HTTP_GET_VARS['version'];
$notables = $HTTP_GET_VARS['notables'];
$version = get_var('version',Array('GET'));
$notables = get_var('notables',Array('GET'));
$setup_tpl->set_var('description',lang('Problem resolution'). ':');
$setup_tpl->pparse('out','header');
if($HTTP_GET_VARS['post'])
if(get_var('post',Array('GET')))
{
echo '"' . $setup_info[$resolve]['title'] . '" ' . lang('may be broken') . ' ';
echo lang('because an application it depends upon was upgraded');
@ -275,7 +275,7 @@
echo '<br>';
echo lang('However, the application may still work') . '.';
}
elseif ($HTTP_GET_VARS['badinstall'])
elseif(get_var('badinstall',Array('GET')))
{
echo '"' . $setup_info[$resolve]['title'] . '" ' . lang('is broken') . ' ';
echo lang('because of a failed upgrade or install') . '.';

View File

@ -57,7 +57,7 @@
$GLOBALS['current_config']['temp_dir'] = '/path/to/temp/dir';
}
if(@$GLOBALS['HTTP_POST_VARS']['cancel'])
if(@get_var('cancel',Array('POST')))
{
Header('Location: index.php');
exit;
@ -74,15 +74,14 @@
$configtbl = 'phpgw_config';
}
if(@$GLOBALS['HTTP_POST_VARS']['submit'] && @$GLOBALS['HTTP_POST_VARS']['newsettings'])
$newsettings = get_var('newsettings',Array('POST'));
if(@get_var('submit',Array('POST')) && @$newsettings)
{
$GLOBALS['phpgw_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')");
$newsettings = $GLOBALS['HTTP_POST_VARS']['newsettings'];
while(list($setting,$value) = @each($newsettings))
{
/* echo '<br>Updating: ' . $setting . '=' . $value; */
@ -141,7 +140,7 @@
$GLOBALS['current_config']['files_dir'] = $GLOBALS['phpgw_info']['server']['server_root'] . '/files';
}
if($error == 'badldapconnection')
if($GLOBALS['error'] == 'badldapconnection')
{
/* Please check the number and dial again :) */
$GLOBALS['phpgw_setup']->html->show_alert_msg('Error',
@ -205,7 +204,7 @@
}
else
{
$t->set_var($value,$current_config[$newval]);
$t->set_var($value,@$current_config[$newval]);
}
break;
case 'selected':
@ -219,7 +218,7 @@
}
$config = implode('_',$configs);
/* echo $config . '=' . $current_config[$config]; */
if($current_config[$config] == $setting)
if(@$current_config[$config] == $setting)
{
$t->set_var($value,' selected');
}

View File

@ -95,7 +95,7 @@
//$action = 'Upgrade';
// end DEBUG code
switch(@$GLOBALS['HTTP_POST_VARS']['action'])
switch(@get_var('action',Array('POST')))
{
case 'Uninstall all applications':
$subtitle = lang('Deleting Tables');

View File

@ -58,10 +58,10 @@
$langstbl = 'phpgw_languages';
}
if (@$GLOBALS['HTTP_POST_VARS']['submit'])
if (@get_var('submit',Array('POST')))
{
$lang_selected = $HTTP_POST_VARS['lang_selected'];
$upgrademethod = $HTTP_POST_VARS['upgrademethod'];
$lang_selected = get_var('lang_selected',Array('POST'));
$upgrademethod = get_var('upgrademethod',Array(POST'));
$GLOBALS['phpgw_setup']->db->transaction_begin();
if (count($lang_selected))
{
@ -153,7 +153,7 @@
}
else
{
if (@$GLOBALS['HTTP_POST_VARS']['cancel'])
if (@get_var('cancel',Array('POST')))
{
Header('Location: index.php');
exit;

View File

@ -11,7 +11,7 @@
/* $Id$ */
$phpgw_info = array();
$GLOBALS['phpgw_info'] = array();
$GLOBALS['phpgw_info']['flags'] = array(
'noheader' => True,
'nonavbar' => True,
@ -28,7 +28,7 @@
}
// Does not return unless user is authorized
if ($HTTP_POST_VARS['cancel'])
if (get_var('cancel',Array('POST')))
{
Header('Location: index.php');
exit;
@ -45,10 +45,10 @@
$GLOBALS['phpgw_setup']->html->show_header(lang('LDAP Config'),'','config',$ConfigDomain);
if ($error)
if ($GLOBALS['error'])
{
//echo '<br><center><b>Error:</b> '.$error.'</center>';
$GLOBALS['phpgw_setup']->html->show_alert_msg('Error',$error);
$GLOBALS['phpgw_setup']->html->show_alert_msg('Error',$GLOBALS['error']);
}
$setup_tpl->set_block('ldap','header','header');

View File

@ -25,28 +25,32 @@
unset($setup_info);
#include('../version.inc.php');
if(@$GLOBALS['HTTP_POST_VARS']['adddomain'])
$adddomain = get_var('adddomain',Array('POST'));
if(@$adddomain)
{
}
function check_form_values()
{
$errors = '';
@reset($GLOBALS['HTTP_POST_VARS']['domains']);
while(list($k,$v) = @each($GLOBALS['HTTP_POST_VARS']['domains']))
$domains = get_var('domains',Array('POST'));
@reset($domains);
while(list($k,$v) = @each($domains))
{
if(isset($GLOBALS['HTTP_POST_VARS']['deletedomain'][$v]))
$deletedomain = get_var('deletedomain',Array('POST'));
if(isset($deletedomain[$v]))
{
continue;
}
$dom = $GLOBALS['HTTP_POST_VARS']["setting_$v"];
$dom = get_var('setting_'.$v,Array('POST'));
if(!$dom['config_pass'])
{
$errors .= '<br>' . lang("You didn't enter a config password for domain x",$v);
}
}
if(!$GLOBALS['HTTP_POST_VARS']['setting']['HEADER_ADMIN_PASSWORD'])
$setting = get_var('setting',Array('POST'));
if(!$setting['HEADER_ADMIN_PASSWORD'])
{
$errors .= '<br>' . lang("You didn't enter a header admin password");
}
@ -114,7 +118,7 @@
break;
}
switch(@$GLOBALS['HTTP_POST_VARS']['action'])
switch(@$get_var('action',Array('POST')))
{
case 'download':
check_form_values();
@ -284,7 +288,7 @@
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'];
if(@$GLOBALS['HTTP_POST_VARS']['adddomain'])
if(@$adddomain)
{
$GLOBALS['phpgw_domain'][lang('new')] = array();
}

View File

@ -99,22 +99,22 @@
//var_dump($GLOBALS['setup_info']);exit;
@ksort($GLOBALS['setup_info']);
if ($HTTP_POST_VARS['cancel'])
if (get_var('cancel',Array('POST')))
{
Header('Location: index.php');
exit;
}
$ConfigDomain = $HTTP_COOKIE_VARS['ConfigDomain'] ? $HTTP_COOKIE_VARS['ConfigDomain'] : $HTTP_POST_VARS['ConfigDomain'];
$ConfigDomain = get_var('ConfigDomain',Array('POST','COOKIE'));
$GLOBALS['phpgw_setup']->html->show_header(lang("Developers' Table Schema Toy"),False,'config',$ConfigDomain);
if ($HTTP_POST_VARS['submit'])
if(get_var('submit',Array('POST')))
{
$GLOBALS['setup_tpl']->set_var('description',lang('App process') . ':');
$GLOBALS['setup_tpl']->pparse('out','header');
$appname = $HTTP_POST_VARS['appname'];
$install = $HTTP_POST_VARS['install'];
$appname = get_var('appname',Array('POST'));
$install = get_var('install',Array('POST'));
while (list($appname,$key) = @each($install))
{
@ -169,9 +169,9 @@
$GLOBALS['setup_tpl']->pparse('out','footer');
exit;
}
if($HTTP_POST_VARS['detail'])
$detail = get_var('detail',Array('POST'));
if($detail)
{
$detail = $HTTP_POST_VARS['detail'];
@ksort($GLOBALS['setup_info'][$detail]);
@reset($GLOBALS['setup_info'][$detail]);
$GLOBALS['setup_tpl']->set_var('description',lang('App details') . ':');

View File

@ -23,7 +23,7 @@
// Authorize the user to use setup app and load the database
// Does not return unless user is authorized
if(!$GLOBALS['phpgw_setup']->auth('Config') || $HTTP_POST_VARS['cancel'])
if(!$GLOBALS['phpgw_setup']->auth('Config') || get_var('cancel',Array('POST')))
{
Header('Location: index.php');
exit;
@ -45,7 +45,7 @@
return $GLOBALS['phpgw']->accounts->name2id($username);
}
if(!$HTTP_POST_VARS['submit'])
if(!get_var('submit',Array('POST')))
{
$tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
$setup_tpl = CreateObject('phpgwapi.Template',$tpl_root);
@ -82,11 +82,11 @@
else
{
/* Posted admin data */
$passwd = $HTTP_POST_VARS['passwd'];
$passwd2 = $HTTP_POST_VARS['passwd2'];
$username = $HTTP_POST_VARS['username'];
$fname = $HTTP_POST_VARS['fname'];
$lname = $HTTP_POST_VARS['lname'];
$passwd = get_var('passwd',Array('POST'));
$passwd2 = get_var('passwd2',Array('POST'));
$username = get_var('username',Array('POST'));
$fname = get_var('fname',Array('POST'));
$lname = get_var('lname',Array('POST'));
if($passwd != $passwd2)
{
@ -160,7 +160,7 @@
$GLOBALS['phpgw_setup']->db->query("INSERT INTO phpgw_acl(acl_appname,acl_location,acl_account,acl_rights) VALUES('manual','run'," . $defaultgroupid . ", 1)");
/* Creation of the demo accounts is optional - the checkbox is on by default. */
if($HTTP_POST_VARS['create_demo'])
if(get_var('create_demo',Array('POST')))
{
/* Create records for demo accounts */
$accountid = add_account('demo','Demo','Account','guest');

View File

@ -31,10 +31,10 @@
$tpl_root = $GLOBALS['phpgw_setup']->html->setup_tpl_dir('setup');
$setup_tpl = CreateObject('phpgwapi.Template',$tpl_root);
$download = $HTTP_POST_VARS['download'] ? $HTTP_POST_VARS['download'] : $HTTP_GET_VARS['download'];
$submit = $HTTP_POST_VARS['submit'] ? $HTTP_POST_VARS['submit'] : $HTTP_GET_VARS['submit'];
$showall = $HTTP_POST_VARS['showall'] ? $HTTP_POST_VARS['showall'] : $HTTP_GET_VARS['showall'];
$appname = $HTTP_POST_VARS['appname'] ? $HTTP_POST_VARS['appname'] : $HTTP_GET_VARS['appname'];
$download = get_var('download',Array('GET','POST'));
$submit = get_var('submit',Array('GET','POST'));
$showall = get_var('showall',Array('GET','POST'));
$appname = get_var('appname',Array('GET','POST'));
if ($download)
{
$setup_tpl->set_file(array(