cvs diff: Diffing modules/system
Index: modules/system/system.module
===================================================================
RCS file: /Users/wright/drupal/local_repo/drupal/modules/system/system.module,v
retrieving revision 1.825
diff -u -p -r1.825 system.module
--- modules/system/system.module	24 Oct 2009 05:38:28 -0000	1.825
+++ modules/system/system.module	24 Oct 2009 10:11:02 -0000
@@ -1442,12 +1442,13 @@ function _system_themes_access($theme) {
 /**
  * Invoke a given callback via authorize.php to run with elevated privileges.
  *
- * To use authorize.php, certain variables must be stashed into
- * $_SESSION. This function sets up all the necessary $_SESSION variables,
- * then redirects to authorize.php to initiate the workflow that will
- * eventually lead to the callback being invoked. The callback will be invoked
- * at a low bootstrap level, without all modules being invoked, so it needs to
- * be careful not to assume any code exists.
+ * To use authorize.php, certain variables must be stashed into $_SESSION.
+ * This function sets up all the necessary $_SESSION variables, then returns
+ * the full path to authorize.php so the caller can redirect to authorize.php.
+ * That initiates the workflow that will eventually lead to the callback being
+ * invoked. The callback will be invoked at a low bootstrap level, without all
+ * modules being invoked, so it needs to be careful not to assume any code
+ * exists.
  *
  * @param $callback
  *   The name of the function to invoke one the user authorizes the operation.
@@ -1460,7 +1461,7 @@ function _system_themes_access($theme) {
  * @param $page_title
  *   Optional string to use as the page title once redirected to authorize.php.
  * @return
- *   Nothing. This function redirects to authorize.php and does not return.
+ *   The path to authorize.php that the caller should redirect to.
  */
 function system_run_authorized($callback, $file, $arguments = array(), $page_title = NULL) {
   global $base_url;
@@ -1481,8 +1482,8 @@ function system_run_authorized($callback
     $_SESSION['authorize_operation']['page_title'] = $page_title;
   }
 
-  // Finally, redirect to authorize.php.
-  drupal_goto($base_url . '/authorize.php');
+  // Return the path to authorize.php so the caller can redirect as needed.
+  return $base_url . '/authorize.php';
 }
 
 /**
cvs diff: Diffing modules/update
Index: modules/update/update.manager.inc
===================================================================
RCS file: /Users/wright/drupal/local_repo/drupal/modules/update/update.manager.inc,v
retrieving revision 1.3
diff -u -p -r1.3 update.manager.inc
--- modules/update/update.manager.inc	24 Oct 2009 03:03:44 -0000	1.3
+++ modules/update/update.manager.inc	24 Oct 2009 10:13:31 -0000
@@ -425,7 +425,7 @@ function update_manager_confirm_update_f
       );
     }
 
-    system_run_authorized('update_authorize_run_update', drupal_get_path('module', 'update') . '/update.authorize.inc', array($updates));
+    $form_state['redirect'] = system_run_authorized('update_authorize_run_update', drupal_get_path('module', 'update') . '/update.authorize.inc', array($updates));
   }
 }
 
@@ -551,7 +551,7 @@ function update_manager_install_form_sub
     'local_url' => drupal_realpath($project_location),
   );
 
-  return system_run_authorized('update_authorize_run_install', drupal_get_path('module', 'update') . '/update.authorize.inc', $arguments);
+  $form_state['redirect'] = system_run_authorized('update_authorize_run_install', drupal_get_path('module', 'update') . '/update.authorize.inc', $arguments);
 }
 
 /**
cvs diff: Diffing modules/update/tests
