Converting to get_var() for all HTTP_*_VARS.

This commit is contained in:
skeeter 2002-04-29 22:25:02 +00:00
parent f900167903
commit e3bf408609
7 changed files with 59 additions and 56 deletions

View File

@ -20,8 +20,8 @@
include('../header.inc.php'); include('../header.inc.php');
$n_passwd = $GLOBALS['HTTP_POST_VARS']['n_passwd']; $n_passwd = get_var('n_passwd',Array('POST'));
$n_passwd_2 = $GLOBALS['HTTP_POST_VARS']['n_passwd_2']; $n_passwd_2 = get_var('n_passwd_2',Array('POST'));
if (! $GLOBALS['phpgw']->acl->check('changepassword', 1)) if (! $GLOBALS['phpgw']->acl->check('changepassword', 1))
{ {
@ -38,25 +38,25 @@
$GLOBALS['phpgw']->template->set_var('lang_change',lang('Change')); $GLOBALS['phpgw']->template->set_var('lang_change',lang('Change'));
$GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/preferences/changepassword.php')); $GLOBALS['phpgw']->template->set_var('form_action',$GLOBALS['phpgw']->link('/preferences/changepassword.php'));
if ($GLOBALS['phpgw_info']['server']['auth_type'] != 'ldap') if($GLOBALS['phpgw_info']['server']['auth_type'] != 'ldap')
{ {
$GLOBALS['phpgw']->template->set_var('sql_message',lang('note: This feature does *not* change your email password. This will ' $GLOBALS['phpgw']->template->set_var('sql_message',lang('note: This feature does *not* change your email password. This will '
. 'need to be done manually.')); . 'need to be done manually.'));
} }
if ($GLOBALS['HTTP_POST_VARS']['submit']) if(get_var('submit',Array('POST')))
{ {
if ($n_passwd != $n_passwd_2) if($n_passwd != $n_passwd_2)
{ {
$errors[] = lang('The two passwords are not the same'); $errors[] = lang('The two passwords are not the same');
} }
if (! $n_passwd) if(! $n_passwd)
{ {
$errors[] = lang('You must enter a password'); $errors[] = lang('You must enter a password');
} }
if (is_array($errors)) if(is_array($errors))
{ {
$GLOBALS['phpgw']->common->phpgw_header(); $GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar(); echo parse_navbar();
@ -67,7 +67,7 @@
$o_passwd = $GLOBALS['phpgw_info']['user']['passwd']; $o_passwd = $GLOBALS['phpgw_info']['user']['passwd'];
$passwd_changed = $GLOBALS['phpgw']->auth->change_password($o_passwd, $n_passwd); $passwd_changed = $GLOBALS['phpgw']->auth->change_password($o_passwd, $n_passwd);
if (! $passwd_changed) if(!$passwd_changed)
{ {
// This need to be changed to show a different message based on the result // This need to be changed to show a different message based on the result
Header('Location: ' . $GLOBALS['phpgw']->link('/preferences/index.php','cd=38')); Header('Location: ' . $GLOBALS['phpgw']->link('/preferences/index.php','cd=38'));

View File

@ -27,10 +27,10 @@
$this->read_sessiondata($cats_app); $this->read_sessiondata($cats_app);
$start = $GLOBALS['HTTP_POST_VARS']['start'] ? $GLOBALS['HTTP_POST_VARS']['start'] : $GLOBALS['HTTP_GET_VARS']['start']; $start = get_var('start',Array('GET','POST'));
$query = $GLOBALS['HTTP_POST_VARS']['query'] ? $GLOBALS['HTTP_POST_VARS']['query'] : $GLOBALS['HTTP_GET_VARS']['query']; $query = get_var('query',Array('GET','POST'));
$sort = $GLOBALS['HTTP_POST_VARS']['sort'] ? $GLOBALS['HTTP_POST_VARS']['sort'] : $GLOBALS['HTTP_GET_VARS']['sort']; $sort = get_var('sort',Array('GET','POST'));
$order = $GLOBALS['HTTP_POST_VARS']['order'] ? $GLOBALS['HTTP_POST_VARS']['order'] : $GLOBALS['HTTP_GET_VARS']['order']; $order = get_var('order',Array('GET','POST'));
if(!empty($start) || $start == '0' || $start == 0) if(!empty($start) || $start == '0' || $start == 0)
{ {

View File

@ -25,7 +25,7 @@
function index() function index()
{ {
$acl_app = $GLOBALS['HTTP_GET_VARS']['acl_app']; $acl_app = get_vars('acl_app',Array('GET'));
$owner = $GLOBALS['owner']; $owner = $GLOBALS['owner'];
if (! $acl_app) if (! $acl_app)
@ -85,9 +85,9 @@
$this->acl = CreateObject('phpgwapi.acl',intval($owner)); $this->acl = CreateObject('phpgwapi.acl',intval($owner));
$this->acl->read_repository(); $this->acl->read_repository();
if ($GLOBALS['HTTP_POST_VARS']['submit']) if(get_var('submit',Array('POST')))
{ {
$processed = $GLOBALS['HTTP_POST_VARS']['processed']; $processed = get_var('processed',Array('POST'));
$to_remove = unserialize(urldecode($processed)); $to_remove = unserialize(urldecode($processed));
for($i=0;$i<count($to_remove);$i++) for($i=0;$i<count($to_remove);$i++)
@ -96,7 +96,7 @@
} }
/* Group records */ /* Group records */
$group_variable = $GLOBALS['HTTP_POST_VARS']['g_'.$GLOBALS['phpgw_info']['flags']['currentapp']]; $group_variable = get_var('g_'.$GLOBALS['phpgw_info']['flags']['currentapp'],Array('POST'));
if (!$group_variable) if (!$group_variable)
{ {
@ -122,9 +122,9 @@
} }
/* User records */ /* User records */
$user_variable = $GLOBALS['HTTP_POST_VARS']['u_'.$GLOBALS['phpgw_info']['flags']['currentapp']]; $user_variable = get_var('u_'.$GLOBALS['phpgw_info']['flags']['currentapp'],Array('POST'));
if (!$user_variable) if(!$user_variable)
{ {
$user_variable = array(); $user_variable = array();
} }

View File

@ -276,13 +276,13 @@
$GLOBALS['phpgw']->common->phpgw_header(); $GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar(); echo parse_navbar();
$new_parent = $GLOBALS['HTTP_POST_VARS']['new_parent']; $new_parent = get_var('new_parent',Array('POST'));
$submit = $GLOBALS['HTTP_POST_VARS']['submit']; $submit = get_var('submit',Array('POST'));
$cat_parent = $GLOBALS['HTTP_POST_VARS']['cat_parent'] ? $GLOBALS['HTTP_POST_VARS']['cat_parent'] : $GLOBALS['HTTP_GET_VARS']['cat_parent']; $cat_parent = get_var('cat_parent',Array('GET','POST'));
$cat_name = $GLOBALS['HTTP_POST_VARS']['cat_name']; $cat_name = get_var('cat_name',Array('POST'));
$cat_description = $GLOBALS['HTTP_POST_VARS']['cat_description']; $cat_description = get_var('cat_description',Array('POST'));
$cat_data = $GLOBALS['HTTP_POST_VARS']['cat_data']; $cat_data = get_var('cat_data',Array('POST'));
$cat_access = $GLOBALS['HTTP_POST_VARS']['cat_access']; $cat_access = get_var('cat_access',Array('POST'));
$this->t->set_file(array('form' => 'category_form.tpl')); $this->t->set_file(array('form' => 'category_form.tpl'));
$this->t->set_block('form','data_row','row'); $this->t->set_block('form','data_row','row');
@ -389,13 +389,13 @@
$GLOBALS['phpgw']->common->phpgw_header(); $GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar(); echo parse_navbar();
$new_parent = $GLOBALS['HTTP_POST_VARS']['new_parent']; $new_parent = get_var('new_parent',Array('POST'));
$submit = $GLOBALS['HTTP_POST_VARS']['submit']; $submit = get_var('submit',Array('POST'));
$cat_parent = $GLOBALS['HTTP_POST_VARS']['cat_parent']; $cat_parent = get_var('cat_parent',Array('POST'));
$cat_name = $GLOBALS['HTTP_POST_VARS']['cat_name']; $cat_name = get_var('cat_name',Array('POST'));
$cat_description = $GLOBALS['HTTP_POST_VARS']['cat_description']; $cat_description = get_var('cat_description',Array('POST'));
$cat_data = $GLOBALS['HTTP_POST_VARS']['cat_data']; $cat_data = get_var('cat_data',Array('POST'));
$cat_access = $GLOBALS['HTTP_POST_VARS']['cat_access']; $cat_access = get_var('cat_access',Array('POST'));
$this->t->set_file(array('form' => 'category_form.tpl')); $this->t->set_file(array('form' => 'category_form.tpl'));
$this->t->set_block('form','data_row','row'); $this->t->set_block('form','data_row','row');
@ -517,9 +517,9 @@
$this->bo->cats->app_name = $cats_app; $this->bo->cats->app_name = $cats_app;
if ($GLOBALS['HTTP_POST_VARS']['confirm']) if(get_var('confirm',Array('POST')))
{ {
if ($GLOBALS['HTTP_POST_VARS']['subs']) if(get_var('subs',Array('POST')))
{ {
$this->bo->delete($cat_id,True); $this->bo->delete($cat_id,True);
} }

View File

@ -19,6 +19,7 @@
'force_select' => 'Force Selectbox' 'force_select' => 'Force Selectbox'
); );
$out = '';
while (list ($key, $value) = each ($country)) while (list ($key, $value) = each ($country))
{ {
if ($config['countrylist'] == $key) if ($config['countrylist'] == $key)

View File

@ -41,13 +41,13 @@
$GLOBALS['phpgw']->session->appsession('session_data','preferences',$session_data); $GLOBALS['phpgw']->session->appsession('session_data','preferences',$session_data);
} }
if (! $GLOBALS['HTTP_GET_VARS']['type']) $type = get_var('type',Array('GET'));
if(!$type)
{ {
$type = $session_data['type']; $type = $session_data['type'];
} }
else else
{ {
$type = $GLOBALS['HTTP_GET_VARS']['type'];
$session_data = array('type' => $type); $session_data = array('type' => $type);
$GLOBALS['phpgw']->session->appsession('session_data','preferences',$session_data); $GLOBALS['phpgw']->session->appsession('session_data','preferences',$session_data);
} }

View File

@ -11,10 +11,6 @@
/* $Id$ */ /* $Id$ */
$user = (@isset($GLOBALS['HTTP_POST_VARS']['user'])?$GLOBALS['HTTP_POST_VARS']['user']:'');
$global = (@isset($GLOBALS['HTTP_POST_VARS']['global'])?$GLOBALS['HTTP_POST_VARS']['global']:'');
$default = (@isset($GLOBALS['HTTP_POST_VARS']['default'])?$GLOBALS['HTTP_POST_VARS']['default']:'');
$GLOBALS['phpgw_info']['flags'] = array( $GLOBALS['phpgw_info']['flags'] = array(
'noheader' => True, 'noheader' => True,
'noappheader' => True, 'noappheader' => True,
@ -24,7 +20,12 @@
); );
include('../header.inc.php'); include('../header.inc.php');
if ($GLOBALS['HTTP_POST_VARS']['cancel']) $user = get_var('user',Array('POST'));
$global = get_var('global',Array('POST'));
$default = get_var('default',Array('POST'));
$GLOBALS['appname'] = get_var('appname',Array('GET'));
if(get_var('cancel',Array('POST')))
{ {
Header('Location: ' . $GLOBALS['phpgw']->link('/preferences/index.php')); Header('Location: ' . $GLOBALS['phpgw']->link('/preferences/index.php'));
} }
@ -44,13 +45,13 @@
/* Some places we will need to change this if there in common */ /* Some places we will need to change this if there in common */
function check_app() function check_app()
{ {
if ($GLOBALS['HTTP_GET_VARS']['appname'] == 'preferences') if ($GLOBALS['appname'] == 'preferences')
{ {
return 'common'; return 'common';
} }
else else
{ {
return $GLOBALS['HTTP_GET_VARS']['appname']; return $GLOBALS['appname'];
} }
} }
@ -207,13 +208,14 @@
$GLOBALS['phpgw']->session->appsession('session_data','preferences',$session_data); $GLOBALS['phpgw']->session->appsession('session_data','preferences',$session_data);
} }
if (!isset($GLOBALS['HTTP_GET_VARS']['type'])) $type = get_vars('type',Array('GET'));
if (!isset($type))
{ {
$GLOBALS['type'] = $session_data['type']; $GLOBALS['type'] = $session_data['type'];
} }
else else
{ {
$GLOBALS['type'] = $GLOBALS['HTTP_GET_VARS']['type']; $GLOBALS['type'] = $type;
$session_data = array( $session_data = array(
'type' => $GLOBALS['type'] 'type' => $GLOBALS['type']
); );
@ -222,15 +224,15 @@
$tabs[] = array( $tabs[] = array(
'label' => lang('Your preferences'), 'label' => lang('Your preferences'),
'link' => $GLOBALS['phpgw']->link('/preferences/preferences.php','appname=' . $GLOBALS['HTTP_GET_VARS']['appname'] . '&type=user') 'link' => $GLOBALS['phpgw']->link('/preferences/preferences.php','appname=' . $GLOBALS['appname'] . '&type=user')
); );
$tabs[] = array( $tabs[] = array(
'label' => lang('Default preferences'), 'label' => lang('Default preferences'),
'link' => $GLOBALS['phpgw']->link('/preferences/preferences.php','appname=' . $GLOBALS['HTTP_GET_VARS']['appname'] . '&type=default') 'link' => $GLOBALS['phpgw']->link('/preferences/preferences.php','appname=' . $GLOBALS['appname'] . '&type=default')
); );
$tabs[] = array( $tabs[] = array(
'label' => lang('Forced preferences'), 'label' => lang('Forced preferences'),
'link' => $GLOBALS['phpgw']->link('/preferences/preferences.php','appname=' . $GLOBALS['HTTP_GET_VARS']['appname'] . '&type=forced') 'link' => $GLOBALS['phpgw']->link('/preferences/preferences.php','appname=' . $GLOBALS['appname'] . '&type=forced')
); );
switch($GLOBALS['type']) switch($GLOBALS['type'])
@ -253,7 +255,7 @@
$GLOBALS['dp']->read_repository(); $GLOBALS['dp']->read_repository();
} }
if ($GLOBALS['HTTP_POST_VARS']['submit']) if (get_var('submit',Array('POST')))
{ {
/* Don't use a switch here, we need to check some permissions durring the ifs */ /* Don't use a switch here, we need to check some permissions durring the ifs */
if ($GLOBALS['type'] == 'user') if ($GLOBALS['type'] == 'user')
@ -278,22 +280,22 @@
$GLOBALS['phpgw']->common->phpgw_header(); $GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar(); echo parse_navbar();
if ($GLOBALS['HTTP_GET_VARS']['appname'] == 'preferences') if ($GLOBALS['appname'] == 'preferences')
{ {
$t->set_var('lang_title',lang('Preferences')); $t->set_var('lang_title',lang('Preferences'));
} }
else else
{ {
$t->set_var('lang_title',lang('%1 - Preferences',$GLOBALS['phpgw_info']['navbar'][$GLOBALS['HTTP_GET_VARS']['appname']]['title'])); $t->set_var('lang_title',lang('%1 - Preferences',$GLOBALS['phpgw_info']['navbar'][$GLOBALS['appname']]['title']));
} }
$t->set_var('action_url',$GLOBALS['phpgw']->link('/preferences/preferences.php','appname=' . $GLOBALS['HTTP_GET_VARS']['appname'])); $t->set_var('action_url',$GLOBALS['phpgw']->link('/preferences/preferences.php','appname=' . $GLOBALS['appname']));
$t->set_var('th_bg', $GLOBALS['phpgw_info']['theme']['th_bg']); $t->set_var('th_bg', $GLOBALS['phpgw_info']['theme']['th_bg']);
$t->set_var('th_text',$GLOBALS['phpgw_info']['theme']['th_text']); $t->set_var('th_text',$GLOBALS['phpgw_info']['theme']['th_text']);
$t->set_var('row_on', $GLOBALS['phpgw_info']['theme']['row_on']); $t->set_var('row_on', $GLOBALS['phpgw_info']['theme']['row_on']);
$t->set_var('row_off',$GLOBALS['phpgw_info']['theme']['row_off']); $t->set_var('row_off',$GLOBALS['phpgw_info']['theme']['row_off']);
if ($GLOBALS['HTTP_GET_VARS']['appname'] == 'preferences') if ($GLOBALS['appname'] == 'preferences')
{ {
if (! $GLOBALS['phpgw']->hooks->single('settings','preferences',True)) if (! $GLOBALS['phpgw']->hooks->single('settings','preferences',True))
{ {
@ -302,7 +304,7 @@
} }
else else
{ {
if (! $GLOBALS['phpgw']->hooks->single('settings',$GLOBALS['HTTP_GET_VARS']['appname'])) if (! $GLOBALS['phpgw']->hooks->single('settings',$GLOBALS['appname']))
{ {
$error = True; $error = True;
} }
@ -311,8 +313,8 @@
if ($error) if ($error)
{ {
$t->set_var('messages',lang('Error: There was a problem finding the preference file for %1 in %2', $t->set_var('messages',lang('Error: There was a problem finding the preference file for %1 in %2',
$GLOBALS['phpgw_info']['navbar'][$GLOBALS['HTTP_GET_VARS']['appname']]['title'],PHPGW_SERVER_ROOT . SEP $GLOBALS['phpgw_info']['navbar'][$GLOBALS['appname']]['title'],PHPGW_SERVER_ROOT . SEP
. $GLOBALS['HTTP_GET_VARS']['appname'] . SEP . 'inc' . SEP . 'hook_settings.inc.php')); . $GLOBALS['appname'] . SEP . 'inc' . SEP . 'hook_settings.inc.php'));
} }
$t->pfp('out','header'); $t->pfp('out','header');