Skip to content
Snippets Groups Projects
Commit a524aa54 authored by Jennifer Hodgdon's avatar Jennifer Hodgdon
Browse files

Issue #1827200 by benjifisher: Fix up documentation for system_authorized_init()

parent 681fe02e
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment