From a38ed2f62c919592a9c6cdb301e3e1d77daf0037 Mon Sep 17 00:00:00 2001 From: jengo Date: Sun, 24 Dec 2000 00:30:41 +0000 Subject: [PATCH] Fixed msg->status not reporting the correct number of new messages --- calendar/inc/footer.inc.php | 2 +- calendar/preferences.php | 2 +- calendar/search.php | 4 ++-- calendar/view.php | 2 +- phpgwapi/inc/phpgw_common.inc.php | 19 ++++++++++--------- preferences/changepassword.php | 6 +++--- preferences/changeprofile.php | 2 +- preferences/changetheme.php | 2 +- preferences/settings.php | 2 +- 9 files changed, 21 insertions(+), 20 deletions(-) diff --git a/calendar/inc/footer.inc.php b/calendar/inc/footer.inc.php index 0af4cd8867..87dabf6886 100644 --- a/calendar/inc/footer.inc.php +++ b/calendar/inc/footer.inc.php @@ -13,7 +13,7 @@ if (isset($friendly) && $friendly){ $phpgw->common->phpgw_footer(); - exit; + $phpgw->common->phpgw_exit(); } if (!isset($phpgw_info["flags"]["nocalendarheader"]) || diff --git a/calendar/preferences.php b/calendar/preferences.php index 37ffb4a26a..53cac136e3 100644 --- a/calendar/preferences.php +++ b/calendar/preferences.php @@ -31,7 +31,7 @@ $phpgw->preferences->commit(); Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/preferences/index.php")); - exit; + $phpgw->common->phpgw_exit(); } $phpgw->common->phpgw_header(); diff --git a/calendar/search.php b/calendar/search.php index 7ca0481dc3..98d29cd709 100755 --- a/calendar/search.php +++ b/calendar/search.php @@ -30,7 +30,7 @@ echo "".lang("Error").":"; echo lang("You must enter one or more search keywords."); $phpgw->common->phpgw_footer(); - exit; + $phpgw->common->phpgw_exit(); } $matches = 0; @@ -97,7 +97,7 @@ echo "".lang("Error").":"; echo $error; $phpgw->common->phpgw_footer(); - exit; + $phpgw->common->phpgw_exit(); } $phpgw->template->set_file(array("search_t" => "search.tpl", diff --git a/calendar/view.php b/calendar/view.php index 937dc87907..ee98c8cb9f 100755 --- a/calendar/view.php +++ b/calendar/view.php @@ -18,7 +18,7 @@ if ($id < 1) { echo lang("Invalid entry id."); - exit; + $phpgw->common->phpgw_exit(); } function add_day(&$repeat_days,$day) { diff --git a/phpgwapi/inc/phpgw_common.inc.php b/phpgwapi/inc/phpgw_common.inc.php index 7db2f90805..9b1d4e195c 100644 --- a/phpgwapi/inc/phpgw_common.inc.php +++ b/phpgwapi/inc/phpgw_common.inc.php @@ -43,15 +43,6 @@ 'gdm' => True, 'named' => True); - // 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() - { - global $phpgw; - - $phpgw->db->disconnect(); - exit; - } // I had to create this has a wrapper, becuase the phpgw.inc.php files needs it before the classes // are finished loading (jengo) @@ -104,6 +95,16 @@ 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() + { + global $phpgw; + + $phpgw->db->disconnect(); + exit; + } + function randomstring($size) { $s = ""; diff --git a/preferences/changepassword.php b/preferences/changepassword.php index 0343249690..55c6a8ba87 100755 --- a/preferences/changepassword.php +++ b/preferences/changepassword.php @@ -19,7 +19,7 @@ if (!$phpgw->acl->check("changepassword", 1)){ Header("Location: index.php"); - exit; + $phpgw->common->phpgw_exit(); } if (! $submit) { @@ -70,7 +70,7 @@ if ($error) { $phpgw->common->navbar(); echo "


$error

"; - exit; + $phpgw->common->phpgw_exit(); } if ($phpgw_info["server"]["auth_type"] == "sql") { @@ -83,7 +83,7 @@ if (! @ldap_bind($ldap, $phpgw_info["server"]["ldap_root_dn"], $phpgw_info["server"]["ldap_root_pw"])) { echo "

Error binding to LDAP server. Check your config"; - exit; + $phpgw->common->phpgw_exit(); } $entry["userpassword"] = $phpgw->common->encrypt_password($n_passwd); diff --git a/preferences/changeprofile.php b/preferences/changeprofile.php index f7f7166e66..de170d9c7f 100644 --- a/preferences/changeprofile.php +++ b/preferences/changeprofile.php @@ -20,7 +20,7 @@ include("../header.inc.php"); if ($phpgw_info["user"]["permissions"]["anonymous"]) { Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/")); - exit; + $phpgw->common->phpgw_exit(); } if ($submit) { diff --git a/preferences/changetheme.php b/preferences/changetheme.php index 17bdc69333..91e900369f 100755 --- a/preferences/changetheme.php +++ b/preferences/changetheme.php @@ -25,7 +25,7 @@ } else { Header("Location: " . $phpgw->link("changetheme.php")); } - exit; + $phpgw->common->phpgw_exit(); } $dh = opendir($phpgw_info["server"]["server_root"] . "/phpgwapi/themes"); diff --git a/preferences/settings.php b/preferences/settings.php index 4665f24893..6d8cc7decb 100755 --- a/preferences/settings.php +++ b/preferences/settings.php @@ -218,7 +218,7 @@ if ($phpgw_info["server"]["useframes"] != "never") { Header("Location: " . $phpgw->link($phpgw_info["server"]["webserver_url"] . "/index.php")); - exit; + $phpgw->common->phpgw_exit(); } Header("Location: " . $phpgw->link("index.php"));