summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJennifer Hodgdon2012-11-07 15:25:58 (GMT)
committer Jennifer Hodgdon2012-11-07 15:25:58 (GMT)
commita524aa540c75fc10c5b7321223e475a1fef4b77c (patch)
tree72bfc34ed05689ea7361d63208a55e9f9d4455d4
parent681fe02ead837b50ef95b0bb767270492309ee0e (diff)
Issue #1827200 by benjifisher: Fix up documentation for system_authorized_init()
-rw-r--r--modules/system/system.module29
1 files changed, 21 insertions, 8 deletions
diff --git a/modules/system/system.module b/modules/system/system.module
index a8fb53f..d47ab8a 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -1740,16 +1740,27 @@ function _system_themes_access($theme) {
/**
* Setup a given callback to run via authorize.php with elevated privileges.
*
- * 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.
+ * To use authorize.php, certain variables must be stashed into $_SESSION. This
+ * function sets up all the necessary $_SESSION variables. The calling function
+ * should then redirect to authorize.php, using the full path returned by
+ * system_authorized_get_url(). 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. Example (system_authorized_run()):
+ * @code
+ * system_authorized_init($callback, $file, $arguments, $page_title);
+ * drupal_goto(system_authorized_get_url());
+ * @endcode
+ * Example (update_manager_install_form_submit()):
+ * @code
+ * system_authorized_init('update_authorize_run_install',
+ * drupal_get_path('module', 'update') . '/update.authorize.inc',
+ * $arguments, t('Update manager'));
+ * $form_state['redirect'] = system_authorized_get_url();
+ * @endcode
*
* @param $callback
- * The name of the function to invoke one the user authorizes the operation.
+ * The name of the function to invoke once the user authorizes the operation.
* @param $file
* The full path to the file where the callback function is implemented.
* @param $arguments
@@ -1786,6 +1797,8 @@ function system_authorized_init($callback, $file, $arguments = array(), $page_ti
* Optional array of options to pass to url().
* @return
* The full URL to authorize.php, using HTTPS if available.
+ *
+ * @see system_authorized_init()
*/
function system_authorized_get_url(array $options = array()) {
global $base_url;