aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-16 02:20:08 +0000
committercash <cash@36083f99-b078-4883-b0ff-0f9b5a30f544>2010-11-16 02:20:08 +0000
commit0039bd344c40890a191279083bc3335e05274509 (patch)
tree32374be1d4cc3ec51c6f30a7d1e49d3f19de7dfc
parent89c57a8eeb223974a64dfbb28e6314e63a7fe9ec (diff)
downloadelgg-0039bd344c40890a191279083bc3335e05274509.tar.gz
elgg-0039bd344c40890a191279083bc3335e05274509.tar.bz2
Refs #2573 updates the uservalidationbyemail plugin to work with new validation metadata approach
git-svn-id: http://code.elgg.org/elgg/trunk@7327 36083f99-b078-4883-b0ff-0f9b5a30f544
-rw-r--r--mod/uservalidationbyemail/lib/functions.php26
-rw-r--r--mod/uservalidationbyemail/views/default/admin/users/unvalidated.php7
-rw-r--r--mod/uservalidationbyemail/views/default/uservalidationbyemail/unvalidated_user.php2
3 files changed, 5 insertions, 30 deletions
diff --git a/mod/uservalidationbyemail/lib/functions.php b/mod/uservalidationbyemail/lib/functions.php
index 38822595a..ea77c8d61 100644
--- a/mod/uservalidationbyemail/lib/functions.php
+++ b/mod/uservalidationbyemail/lib/functions.php
@@ -105,29 +105,3 @@ function uservalidationbyemail_get_user_validation_status($user_guid) {
return FALSE;
}
-
-/**
- * Returns all users who haven't been validated.
- *
- * "Unvalidated" means metadata of validated is not set or not truthy.
- * We can't use the elgg_get_entities_from_metadata() because you can't say
- * "where the entity has metadata set OR it's not equal to 1".
- *
- * This doesn't include any security, so should be called ONLY be admin users!
- * @return array
- */
-function uservalidationbyemail_get_unvalidated_users_sql_where() {
- global $CONFIG;
-
- $validated_id = get_metastring_id('validated');
- $one_id = get_metastring_id(1);
-
- // thanks to daveb@freenode for the SQL tips!
- $where = "NOT EXISTS (
- SELECT 1 FROM {$CONFIG->dbprefix}metadata md
- WHERE md.entity_guid = e.guid
- AND md.name_id = $validated_id
- AND md.value_id = $one_id)";
-
- return $where;
-} \ No newline at end of file
diff --git a/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php b/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php
index 756928d7c..0a274c1dc 100644
--- a/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php
+++ b/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php
@@ -12,9 +12,10 @@ $ia = elgg_set_ignore_access(TRUE);
$hidden_entities = access_get_show_hidden_status();
access_show_hidden_entities(TRUE);
-$users = elgg_get_entities(array(
+$users = elgg_get_entities_from_metadata(array(
'type' => 'user',
- 'wheres' => array(uservalidationbyemail_get_unvalidated_users_sql_where()),
+ 'metadata_name' => 'validated',
+ 'metadata_value' => 0,
'limit' => 9999,
));
@@ -23,7 +24,7 @@ elgg_set_ignore_access($ia);
if ($users) {
foreach ($users as $user) {
- $form_body .= elgg_view('uservalidationbyemail/unvalidated_user', array('user' => $user));
+ $form_body .= elgg_view('uservalidationbyemail/unvalidated_user', array('theuser' => $user));
}
} else {
echo elgg_echo('uservalidationbyemail:admin:no_unvalidated_users');
diff --git a/mod/uservalidationbyemail/views/default/uservalidationbyemail/unvalidated_user.php b/mod/uservalidationbyemail/views/default/uservalidationbyemail/unvalidated_user.php
index 5844fb5f4..75898b4e2 100644
--- a/mod/uservalidationbyemail/views/default/uservalidationbyemail/unvalidated_user.php
+++ b/mod/uservalidationbyemail/views/default/uservalidationbyemail/unvalidated_user.php
@@ -6,7 +6,7 @@
* @subpackage UserValidationByEmail.Administration
*/
-$user = elgg_get_array_value('user', $vars);
+$user = elgg_get_array_value('theuser', $vars);
// doesn't work.
//$checkbox = elgg_view('input/checkboxes', array(