[Bug 911] New - horde/lib/Maintenance.php uses exit instead of return in runMaintenance()

bugs@bugs.horde.org bugs@bugs.horde.org
Mon, 18 Mar 2002 23:02:39 -0400


http://bugs.horde.org/show_bug.cgi?id=911

*** shadow/911	Mon Mar 18 23:02:38 2002
--- shadow/911.tmp.31228	Mon Mar 18 23:02:38 2002
***************
*** 0 ****
--- 1,74 ----
+ Bug#: 911
+ Product: Horde
+ Version: 2.0 Stable
+ Platform: PHP Code
+ OS/Version: HP-UX
+ Status: NEW   
+ Resolution: 
+ Severity: minor
+ Priority: P4
+ Component: Core
+ Area: BUILD
+ AssignedTo: chuck@horde.org                            
+ ReportedBy: lodder@yacc.com.au               
+ URL: 
+ Summary: horde/lib/Maintenance.php uses exit instead of return in runMaintenance()
+ 
+ NB This is my second attempt to log this...
+ 
+ horde/lib/Maintenance.php uses exit instead of return in runMaintenance()
+ 
+ The first time the mailbox is displayed for the user session, IMP checks to see 
+ if any maintenance tasks need to be run. under certain conditions the code does 
+ an exit rather than a return. This results in the user just sitting there until 
+ a refresh is done.
+ 
+ When the exit is changed to a return, the user gets shown their mailbox and is 
+ notified of their last login date and time.
+ 
+ The code fragment is below. The problem is around line 160 in the file.
+ 
+     function runMaintenance()
+     {
+         global $prefs, $registry, $HTTP_SERVER_VARS;
+ 
+         /* Get the list of tasks available during this login.
+            If no tasks present, we can return now. */
+         $tasks = $this->availableMaintenance();
+         if (empty($tasks)) return;
+ 
+         /* Go to the confirmation page if it has not already been displayed
+            -AND- there is at least one configuration option that is user
+            changable. */
+         if (!$this->confirm_page) {
+             $confirmation = $this->confirmationMaintenance();
+             if (!empty($confirmation)) {
+                 if (!empty($HTTP_SERVER_VARS['QUERY_STRING'])) {
+                     $getvars = urlencode($HTTP_SERVER_VARS['QUERY_STRING']);
+                 }
+                 header('Location: ' . Horde::url($registry->getWebRoot
+ ('horde') . '/maintenance.php?m
+ odule=' . $this->horde_module . '&getvars=' . $getvars, true));
+                 /* Ged 
+                 exit;  
+                 */
+                 return;
+             }
+         }
+ 
+ 
+ The config I am running is:
+       hpux 11.00 parisc1.1 (32 bit)
+       Apache/1.3.23 (Unix) PHP/4.1.2 mod_ssl/2.8.7 OpenSSL/0.9.6c
+       mySQL 3.23.42
+       horde 2.0
+       imp 3.0
+       turba 1.0
+ 
+ 
+ I hope this helps
+ 
+ Cheers
+ 
+ Ged Lodder
+