Some more fixes to work with register_globals Off; Change one debug echo.

This commit is contained in:
Miles Lott 2001-08-31 22:29:23 +00:00
parent c126a0b01a
commit 43127662ab
5 changed files with 67 additions and 106 deletions

View File

@ -408,7 +408,7 @@
function GetSequenceForTable($oProc,$table,&$sSequenceName)
{
global $DEBUG;
if($DEBUG) { echo '<br>GetSequenceForTable: You rang?'; }
if($DEBUG) { echo '<br>GetSequenceForTable: ' . $table; }
$oProc->m_odb->query("SELECT relname FROM pg_class WHERE NOT relname ~ 'pg_.*' AND relname LIKE 'seq_$table' AND relkind='S' ORDER BY relname",__LINE__,__FILE__);
$oProc->m_odb->next_record();

View File

@ -82,27 +82,27 @@
$FormLogout == 'ldapimport' ||
$FormLogout == 'sqltoarray')
{
setcookie("ConfigPW"); // scrub the old one
setcookie("ConfigDomain"); // scrub the old one
setcookie("ConfigLang");
$phpgw_info["setup"]["ConfigLoginMSG"] = "You have successfully logged out";
setcookie('ConfigPW'); // scrub the old one
setcookie('ConfigDomain'); // scrub the old one
setcookie('ConfigLang');
$GLOBALS['phpgw_info']['setup']['ConfigLoginMSG'] = 'You have successfully logged out';
return False;
}
elseif($FormLogout == "header")
elseif($FormLogout == 'header')
{
setcookie("HeaderPW"); // scrub the old one
$phpgw_info["setup"]["HeaderLoginMSG"] = "You have successfully logged out";
setcookie('HeaderPW'); // scrub the old one
$GLOBALS['phpgw_info']['setup']['HeaderLoginMSG'] = 'You have successfully logged out';
return False;
}
}
elseif (isset($ConfigPW))
{
if ($ConfigPW != $phpgw_domain[$ConfigDomain]["config_passwd"] && $auth_type == "Config")
if ($ConfigPW != $phpgw_domain[$ConfigDomain]["config_passwd"] && $auth_type == 'Config')
{
setcookie("ConfigPW"); // scrub the old one
setcookie("ConfigDomain"); // scrub the old one
setcookie("ConfigLang");
$phpgw_info["setup"]["ConfigLoginMSG"] = "Invalid session cookie (cookies must be enabled)";
setcookie('ConfigPW'); // scrub the old one
setcookie('ConfigDomain'); // scrub the old one
setcookie('ConfigLang');
$phpgw_info['setup']['ConfigLoginMSG'] = 'Invalid session cookie (cookies must be enabled)';
return False;
}
else
@ -114,41 +114,41 @@
{
if (isset($ConfigLogin))
{
if ($FormPW == $phpgw_domain[$FormDomain]["config_passwd"] && $auth_type == "Config")
if ($FormPW == $phpgw_domain[$FormDomain]['config_passwd'] && $auth_type == 'Config')
{
setcookie("HeaderPW"); // scrub the old one
setcookie("ConfigPW",$FormPW);
setcookie("ConfigDomain",$FormDomain);
setcookie("ConfigLang",$ConfigLang);
setcookie('HeaderPW'); // scrub the old one
setcookie('ConfigPW',$FormPW);
setcookie('ConfigDomain',$FormDomain);
setcookie('ConfigLang',$ConfigLang);
$ConfigDomain = $FormDomain;
return True;
}
else
{
$phpgw_info["setup"]["ConfigLoginMSG"] = "Invalid password";
$phpgw_info['setup']['ConfigLoginMSG'] = 'Invalid password';
return False;
}
}
elseif (isset($HeaderLogin))
{
if ($FormPW == $phpgw_info["server"]["header_admin_password"] && $auth_type == "Header")
if ($FormPW == $phpgw_info['server']['header_admin_password'] && $auth_type == 'Header')
{
setcookie("HeaderPW",$FormPW);
setcookie('HeaderPW',$FormPW);
return True;
}
else
{
$phpgw_info["setup"]["HeaderLoginMSG"] = "Invalid password";
$GLOBALS['phpgw_info']['setup']['HeaderLoginMSG'] = 'Invalid password';
return False;
}
}
}
elseif (isset($HeaderPW))
{
if ($HeaderPW != $phpgw_info["server"]["header_admin_password"] && $auth_type == "Header")
if ($HeaderPW != $phpgw_info['server']['header_admin_password'] && $auth_type == 'Header')
{
setcookie("HeaderPW"); // scrub the old one
$phpgw_info["setup"]["HeaderLoginMSG"] = "Invalid session cookie (cookies must be enabled)";
setcookie('HeaderPW'); // scrub the old one
$GLOBALS['phpgw_info']['setup']['HeaderLoginMSG'] = 'Invalid session cookie (cookies must be enabled)';
return False;
}
else

View File

@ -33,8 +33,6 @@
function setup_tpl_dir($app_name='setup')
{
global $phpgw_info;
// hack to get tpl dir
if (is_dir(PHPGW_SERVER_ROOT))
{
@ -52,57 +50,48 @@
function show_header($title = '',$nologoutbutton = False, $logoutfrom = 'config', $configdomain = '')
{
global $phpgw_info, $setup_tpl, $HTTP_SERVER_VARS;
$setup_tpl->set_var('lang_charset',lang('charset'));
$GLOBALS['setup_tpl']->set_var('lang_charset',lang('charset'));
if ($nologoutbutton)
{
$btn_logout = '&nbsp;';
}
else
{
$btn_logout = '<a href="'.basename($HTTP_SERVER_VARS['REQUEST_URI']).'?FormLogout='.$logoutfrom.'" class="link">'.lang('Logout').'</a>';
$btn_logout = '<a href="'.basename($GLOBALS['HTTP_SERVER_VARS']['REQUEST_URI']).'?FormLogout='.$logoutfrom.'" class="link">'.lang('Logout').'</a>';
}
$setup_tpl->set_var('lang_setup', lang('setup'));
$setup_tpl->set_var('page_title',$title);
$GLOBALS['setup_tpl']->set_var('lang_setup', lang('setup'));
$GLOBALS['setup_tpl']->set_var('page_title',$title);
if ($configdomain == '')
{
$setup_tpl->set_var('configdomain',"");
$GLOBALS['setup_tpl']->set_var('configdomain',"");
}
else
{
$setup_tpl->set_var('configdomain',' - ' . lang('Domain') . ': '.$configdomain);
$GLOBALS['setup_tpl']->set_var('configdomain',' - ' . lang('Domain') . ': '.$configdomain);
}
$setup_tpl->set_var('pgw_ver',$phpgw_info['server']['versions']['phpgwapi']);
$setup_tpl->set_var('logoutbutton',$btn_logout);
$setup_tpl->pparse('out','T_head');
$GLOBALS['setup_tpl']->set_var('pgw_ver',$phpgw_info['server']['versions']['phpgwapi']);
$GLOBALS['setup_tpl']->set_var('logoutbutton',$btn_logout);
$GLOBALS['setup_tpl']->pparse('out','T_head');
//$setup_tpl->set_var('T_head','');
}
function show_footer()
{
global $phpgw_info, $setup_tpl;
$setup_tpl->pparse('out','T_footer');
unset($setup_tpl);
$GLOBALS['setup_tpl']->pparse('out','T_footer');
unset($GLOBALS['setup_tpl']);
}
function show_alert_msg($alert_word='Setup alert',$alert_msg='setup alert (generic)')
{
global $phpgw_info, $setup_tpl;
$setup_tpl->set_var('V_alert_word',$alert_word);
$setup_tpl->set_var('V_alert_msg',$alert_msg);
$setup_tpl->pparse('out','T_alert_msg');
$GLOBALS['setup_tpl']->set_var('V_alert_word',$alert_word);
$GLOBALS['setup_tpl']->set_var('V_alert_msg',$alert_msg);
$GLOBALS['setup_tpl']->pparse('out','T_alert_msg');
}
function make_frm_btn_simple($pre_frm_blurb='',$frm_method='POST',$frm_action='',$input_type='submit',$input_value='',$post_frm_blurb='')
{
// are these golbals necessary?
global $phpgw_info, $setup_tpl;
// a simple form has simple components
/* a simple form has simple components */
$simple_form =
$pre_frm_blurb ."\n"
.'<form method="'.$frm_method.'" action="'.$frm_action.'">' ."\n"
@ -114,10 +103,7 @@
function make_href_link_simple($pre_link_blurb='',$href_link='',$href_text='default text',$post_link_blurb='')
{
// are these golbals necessary?
global $phpgw_info, $setup_tpl;
// a simple href link has simple components
/* a simple href link has simple components */
$simple_link =
$pre_link_blurb
.'<a href="' .$href_link .'">' .$href_text .'</a> '
@ -127,54 +113,51 @@
function login_form()
{
global $phpgw_info, $phpgw_domain, $setup_tpl;
// begin use TEMPLATE login_main.tpl
$setup_tpl->set_var('ConfigLoginMSG',$phpgw_info['setup']['ConfigLoginMSG']);
$setup_tpl->set_var('HeaderLoginMSG',$phpgw_info['setup']['HeaderLoginMSG']);
$GLOBALS['setup_tpl']->set_var('ConfigLoginMSG',$GLOBALS['phpgw_info']['setup']['ConfigLoginMSG']);
$GLOBALS['setup_tpl']->set_var('HeaderLoginMSG',$GLOBALS['phpgw_info']['setup']['HeaderLoginMSG']);
if ($phpgw_info['setup']['stage']['header'] == '10')
if ($GLOBALS['phpgw_info']['setup']['stage']['header'] == '10')
{
// begin use SUB-TEMPLATE login_stage_header,
// fills V_login_stage_header used inside of login_main.tpl
$setup_tpl->set_var('lang_select',lang_select());
if (count($phpgw_domain) > 1)
$GLOBALS['setup_tpl']->set_var('lang_select',lang_select());
if (count($GLOBALS['phpgw_domain']) > 1)
{
// use BLOCK B_multi_domain inside of login_stage_header
$setup_tpl->parse('V_multi_domain','B_multi_domain');
$GLOBALS['setup_tpl']->parse('V_multi_domain','B_multi_domain');
// in this case, the single domain block needs to be nothing
$setup_tpl->set_var('V_single_domain','');
$GLOBALS['setup_tpl']->set_var('V_single_domain','');
}
else
{
reset($phpgw_domain);
$default_domain = each($phpgw_domain);
$setup_tpl->set_var('default_domain_zero',$default_domain[0]);
reset($GLOBALS['phpgw_domain']);
$default_domain = each($GLOBALS['phpgw_domain']);
$GLOBALS['setup_tpl']->set_var('default_domain_zero',$default_domain[0]);
// use BLOCK B_single_domain inside of login_stage_header
$setup_tpl->parse('V_single_domain','B_single_domain');
$GLOBALS['setup_tpl']->parse('V_single_domain','B_single_domain');
// // in this case, the multi domain block needs to be nothing
$setup_tpl->set_var('V_multi_domain','');
$GLOBALS['setup_tpl']->set_var('V_multi_domain','');
}
// end use SUB-TEMPLATE login_stage_header
// put all this into V_login_stage_header for use inside login_main
$setup_tpl->parse('V_login_stage_header','T_login_stage_header');
$GLOBALS['setup_tpl']->parse('V_login_stage_header','T_login_stage_header');
}
else
{
// begin SKIP SUB-TEMPLATE login_stage_header
$setup_tpl->set_var('V_multi_domain','');
$setup_tpl->set_var('V_single_domain','');
$setup_tpl->set_var('V_login_stage_header','');
$GLOBALS['setup_tpl']->set_var('V_multi_domain','');
$GLOBALS['setup_tpl']->set_var('V_single_domain','');
$GLOBALS['setup_tpl']->set_var('V_login_stage_header','');
}
// end use TEMPLATE login_main.tpl
// now out the login_main template
$setup_tpl->pparse('out','T_login_main');
$GLOBALS['setup_tpl']->pparse('out','T_login_main');
}
function get_template_list()
{
global $phpgw_info;
$d = dir(PHPGW_SERVER_ROOT . '/phpgwapi/templates');
//$list['user_choice']['name'] = 'user_choice';
//$list['user_choice']['title'] = 'Users Choice';
@ -187,7 +170,7 @@
if (file_exists ($f))
{
include($f);
$list[$entry]['title'] = 'Use ' . $phpgw_info['template'][$entry]['title'] . 'interface';
$list[$entry]['title'] = 'Use ' . $GLOBALS['phpgw_info']['template'][$entry]['title'] . 'interface';
}
else
{

View File

@ -34,7 +34,8 @@
*/
function phpgw_setup_lang()
{
global $ConfigLang;
$ConfigLang = $GLOBALS['HTTP_COOKIE_VARS']['ConfigLang'] ? $GLOBALS['HTTP_COOKIE_VARS']['ConfigLang'] : $GLOBALS['HTTP_POST_VARS']['ConfigLang'];
if(!$ConfigLang)
{
$lang = 'en';

View File

@ -38,7 +38,7 @@
$p9='_UNDEF_',$p10='_UNDEF_',$p11='_UNDEF_',$p12='_UNDEF_',
$p13='_UNDEF_',$p14='_UNDEF_',$p15='_UNDEF_',$p16='_UNDEF_')
{
global $phpgw_info, $phpgw, $phpgw_domain;
global $phpgw_info;
/* error_reporting(0); */
list($appname,$classname) = explode(".", $class);
@ -77,28 +77,6 @@
return $obj;
}
function oldCreateObject($classname, $constructor_param = "")
{
global $phpgw, $phpgw_info, $phpgw_domain;
$classpart = explode (".", $classname);
$appname = $classpart[0];
$classname = $classpart[1];
if (!$phpgw_info["flags"]["included_classes"][$classname])
{
$phpgw_info["flags"]["included_classes"][$classname] = True;
include(PHPGW_INCLUDE_ROOT."/".$appname."/inc/class.".$classname.".inc.php");
}
if ($constructor_param == "")
{
$obj = new $classname;
}
else
{
$obj = new $classname($constructor_param);
}
return $obj;
}
// This is needed is some parts of setup, until we include the API directly
function filesystem_separator()
{
@ -153,11 +131,10 @@
*/
function lang($key, $m1="", $m2="", $m3="", $m4="", $m5="", $m6="", $m7="", $m8="", $m9="", $m10="" )
{
global $phpgw_setup;
// # TODO: check if $m1 is of type array.
// If so, use it instead of $m2-$mN (Stephan)
$vars = array( $m1, $m2, $m3, $m4, $m5, $m6, $m7, $m8, $m9, $m10 );
$value = $phpgw_setup->translate("$key", $vars );
$value = $GLOBALS['phpgw_setup']->translate("$key", $vars );
return $value;
}
@ -195,7 +172,7 @@
function lang_select()
{
global $ConfigLang;
$ConfigLang = $GLOBALS['HTTP_COOKIE_VARS']['ConfigLang'] ? $GLOBALS['HTTP_COOKIE_VARS']['ConfigLang'] : $GLOBALS['HTTP_POST_VARS']['ConfigLang'];
$select = '<select name="ConfigLang">' . "\n";
$languages = get_langs();
@ -225,14 +202,14 @@
{
include(PHPGW_SERVER_ROOT.'/phpgwapi/setup/setup.inc.php'); // To set the current core version
// This will change to just use setup_info
$phpgw_info['server']['versions']['current_header'] = $setup_info['phpgwapi']['versions']['current_header'];
$GLOBALS['phpgw_info']['server']['versions']['current_header'] = $setup_info['phpgwapi']['versions']['current_header'];
}
else
{
$phpgw_info['server']['versions']['phpgwapi'] = 'Undetected';
$GLOBALS['phpgw_info']['server']['versions']['phpgwapi'] = 'Undetected';
}
$phpgw_info['server']['app_images'] = 'templates/default/images';
$GLOBALS['phpgw_info']['server']['app_images'] = 'templates/default/images';
include('./inc/class.setup.inc.php');
$phpgw_setup = new phpgw_setup;