diff --git a/httprl.module b/httprl.module index c0bf1b5..b85dc4c 100644 --- a/httprl.module +++ b/httprl.module @@ -1989,3 +1989,28 @@ function httprl_call_exit() { exit; } } + +/** + * Sets the global user to the given user ID. + * + * @param $uid + * Integer specifying the user ID to load. + */ +function httprl_set_user($uid) { + global $user; + $account = user_load($uid); + if (!empty($account)) { + $user = $account; + return TRUE; + } +} + +/** + * Sets the global $_GET['q'] parameter. + * + * @param $q + * Internal URL. + */ +function httprl_set_q($q) { + $_GET['q'] = $q; +}