diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-10-06 14:35:29 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-10-06 14:35:29 +0000 |
commit | 91b1bc93352e5cfedbf9e1866d140f0ef2b29e4c (patch) | |
tree | a5301989dbec32c9b24e05bccc9a15cf23d1d75a | |
parent | 6606581f431f52330b8bcc28e1aa1b55a4b5b408 (diff) | |
download | elgg-91b1bc93352e5cfedbf9e1866d140f0ef2b29e4c.tar.gz elgg-91b1bc93352e5cfedbf9e1866d140f0ef2b29e4c.tar.bz2 |
Merged some fixes from the 1.7.4 backport of uservalidationbyemail.
git-svn-id: http://code.elgg.org/elgg/trunk@7023 36083f99-b078-4883-b0ff-0f9b5a30f544
4 files changed, 19 insertions, 5 deletions
diff --git a/mod/uservalidationbyemail/actions/validate.php b/mod/uservalidationbyemail/actions/validate.php index c50053dce..cc4554722 100644 --- a/mod/uservalidationbyemail/actions/validate.php +++ b/mod/uservalidationbyemail/actions/validate.php @@ -28,7 +28,7 @@ foreach ($user_guids as $guid) { $is_validated = uservalidationbyemail_get_user_validation_status($guid); $validate_success = uservalidationbyemail_set_user_validation_status($guid, TRUE); - if (!$is_validated || !$validate_success || !$user->enable()) { + if ($is_validated || !($validate_success && $user->enable())) { $error = TRUE; continue; } diff --git a/mod/uservalidationbyemail/lib/functions.php b/mod/uservalidationbyemail/lib/functions.php index 4ba5d13b7..92b37c843 100644 --- a/mod/uservalidationbyemail/lib/functions.php +++ b/mod/uservalidationbyemail/lib/functions.php @@ -113,7 +113,13 @@ function uservalidationbyemail_set_user_validation_status($user_guid, $status, $ * @return int|null */ function uservalidationbyemail_get_user_validation_status($user_guid) { - return get_metadata_byname($user_guid, 'validated'); + $md = get_metadata_byname($user_guid, 'validated'); + + if ($md && $md->value) { + return TRUE; + } + + return FALSE; } /** diff --git a/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php b/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php index bfd4a8d2e..dff1487e7 100644 --- a/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php +++ b/mod/uservalidationbyemail/views/default/admin/users/unvalidated.php @@ -8,12 +8,19 @@ // @todo pagination would be nice. // can't use elgg_list_entities() and friends because we don't use the default view for users. +$ia = elgg_set_ignore_access(TRUE); +$hidden_entities = access_get_show_hidden_status(); +access_show_hidden_entities(TRUE); + $users = elgg_get_entities(array( 'type' => 'user', 'wheres' => array(uservalidationbyemail_get_unvalidated_users_sql_where()), 'limit' => 9999, )); +access_show_hidden_entities($hidden_entities); +elgg_set_ignore_access($ia); + if ($users) { foreach ($users as $user) { $form_body .= elgg_view('uservalidationbyemail/unvalidated_user', array('user' => $user)); @@ -29,7 +36,8 @@ $form_body .= elgg_echo('uservalidationbyemail:admin:with_checked') . elgg_view( 'validate' => elgg_echo('uservalidationbyemail:admin:validate'), 'resend_validation' => elgg_echo('uservalidationbyemail:admin:resend_validation'), 'delete' => elgg_echo('uservalidationbyemail:admin:delete'), - ) + ), + 'value' => 'resend_validation', )); $form_body .= '<br />' . elgg_view('input/button', array('value' => elgg_echo('submit'))); diff --git a/mod/uservalidationbyemail/views/default/uservalidationbyemail/unvalidated_user.php b/mod/uservalidationbyemail/views/default/uservalidationbyemail/unvalidated_user.php index 06c4e633e..368be6ab9 100644 --- a/mod/uservalidationbyemail/views/default/uservalidationbyemail/unvalidated_user.php +++ b/mod/uservalidationbyemail/views/default/uservalidationbyemail/unvalidated_user.php @@ -41,12 +41,12 @@ $delete = elgg_view('output/confirmlink', array( ?> <div class="admin_settings radius8" style="border: 1px solid black; padding: 5px;"> + <?php echo $checkbox; ?><br /> + <div class="uservalidationbyemail_unvalidated_controls" style="float: right"> <?php echo "$resend_email | $validate | $delete"; ?> </div> - <?php echo $checkbox; ?> - <div class="uservalidationbyemail_unvalidated_user_details" style="margin-left: 15px; font-size: smaller;"> <?php echo $created; ?> </div> |