aboutsummaryrefslogtreecommitdiff
path: root/mod/uservalidationbyemail
diff options
context:
space:
mode:
authorCash Costello <cash.costello@gmail.com>2011-12-22 08:12:07 -0500
committerCash Costello <cash.costello@gmail.com>2011-12-22 08:12:07 -0500
commite49df853b2cc3a6a9bc2dd527a64951050142eb9 (patch)
tree6f485b560f89331c65fad3993e055a1834b07177 /mod/uservalidationbyemail
parent5e5b3705a5ca7b66dfe386490c5570af88b49009 (diff)
parentfea599f1653d7206e34ac33c0c0a668cb587bc20 (diff)
downloadelgg-e49df853b2cc3a6a9bc2dd527a64951050142eb9.tar.gz
elgg-e49df853b2cc3a6a9bc2dd527a64951050142eb9.tar.bz2
Merge branch '1.8' after 1.8.2 release
Conflicts: version.php
Diffstat (limited to 'mod/uservalidationbyemail')
-rw-r--r--mod/uservalidationbyemail/lib/functions.php8
-rw-r--r--mod/uservalidationbyemail/start.php11
2 files changed, 18 insertions, 1 deletions
diff --git a/mod/uservalidationbyemail/lib/functions.php b/mod/uservalidationbyemail/lib/functions.php
index eaca374f4..f3091f94d 100644
--- a/mod/uservalidationbyemail/lib/functions.php
+++ b/mod/uservalidationbyemail/lib/functions.php
@@ -87,7 +87,13 @@ function uservalidationbyemail_get_unvalidated_users_sql_where() {
global $CONFIG;
$validated_id = get_metastring_id('validated');
- $one_id = get_metastring_id(1);
+ if ($validated_id === false) {
+ $validated_id = add_metastring('validated');
+ }
+ $one_id = get_metastring_id('1');
+ if ($one_id === false) {
+ $one_id = add_metastring('1');
+ }
// thanks to daveb@freenode for the SQL tips!
$wheres = array();
diff --git a/mod/uservalidationbyemail/start.php b/mod/uservalidationbyemail/start.php
index 8de5d0522..ea59a2e7b 100644
--- a/mod/uservalidationbyemail/start.php
+++ b/mod/uservalidationbyemail/start.php
@@ -69,6 +69,17 @@ function uservalidationbyemail_disable_new_user($hook, $type, $value, $params) {
return;
}
+ // another plugin is requesting that registration be terminated
+ // no need for uservalidationbyemail
+ if (!$value) {
+ return $value;
+ }
+
+ // has the user already been validated?
+ if (elgg_get_user_validation_status($user->guid) == true) {
+ return $value;
+ }
+
// disable user to prevent showing up on the site
// set context so our canEdit() override works
elgg_push_context('uservalidationbyemail_new_user');