aboutsummaryrefslogtreecommitdiff
path: root/mod/uservalidationbyemail
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-03 02:13:36 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-03 02:13:36 +0000
commitdb7b497114329dda5f560198884c5bc5fbb3c1a8 (patch)
tree35ac7546fe14a8dd372e74d823ede01e24424443 /mod/uservalidationbyemail
parent6307e6af3b4a717011570e71b844c4b1e366fae5 (diff)
downloadelgg-db7b497114329dda5f560198884c5bc5fbb3c1a8.tar.gz
elgg-db7b497114329dda5f560198884c5bc5fbb3c1a8.tar.bz2
Fixes #2128 - replaces all uses of set_context() and get_context() in core and plugins
git-svn-id: http://code.elgg.org/elgg/trunk@7215 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/uservalidationbyemail')
-rw-r--r--mod/uservalidationbyemail/start.php14
1 files changed, 5 insertions, 9 deletions
diff --git a/mod/uservalidationbyemail/start.php b/mod/uservalidationbyemail/start.php
index 4596fd7d6..b0f621a84 100644
--- a/mod/uservalidationbyemail/start.php
+++ b/mod/uservalidationbyemail/start.php
@@ -66,8 +66,7 @@ function uservalidationbyemail_disable_new_user($hook, $type, $value, $params) {
// disable user to prevent showing up on the site
// set context to our canEdit() override works
- $context = get_context();
- set_context('uservalidationbyemail_new_user');
+ elgg_push_context('uservalidationbyemail_new_user');
$hidden_entities = access_get_show_hidden_status();
access_show_hidden_entities(TRUE);
@@ -81,7 +80,7 @@ function uservalidationbyemail_disable_new_user($hook, $type, $value, $params) {
uservalidationbyemail_set_user_validation_status($user->guid, FALSE);
uservalidationbyemail_request_validation($user->guid);
- set_context($context);
+ elgg_pop_context();
access_show_hidden_entities($hidden_entities);
return TRUE;
@@ -100,7 +99,7 @@ function uservalidationbyemail_allow_new_user_can_edit($hook, $type, $value, $pa
return NULL;
}
- $context = get_context();
+ $context = elgg_get_context();
if ($context == 'uservalidationbyemail_new_user' || $context = 'uservalidationbyemail_validate_user') {
return TRUE;
}
@@ -171,15 +170,12 @@ function uservalidationbyemail_page_handler($page) {
if (($code) && ($user)) {
if (uservalidationbyemail_validate_email($user_guid, $code)) {
- $context = get_context();
- set_context('uservalidationbyemail_validate_user');
-
+ elgg_push_context('uservalidationbyemail_validate_user');
system_message(elgg_echo('email:confirm:success'));
-
$user = get_entity($user_guid);
$user->enable();
+ elgg_pop_context();
- set_context($context);
login($user);
} else {
register_error(elgg_echo('email:confirm:fail'));