From 86032f02dd623ccbf76fa919a9ff35721e0bed98 Mon Sep 17 00:00:00 2001 From: seek3r Date: Sat, 28 Sep 2002 20:01:44 +0000 Subject: [PATCH] removed common->phpgw_exit() and fixed all references to it in the core apps and api --- addressbook/inc/class.uiXport.inc.php | 3 +- addressbook/inc/class.uiaddressbook.inc.php | 18 ++++++--- addressbook/inc/class.uifields.inc.php | 12 ++++-- addressbook/inc/class.uivcard.inc.php | 6 ++- addressbook/inc/hook_home.inc.php | 3 +- addressbook/inc/hook_notifywindow.inc.php | 3 +- admin/inc/class.boaccounts.inc.php | 12 ++++-- admin/inc/class.boapplications.inc.php | 3 +- admin/inc/class.uiapplications.inc.php | 9 +++-- admin/inc/class.uiconfig.inc.php | 3 +- calendar/inc/class.bocalendar.inc.php | 12 +++--- calendar/inc/class.boicalendar.inc.php | 9 +++-- calendar/inc/class.bopreferences.inc.php | 3 +- calendar/inc/class.uicalendar.inc.php | 45 ++++++++++++--------- calendar/inc/hook_email.inc.php | 3 +- calendar/inc/hook_home.inc.php | 3 +- calendar/inc/hook_home_day.inc.php | 3 +- calendar/inc/hook_home_month.inc.php | 3 +- calendar/inc/hook_home_week.inc.php | 3 +- calendar/inc/hook_home_year.inc.php | 3 +- calendar/index.php | 3 +- calendar/preferences.php | 3 +- etemplate/doc/et_media/index.php | 3 +- etemplate/doc/etemplate.html | 5 ++- etemplate/inc/class.uietemplate_gtk.inc.php | 8 ++-- etemplate/index.php | 3 +- etemplate/phpGtk_test.php | 3 +- phpgwapi/inc/class.Template.inc.php | 3 +- phpgwapi/inc/class.app_registry.inc.php | 6 ++- phpgwapi/inc/class.common.inc.php | 26 +----------- phpgwapi/inc/class.db_mssql.inc.php | 2 +- phpgwapi/inc/class.db_mysql.inc.php | 2 +- phpgwapi/inc/class.db_pgsql.inc.php | 2 +- phpgwapi/inc/class.error.inc.php | 2 +- phpgwapi/inc/class.msg_base_sock.inc.php | 6 ++- phpgwapi/inc/class.msg_imap_sock.inc.php | 3 +- phpgwapi/inc/class.msg_pop3_sock.inc.php | 3 +- phpgwapi/inc/class.portalbox.inc.php | 3 +- phpgwapi/inc/functions.inc.php | 2 +- phpgwapi/inc/xml_functions.inc.php | 3 +- preferences/changepassword.php | 3 +- preferences/changeprofile.php | 3 +- preferences/inc/class.uiaclprefs.inc.php | 2 +- preferences/preferences.php | 3 +- set_box.php | 5 +-- setup/inc/class.Template.inc.php | 2 +- 46 files changed, 154 insertions(+), 114 deletions(-) diff --git a/addressbook/inc/class.uiXport.inc.php b/addressbook/inc/class.uiXport.inc.php index 579d09114d..fc63f90ab3 100644 --- a/addressbook/inc/class.uiXport.inc.php +++ b/addressbook/inc/class.uiXport.inc.php @@ -180,7 +180,8 @@ $GLOBALS['phpgw']->common->phpgw_header(); echo lang('No conversion type <none> could be located. Please choose a conversion type from the list'); echo ' ' . lang('OK') . ''; - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } $buffer = $this->bo->export($conv_type,$cat_id); diff --git a/addressbook/inc/class.uiaddressbook.inc.php b/addressbook/inc/class.uiaddressbook.inc.php index 006ebddaaf..12febd8c91 100644 --- a/addressbook/inc/class.uiaddressbook.inc.php +++ b/addressbook/inc/class.uiaddressbook.inc.php @@ -713,7 +713,8 @@ Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $ab_id . '&referer=' . $referer)); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } $GLOBALS['phpgw']->template->set_file(array('add' => 'add.tpl')); @@ -766,7 +767,8 @@ . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.view&ab_id=' . $_fields['ab_id'] . '&referer=' . $referer) ); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } /* First, make sure they have permission to this entry */ @@ -776,7 +778,8 @@ ($check[0]['owner'] != $GLOBALS['phpgw_info']['user']['account_id'])) { Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } /* Read in user custom fields, if any */ @@ -836,7 +839,8 @@ $check[0]['owner'] == $GLOBALS['phpgw_info']['user']['account_id'])) { Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } $GLOBALS['phpgw']->template->set_file(array('delete' => 'delete.tpl')); @@ -874,13 +878,15 @@ if((!$perms) && ($check[0]['owner'] != $GLOBALS['phpgw_info']['user']['account_id'])) { Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } if(!$ab_id) { Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } $GLOBALS['phpgw']->template->set_file(array('view_t' => 'view.tpl')); diff --git a/addressbook/inc/class.uifields.inc.php b/addressbook/inc/class.uifields.inc.php index 9c8cf39dac..82180e9662 100644 --- a/addressbook/inc/class.uifields.inc.php +++ b/addressbook/inc/class.uifields.inc.php @@ -35,7 +35,8 @@ { $GLOBALS['phpgw']->common->phpgw_header(); echo lang('access not permitted'); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } $GLOBALS['phpgw']->template->set_file(array( @@ -118,7 +119,8 @@ { $GLOBALS['phpgw']->common->phpgw_header(); echo lang('access not permitted'); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } $field = $GLOBALS['HTTP_POST_VARS']['field']; @@ -194,7 +196,8 @@ { $GLOBALS['phpgw']->common->phpgw_header(); echo lang('access not permitted'); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } $field = $GLOBALS['HTTP_POST_VARS']['field'] ? $GLOBALS['HTTP_POST_VARS']['field'] : $GLOBALS['HTTP_GET_VARS']['field']; @@ -287,7 +290,8 @@ { $GLOBALS['phpgw']->common->phpgw_header(); echo lang('access not permitted'); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } $field = $GLOBALS['HTTP_POST_VARS']['field'] ? $GLOBALS['HTTP_POST_VARS']['field'] : $GLOBALS['HTTP_GET_VARS']['field']; diff --git a/addressbook/inc/class.uivcard.inc.php b/addressbook/inc/class.uivcard.inc.php index 6fe648e82b..6d95c6c334 100644 --- a/addressbook/inc/class.uivcard.inc.php +++ b/addressbook/inc/class.uivcard.inc.php @@ -80,7 +80,8 @@ if(!$ab_id) { Header('Location: ' . $GLOBALS['phpgw']->link('/addressbook/index.php')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } // First, make sure they have permission to this entry @@ -95,7 +96,8 @@ if((!$perms) && ($check[0]['owner'] != $GLOBALS['phpgw_info']['user']['account_id'])) { Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.get_list')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } $extrafields = array('address2' => 'address2'); diff --git a/addressbook/inc/hook_home.inc.php b/addressbook/inc/hook_home.inc.php index 43d586c650..9062b69d70 100644 --- a/addressbook/inc/hook_home.inc.php +++ b/addressbook/inc/hook_home.inc.php @@ -15,7 +15,8 @@ if($d1 == 'htt' || $d1 == 'ftp' ) { echo "Failed attempt to break in via an old Security Hole!
\n"; - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } unset($d1); diff --git a/addressbook/inc/hook_notifywindow.inc.php b/addressbook/inc/hook_notifywindow.inc.php index 78f1cb2972..4a6986d3a2 100644 --- a/addressbook/inc/hook_notifywindow.inc.php +++ b/addressbook/inc/hook_notifywindow.inc.php @@ -15,7 +15,8 @@ if($d1 == 'htt' || $d1 == 'ftp' ) { echo "Failed attempt to break in via an old Security Hole!
\n"; - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } unset($d1); diff --git a/admin/inc/class.boaccounts.inc.php b/admin/inc/class.boaccounts.inc.php index 2c5bab2c06..54bd78884f 100755 --- a/admin/inc/class.boaccounts.inc.php +++ b/admin/inc/class.boaccounts.inc.php @@ -117,7 +117,8 @@ $GLOBALS['phpgw']->db->unlock(); Header('Location: '.$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } function delete_user() @@ -579,7 +580,8 @@ if($GLOBALS['phpgw']->acl->check('group_access',16,'admin') || $GLOBALS['HTTP_POST_VARS']['cancel']) { $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } elseif($GLOBALS['HTTP_POST_VARS']['submit']) { @@ -599,7 +601,8 @@ } } $GLOBALS['phpgw']->redirect($GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiaccounts.list_groups')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } function validate_group($group_info) @@ -632,7 +635,8 @@ { $ui = createobject('admin.uiaccounts'); $ui->create_edit_group($group_info,$errors); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } } diff --git a/admin/inc/class.boapplications.inc.php b/admin/inc/class.boapplications.inc.php index 356c2a60de..d2b1af8564 100644 --- a/admin/inc/class.boapplications.inc.php +++ b/admin/inc/class.boapplications.inc.php @@ -90,6 +90,7 @@ } } Header('Location: '.$GLOBALS['phpgw']->link('/admin/index.php')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } } diff --git a/admin/inc/class.uiapplications.inc.php b/admin/inc/class.uiapplications.inc.php index 115f274137..1d47bb2b65 100644 --- a/admin/inc/class.uiapplications.inc.php +++ b/admin/inc/class.uiapplications.inc.php @@ -196,7 +196,8 @@ )); Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.get_list')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } else { @@ -288,7 +289,8 @@ )); Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.get_list')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } } @@ -342,7 +344,8 @@ { $this->bo->delete($app_name); Header('Location: ' . $GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiapplications.get_list')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } $GLOBALS['phpgw']->common->phpgw_header(); diff --git a/admin/inc/class.uiconfig.inc.php b/admin/inc/class.uiconfig.inc.php index dee12b6b06..07032445ee 100644 --- a/admin/inc/class.uiconfig.inc.php +++ b/admin/inc/class.uiconfig.inc.php @@ -137,7 +137,8 @@ { $GLOBALS['phpgw']->session->appsession('session_data','admin_config',-1); Header('Location: ' . $_redir); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } } diff --git a/calendar/inc/class.bocalendar.inc.php b/calendar/inc/class.bocalendar.inc.php index cc8ebb977b..c4e6225e90 100755 --- a/calendar/inc/class.bocalendar.inc.php +++ b/calendar/inc/class.bocalendar.inc.php @@ -566,7 +566,7 @@ 'readsess' => 1 ) ); - $GLOBALS['phpgw']->common->phpgw_exit(True); + exit; } $overlapping_events = False; } @@ -575,7 +575,8 @@ if((!$l_cal['id'] && !$this->check_perms(PHPGW_ACL_ADD)) || ($l_cal['id'] && !$this->check_perms(PHPGW_ACL_EDIT,$l_cal['id']))) { ExecMethod('calendar.uicalendar.index'); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } print_debug('prior to fix_update_time()'); @@ -732,7 +733,7 @@ 'readsess' => 1 ) ); - $GLOBALS['phpgw']->common->phpgw_exit(True); + exit; } if($event['id']) @@ -765,7 +766,7 @@ 'this_event' => $event ) ); - $GLOBALS['phpgw']->common->phpgw_exit(True); + exit; } else { @@ -795,7 +796,8 @@ if($send_to_ui) { Execmethod('calendar.uicalendar.index'); -// $GLOBALS['phpgw']->common->phpgw_exit(); +// $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; +// exit; } } } diff --git a/calendar/inc/class.boicalendar.inc.php b/calendar/inc/class.boicalendar.inc.php index 0327468251..f5c24372d5 100755 --- a/calendar/inc/class.boicalendar.inc.php +++ b/calendar/inc/class.boicalendar.inc.php @@ -2903,7 +2903,8 @@ class boicalendar ) ) ); - $GLOBALS['phpwg']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } $uploaddir = $GLOBALS['phpgw_info']['server']['temp_dir'] . SEP; @@ -2940,7 +2941,8 @@ class boicalendar ) ) ); - $GLOBALS['phpwg']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } if(!is_object($GLOBALS['uicalendar'])) @@ -3202,7 +3204,8 @@ class boicalendar ) ) ); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } function export($l_event_id=0) diff --git a/calendar/inc/class.bopreferences.inc.php b/calendar/inc/class.bopreferences.inc.php index 9f2bbd9c2f..44caa45fb4 100755 --- a/calendar/inc/class.bopreferences.inc.php +++ b/calendar/inc/class.bopreferences.inc.php @@ -99,7 +99,8 @@ $GLOBALS['phpgw']->preferences->save_repository(True); Header('Location: '.$GLOBALS['phpgw']->link('/preferences/index.php')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } } } diff --git a/calendar/inc/class.uicalendar.inc.php b/calendar/inc/class.uicalendar.inc.php index 990a1d5c07..8bb02500fa 100755 --- a/calendar/inc/class.uicalendar.inc.php +++ b/calendar/inc/class.uicalendar.inc.php @@ -288,7 +288,8 @@ function index($params='') { Header('Location: '. $this->page('',$params)); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } function printer_friendly($body) @@ -642,13 +643,13 @@ if ($cal_id < 1) { echo lang('Invalid entry id.').''."\n"; - $GLOBALS['phpgw']->common->phpgw_exit(True); + exit; } if(!$this->bo->check_perms(PHPGW_ACL_READ,$cal_id)) { echo lang('You do not have permission to read this record!').''."\n"; - $GLOBALS['phpgw']->common->phpgw_exit(True); + exit; } $event = $this->bo->read_entry($cal_id); @@ -656,7 +657,7 @@ if(!isset($event['id'])) { echo lang("Sorry, this event does not exist").'.'.''."\n"; - $GLOBALS['phpgw']->common->phpgw_exit(True); + exit; } $this->bo->repeating_events = Array(); @@ -685,7 +686,7 @@ if($ret_value == '
'.lang('You do not have permission to read this record!').'
') { echo ''."\n"; - $GLOBALS['phpgw']->common->phpgw_exit(True); + exit; } $p = CreateObject('phpgwapi.Template',$this->template_dir); @@ -846,7 +847,8 @@ if(!$this->bo->can_user_edit($event)) { Header('Location: '.$this->page('view','&cal_id='.$cal_id)); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } if(@isset($GLOBALS['HTTP_POST_VARS']['edit_type']) && $GLOBALS['HTTP_POST_VARS']['edit_type'] == 'single') { @@ -878,7 +880,8 @@ if(!isset($GLOBALS['HTTP_POST_VARS']['cal_id']) || !$GLOBALS['HTTP_POST_VARS']['cal_id']) { Header('Location: '.$this->index()); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } $GLOBALS['phpgw_info']['flags']['noappheader'] = True; $GLOBALS['phpgw_info']['flags']['noappfooter'] = True; @@ -925,7 +928,8 @@ } Header('Location: '.$this->index()); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } } @@ -952,13 +956,13 @@ if ($cal_id < 1) { echo lang('Invalid entry id.').''."\n"; - $GLOBALS['phpgw']->common->phpgw_exit(True); + exit; } if(!$this->bo->check_perms(PHPGW_ACL_READ)) { echo lang('You do not have permission to read this record!').''."\n"; - $GLOBALS['phpgw']->common->phpgw_exit(True); + exit; } $event = $this->bo->read_entry($cal_id); @@ -966,12 +970,12 @@ if(!isset($event['id'])) { echo lang('Sorry, this event does not exist').'.'.''."\n"; - $GLOBALS['phpgw']->common->phpgw_exit(True); + exit; } elseif(!isset($event['recur_exception'])) { echo lang('Sorry, this event does not have exceptions defined').'.'.''."\n"; - $GLOBALS['phpgw']->common->phpgw_exit(True); + exit; } $ret_value = $this->view_event($event,True); @@ -980,7 +984,7 @@ if($ret_value == '
'.lang('You do not have permission to read this record!').'
') { echo ''."\n"; - $GLOBALS['phpgw']->common->phpgw_exit(True); + exit; } $p = CreateObject('phpgwapi.Template',$this->template_dir); @@ -1046,7 +1050,8 @@ echo ''."\n"; } Header('Location: '.$this->page('',($cd?'&cd='.$cd:''))); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } function add($cd=0,$readsess=0) @@ -1107,7 +1112,8 @@ if(!$cal_id) { Header('Location: '.$this->page('','&date='.sprintf("%04d%02d%02d",$this->bo->year,$this->bo->month,$this->bo->day))); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } $date = sprintf("%04d%02d%02d",$this->bo->year,$this->bo->month,$this->bo->day); @@ -1139,7 +1145,8 @@ $cd = ''; } Header('Location: '.$this->page('','&date='.$date.($cd?'&cd='.$cd:''))); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } function day() @@ -1260,7 +1267,8 @@ $this->bo->set_status(intval($GLOBALS['HTTP_GET_VARS']['cal_id']),intval($GLOBALS['HTTP_GET_VARS']['action'])); Header('Location: '.$this->page('','')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } function planner() @@ -2052,7 +2060,8 @@ // If we reach this, it is because they didn't search for anything, // attempt to send them back to where they where. Header('Location: ' . $GLOBALS['phpgw']->link($from)); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } unset($GLOBALS['phpgw_info']['flags']['noheader']); diff --git a/calendar/inc/hook_email.inc.php b/calendar/inc/hook_email.inc.php index 57bb54be78..39b79dc28a 100755 --- a/calendar/inc/hook_email.inc.php +++ b/calendar/inc/hook_email.inc.php @@ -20,7 +20,8 @@ if($d1 == 'htt' || $d1 == 'ftp') { echo 'Failed attempt to break in via an old Security Hole!
'."\n"; - $phpgw->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } unset($d1); diff --git a/calendar/inc/hook_home.inc.php b/calendar/inc/hook_home.inc.php index 2d0be8791a..bcb4892975 100755 --- a/calendar/inc/hook_home.inc.php +++ b/calendar/inc/hook_home.inc.php @@ -18,7 +18,8 @@ if($d1 == 'htt' || $d1 == 'ftp' ) { echo 'Failed attempt to break in via an old Security Hole!
'."\n"; - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } unset($d1); diff --git a/calendar/inc/hook_home_day.inc.php b/calendar/inc/hook_home_day.inc.php index 0bcf11f2dd..f076743241 100755 --- a/calendar/inc/hook_home_day.inc.php +++ b/calendar/inc/hook_home_day.inc.php @@ -18,7 +18,8 @@ if($d1 == 'htt' || $d1 == 'ftp' ) { echo 'Failed attempt to break in via an old Security Hole!
'."\n"; - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } unset($d1); diff --git a/calendar/inc/hook_home_month.inc.php b/calendar/inc/hook_home_month.inc.php index 8e1c0bc356..b98c6fe8b2 100755 --- a/calendar/inc/hook_home_month.inc.php +++ b/calendar/inc/hook_home_month.inc.php @@ -18,7 +18,8 @@ if($d1 == 'htt' || $d1 == 'ftp' ) { echo 'Failed attempt to break in via an old Security Hole!
'."\n"; - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } unset($d1); diff --git a/calendar/inc/hook_home_week.inc.php b/calendar/inc/hook_home_week.inc.php index 22c5334047..27e56e7290 100755 --- a/calendar/inc/hook_home_week.inc.php +++ b/calendar/inc/hook_home_week.inc.php @@ -18,7 +18,8 @@ if($d1 == 'htt' || $d1 == 'ftp' ) { echo 'Failed attempt to break in via an old Security Hole!
'."\n"; - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } unset($d1); diff --git a/calendar/inc/hook_home_year.inc.php b/calendar/inc/hook_home_year.inc.php index ce157329be..a7c67772f2 100755 --- a/calendar/inc/hook_home_year.inc.php +++ b/calendar/inc/hook_home_year.inc.php @@ -18,7 +18,8 @@ if($d1 == 'htt' || $d1 == 'ftp' ) { echo 'Failed attempt to break in via an old Security Hole!
'."\n"; - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } unset($d1); diff --git a/calendar/index.php b/calendar/index.php index 3fc9006138..848d7b7047 100755 --- a/calendar/index.php +++ b/calendar/index.php @@ -37,5 +37,6 @@ ); Header('Location: '.$GLOBALS['phpgw']->link('/index.php',$parms)); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; ?> diff --git a/calendar/preferences.php b/calendar/preferences.php index deccb7629f..1ed4e686c5 100644 --- a/calendar/preferences.php +++ b/calendar/preferences.php @@ -88,7 +88,8 @@ $phpgw->preferences->save_repository(True); Header('Location: '.$phpgw->link('/preferences/index.php')); - $phpgw->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } function display_item($field,$data) diff --git a/etemplate/doc/et_media/index.php b/etemplate/doc/et_media/index.php index 04d24e3e65..e246ae33b7 100644 --- a/etemplate/doc/et_media/index.php +++ b/etemplate/doc/et_media/index.php @@ -20,4 +20,5 @@ include('../header.inc.php'); header('Location: '.$GLOBALS['phpgw']->link('/index.php','menuaction=et_media.et_media.edit')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; diff --git a/etemplate/doc/etemplate.html b/etemplate/doc/etemplate.html index d5bf10e792..b79c0129b6 100644 --- a/etemplate/doc/etemplate.html +++ b/etemplate/doc/etemplate.html @@ -146,7 +146,8 @@ Create the file /et_media/index.php with the following content:

include('../header.inc.php'); header('Location: '.$GLOBALS['phpgw']->link('/index.php','menuaction=et_media.et_media.edit')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit;

7. the code of class.et_media.inc.php

@@ -483,4 +484,4 @@ a new version automaticaly.

That's it - please contact me if you have further questions or comments about the tutorial

- \ No newline at end of file + diff --git a/etemplate/inc/class.uietemplate_gtk.inc.php b/etemplate/inc/class.uietemplate_gtk.inc.php index aac9f18b84..bd1cf84d61 100644 --- a/etemplate/inc/class.uietemplate_gtk.inc.php +++ b/etemplate/inc/class.uietemplate_gtk.inc.php @@ -171,14 +171,14 @@ } /* - * Called when the window is being destroyed: destroy the session and let phpgw_exit close the db-connection + * Called when the window is being destroyed: destroy the session */ function destroy() { Gtk::main_quit(); $GLOBALS['phpgw']->session->destroy($GLOBALS['phpgw_info']['user']['sessionid'],$GLOBALS['phpgw_info']['user']['kp3']); - $GLOBALS['phpgw']->common->phpgw_exit(); - exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } function button_clicked(&$var,$form_name) @@ -775,4 +775,4 @@ } return $hbox ? $hbox : $widget; } - }; \ No newline at end of file + }; diff --git a/etemplate/index.php b/etemplate/index.php index 26b1d52042..c9b2c24f47 100644 --- a/etemplate/index.php +++ b/etemplate/index.php @@ -20,5 +20,6 @@ include('../header.inc.php'); header('Location: '.$GLOBALS['phpgw']->link('/index.php','menuaction=etemplate.editor.edit')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; ?> diff --git a/etemplate/phpGtk_test.php b/etemplate/phpGtk_test.php index ee17840ca3..5c640ff76a 100755 --- a/etemplate/phpGtk_test.php +++ b/etemplate/phpGtk_test.php @@ -41,4 +41,5 @@ $GLOBALS['phpgw_info']['flags']['currentapp'] = 'etemplate'; ExecMethod('etemplate.db_tools.edit'); -$GLOBALS['phpgw']->common->phpgw_exit(); +$GLOBALS['phpgw_info']['flags']['nodisplay'] = True; +exit; diff --git a/phpgwapi/inc/class.Template.inc.php b/phpgwapi/inc/class.Template.inc.php index 6632270059..6e9d5c34ab 100644 --- a/phpgwapi/inc/class.Template.inc.php +++ b/phpgwapi/inc/class.Template.inc.php @@ -481,7 +481,8 @@ echo('Halted.'); } - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } /* public, override: haltmsg($msg) diff --git a/phpgwapi/inc/class.app_registry.inc.php b/phpgwapi/inc/class.app_registry.inc.php index 5dd7c7d8de..ea8cc48038 100755 --- a/phpgwapi/inc/class.app_registry.inc.php +++ b/phpgwapi/inc/class.app_registry.inc.php @@ -169,12 +169,14 @@ if (!$resp) { echo '

IO error: '.$this->client->errstr.'

'; - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } if ($resp->faultCode()) { echo '

There was an error: '.$resp->faultCode().' '.$resp->faultString().'

'; - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } return xmlrpc_decode($resp->value()); } diff --git a/phpgwapi/inc/class.common.inc.php b/phpgwapi/inc/class.common.inc.php index e676283478..aa21bd9f73 100644 --- a/phpgwapi/inc/class.common.inc.php +++ b/phpgwapi/inc/class.common.inc.php @@ -301,28 +301,6 @@ return $ds; } - // This function is used if the developer wants to stop a running app in the middle of execution - // We may need to do some clean up before hand - /*! - @function phpgw_exit - @abstract function to stop running an app - @discussion used to stop running an app in the middle of execution
- There may need to be some cleanup before hand - @param $call_footer boolean value to if true then call footer else exit - */ - function phpgw_exit($call_footer = False) - { - if ($call_footer) - { - $this->phpgw_footer(); - } - else - { - $GLOBALS['phpgw']->db->disconnect(); - } - exit; - } - /*! @function randomstring @abstract return a random string of size $size @@ -1518,10 +1496,11 @@ if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info' { $this->phpgw_appfooter(); } - $GLOBALS['phpgw']->db->disconnect(); $this->phpgw_header(); $GLOBALS['phpgw']->template->pfp('out','phpgw_main_end'); } + + $GLOBALS['phpgw']->db->disconnect(); /* Clean up mcrypt */ if (@is_object($GLOBALS['phpgw']->crypto)) @@ -1536,7 +1515,6 @@ if (!@is_file(PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info' echo 'Page loaded in ' . ($GLOBALS['debug_timer_stop'] - $GLOBALS['debug_timer_start']) . ' seconds.'; } } -// echo 'an app is trying to run the phpgw_footer() more than once
'; } function hex2bin($data) diff --git a/phpgwapi/inc/class.db_mssql.inc.php b/phpgwapi/inc/class.db_mssql.inc.php index 2193745fbd..25ee5d3799 100644 --- a/phpgwapi/inc/class.db_mssql.inc.php +++ b/phpgwapi/inc/class.db_mssql.inc.php @@ -356,7 +356,7 @@ if($this->Halt_On_Error != "report") { echo "

Session halted."; - $GLOBALS['phpgw']->common->phpgw_exit(True); + exit; } } diff --git a/phpgwapi/inc/class.db_mysql.inc.php b/phpgwapi/inc/class.db_mysql.inc.php index 2c1562ab07..622b8ddea2 100644 --- a/phpgwapi/inc/class.db_mysql.inc.php +++ b/phpgwapi/inc/class.db_mysql.inc.php @@ -561,7 +561,7 @@ if($this->Halt_On_Error != 'report') { echo '

Session halted.'; - $GLOBALS['phpgw']->common->phpgw_exit(True); + exit; } } diff --git a/phpgwapi/inc/class.db_pgsql.inc.php b/phpgwapi/inc/class.db_pgsql.inc.php index 968795629b..975b4db755 100644 --- a/phpgwapi/inc/class.db_pgsql.inc.php +++ b/phpgwapi/inc/class.db_pgsql.inc.php @@ -540,7 +540,7 @@ else { echo $s; - $GLOBALS['phpgw']->common->phpgw_exit(True); + exit; } } diff --git a/phpgwapi/inc/class.error.inc.php b/phpgwapi/inc/class.error.inc.php index a3490ef357..335b4e3b66 100755 --- a/phpgwapi/inc/class.error.inc.php +++ b/phpgwapi/inc/class.error.inc.php @@ -108,7 +108,7 @@ echo ""; // Commit stack to log $GLOBALS['phpgw']->log->commit(); - $GLOBALS['phpgw']->common->phpgw_exit(True); + exit; } } } diff --git a/phpgwapi/inc/class.msg_base_sock.inc.php b/phpgwapi/inc/class.msg_base_sock.inc.php index ef817b49d9..99aad412e4 100644 --- a/phpgwapi/inc/class.msg_base_sock.inc.php +++ b/phpgwapi/inc/class.msg_base_sock.inc.php @@ -380,7 +380,8 @@ { echo 'Error: '.$this->error['code'].' : '.$this->error['msg'].' - '.$this->error['desc']."
\r\n"; $this->close(); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } // REDUNDANT FUNCTION FROM NON-SOCK CLASS @@ -1066,7 +1067,8 @@ { if ($i==count($str)-1 && $str[$i] == "`") { - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } $pos=1; $d=0; diff --git a/phpgwapi/inc/class.msg_imap_sock.inc.php b/phpgwapi/inc/class.msg_imap_sock.inc.php index 9ec55fba02..7690a7cf31 100644 --- a/phpgwapi/inc/class.msg_imap_sock.inc.php +++ b/phpgwapi/inc/class.msg_imap_sock.inc.php @@ -381,7 +381,8 @@ if (!$this->open_port($server,$port,15)) { echo '

' .lang('There was an error trying to connect to your IMAP server.
Please contact your admin to check the servername, username or password.') .'
'; - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } else { diff --git a/phpgwapi/inc/class.msg_pop3_sock.inc.php b/phpgwapi/inc/class.msg_pop3_sock.inc.php index 80994a620b..72430c89ff 100644 --- a/phpgwapi/inc/class.msg_pop3_sock.inc.php +++ b/phpgwapi/inc/class.msg_pop3_sock.inc.php @@ -119,7 +119,8 @@ if (!$this->open_port($server,$port,15)) { echo '

' . lang('There was an error trying to connect to your POP3 server.
Please contact your admin to check the servername, username or password.').'
'; - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } $this->read_port(); if(!$this->msg2socket('USER '.$user,"^\+ok",&$response) || !$this->msg2socket('PASS '.$pass,"^\+ok",&$response)) diff --git a/phpgwapi/inc/class.portalbox.inc.php b/phpgwapi/inc/class.portalbox.inc.php index 306fce5cf1..fbd3b90620 100755 --- a/phpgwapi/inc/class.portalbox.inc.php +++ b/phpgwapi/inc/class.portalbox.inc.php @@ -72,7 +72,8 @@ if ($var=='' || !isset($this->$var)) { echo 'Programming Error: '.$this->getvar('classname').'->getvar('.$var.')!
'."\n"; - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } //echo "Var = ".$var."
\n"; //echo $var." = ".$this->$var."
\n"; diff --git a/phpgwapi/inc/functions.inc.php b/phpgwapi/inc/functions.inc.php index 842eb02144..7a6a38d6ed 100644 --- a/phpgwapi/inc/functions.inc.php +++ b/phpgwapi/inc/functions.inc.php @@ -577,7 +577,7 @@ $GLOBALS['phpgw_info']['flags']['msgbox_data']['Access not permitted']=False; $continue_app_data = False; $GLOBALS['phpgw']->template->set_var('phpgw_body',"user has no rights to this app!!!
\n"); - $GLOBALS['phpgw']->common->phpgw_exit(True); + exit; } } if($continue_app_data) diff --git a/phpgwapi/inc/xml_functions.inc.php b/phpgwapi/inc/xml_functions.inc.php index e6f83c3e89..5414f3bb2c 100644 --- a/phpgwapi/inc/xml_functions.inc.php +++ b/phpgwapi/inc/xml_functions.inc.php @@ -115,7 +115,8 @@ Header('Content-type: text/xml'); Header('Content-length: ' . strlen($payload)); print $payload; - $GLOBALS['phpgw']->common->phpgw_exit(False); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } // used to store state during parsing diff --git a/preferences/changepassword.php b/preferences/changepassword.php index 4e192f971b..daaced2710 100755 --- a/preferences/changepassword.php +++ b/preferences/changepassword.php @@ -26,7 +26,8 @@ if (! $GLOBALS['phpgw']->acl->check('changepassword', 1)) { Header('Location: ' . $GLOBALS['phpgw']->link('/preferences/index.php/')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } $GLOBALS['phpgw']->template->set_file(array( diff --git a/preferences/changeprofile.php b/preferences/changeprofile.php index 4c69d11e52..be38370215 100644 --- a/preferences/changeprofile.php +++ b/preferences/changeprofile.php @@ -23,7 +23,8 @@ if ($GLOBALS['phpgw_info']['user']['permissions']['anonymous']) { Header('Location: ' . $GLOBALS['phpgw']->link('/')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } if ($submit) diff --git a/preferences/inc/class.uiaclprefs.inc.php b/preferences/inc/class.uiaclprefs.inc.php index aa5e61932f..764219f639 100644 --- a/preferences/inc/class.uiaclprefs.inc.php +++ b/preferences/inc/class.uiaclprefs.inc.php @@ -56,7 +56,7 @@ if ($GLOBALS['phpgw_info']['server']['deny_user_grants_access']) { echo '
' . lang('Access not permitted') . '
'; - $GLOBALS['phpgw']->common->phpgw_exit(True); + exit; } /* diff --git a/preferences/preferences.php b/preferences/preferences.php index 014608f8b5..4421966414 100755 --- a/preferences/preferences.php +++ b/preferences/preferences.php @@ -275,7 +275,8 @@ } Header('Location: ' . $GLOBALS['phpgw']->link('/preferences/index.php')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; } $GLOBALS['phpgw']->common->phpgw_header(); diff --git a/set_box.php b/set_box.php index 8735bd9255..300b138d3f 100755 --- a/set_box.php +++ b/set_box.php @@ -22,7 +22,6 @@ // if(basename($HTTP_REFERER) != 'home.php') // { // Header('Location: '.$GLOBALS['phpgw']->link('/home.php')); -// $GLOBALS['phpgw']->common->phpgw_exit(); // } // $GLOBALS['phpgw']->preferences->delete('portal_order'); @@ -103,6 +102,6 @@ } Header('Location: '.$GLOBALS['phpgw']->link('/home.php')); - $GLOBALS['phpgw']->common->phpgw_exit(); + $GLOBALS['phpgw_info']['flags']['nodisplay'] = True; + exit; ?> - diff --git a/setup/inc/class.Template.inc.php b/setup/inc/class.Template.inc.php index d2e701521d..84a37808ad 100644 --- a/setup/inc/class.Template.inc.php +++ b/setup/inc/class.Template.inc.php @@ -437,7 +437,7 @@ echo('Halted.'); } - $GLOBALS['phpgw']->common->phpgw_exit(True); + exit; } /* public, override: haltmsg($msg)