summaryrefslogtreecommitdiff
path: root/modules/system/system.module
diff options
context:
space:
mode:
authorAngie Byron <webchick@24967.no-reply.drupal.org>2009-11-01 23:02:13 +0000
committerAngie Byron <webchick@24967.no-reply.drupal.org>2009-11-01 23:02:13 +0000
commit14c1c505e0b5915ff85f0698afc209f530fd83fb (patch)
treefb56f39b8ccf4ea846977b50c07845b5b80cc911 /modules/system/system.module
parentfedcd1acf0f1ee126febe211e8a1f47c27282956 (diff)
downloadbrdo-14c1c505e0b5915ff85f0698afc209f530fd83fb.tar.gz
brdo-14c1c505e0b5915ff85f0698afc209f530fd83fb.tar.bz2
#607008 by dww, Gerhard Killesreiter, JacobSingh, and chx: Changed Fix bugs in https support and use https for authorize.php if available.
Diffstat (limited to 'modules/system/system.module')
-rw-r--r--modules/system/system.module24
1 files changed, 22 insertions, 2 deletions
diff --git a/modules/system/system.module b/modules/system/system.module
index c7be27e97..76ea92269 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -1504,10 +1504,19 @@ function system_authorized_init($callback, $file, $arguments = array(), $page_ti
/**
* Return the URL for the authorize.php script.
+ *
+ * @param array $options
+ * Optional array of options to pass to url().
+ * @return
+ * The full URL to authorize.php, using https if available.
*/
-function system_authorized_get_url() {
+function system_authorized_get_url(array $options = array()) {
global $base_url;
- return $base_url . '/authorize.php';
+ // Force https if available, regardless of what the caller specifies.
+ $options['https'] = TRUE;
+ // We prefix with $base_url so we get a full path even if clean URLs are
+ // disabled.
+ return url($base_url . '/authorize.php', $options);
}
/**
@@ -1521,6 +1530,17 @@ function system_authorized_run($callback, $file, $arguments = array(), $page_tit
}
/**
+ * Use authorize.php to run batch_process().
+ *
+ * @see batch_process()
+ */
+function system_authorized_batch_process() {
+ $finish_url = system_authorized_get_url();
+ $process_url = system_authorized_get_url(array('query' => array('batch' => '1')));
+ batch_process($finish_url, $process_url);
+}
+
+/**
* @} End of "defgroup authorize".
*/