diff options
author | Mario <mario@mariovavti.com> | 2021-03-16 12:32:20 +0100 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-03-16 12:32:20 +0100 |
commit | c658bbca2416bc1d3e51ef6072fea57151d40981 (patch) | |
tree | b32c1f0c209fc03654082a2be025d3ce7ca39815 | |
parent | 4e921cfdcfd6f021081a955855ecbafb1f30ec48 (diff) | |
download | volse-hubzilla-c658bbca2416bc1d3e51ef6072fea57151d40981.tar.gz volse-hubzilla-c658bbca2416bc1d3e51ef6072fea57151d40981.tar.bz2 volse-hubzilla-c658bbca2416bc1d3e51ef6072fea57151d40981.zip |
simplify get_pending_accounts query so that it will work in postgres. this will introduce a regression in rendering the table background color.
-rw-r--r-- | Zotlabs/Lib/Enotify.php | 2 | ||||
-rw-r--r-- | include/account.php | 17 | ||||
-rw-r--r-- | view/tpl/admin_accounts.tpl | 2 |
3 files changed, 14 insertions, 7 deletions
diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index b64ab2cc5..992eba000 100644 --- a/Zotlabs/Lib/Enotify.php +++ b/Zotlabs/Lib/Enotify.php @@ -983,7 +983,7 @@ class Enotify { 'photo' => z_root() . '/' . get_default_profile_photo(48), 'when' => datetime_convert('UTC', date_default_timezone_get(),$rr['reg_created']), 'hclass' => ('notify-unseen'), - 'message' => (($rr['reg_vfd'] === '× not yet') ? t('not yet verified') : t('verified')) . ', ' . t('requires approval') + 'message' => (($rr['reg_vfd']) ? t('verified') : t('not yet verified')) . ', ' . t('requires approval') ]; return $x; diff --git a/include/account.php b/include/account.php index b928a603e..1c66e1992 100644 --- a/include/account.php +++ b/include/account.php @@ -1256,11 +1256,18 @@ function zar_register_dutystate( $now=NULL, $day=NULL ) { } function get_pending_accounts() { - $r = q("SELECT @i:=@i+1 AS reg_n, @i MOD 2 AS reg_z, " - ." reg_did2, reg_created, reg_startup, reg_expires, reg_email, reg_atip, reg_hash, reg_id, " - ." CASE (reg_flags & %d) WHEN 0 THEN '✔ verified' WHEN 1 THEN '× not yet' END AS reg_vfd " - ." FROM register, (SELECT @i:=0) AS i " - ." WHERE reg_vital = 1 AND (reg_flags & %d) >= 0 ", + + /* get pending */ + // [hilmar -> + //~ $r = q("SELECT account.*, reg_hash FROM account LEFT JOIN register ON account_id = reg_uid WHERE reg_vital = 1 AND (account_flags & %d) > 0", + //~ intval(ACCOUNT_PENDING) + //~ ); + + // better useability at the moment to tell all (ACCOUNT_PENDING >= 0) instead of (> 0 for those need approval) + + $r = q("SELECT reg_did2, reg_created, reg_startup, reg_expires, reg_email, reg_atip, reg_hash, reg_id, + CASE (reg_flags & %d) WHEN 0 THEN 1 WHEN 1 THEN 0 END AS reg_vfd + FROM register WHERE reg_vital = 1 AND (reg_flags & %d) >= 0", intval(ACCOUNT_UNVERIFIED), intval(ACCOUNT_PENDING) ); diff --git a/view/tpl/admin_accounts.tpl b/view/tpl/admin_accounts.tpl index 8d6506184..444905fc7 100644 --- a/view/tpl/admin_accounts.tpl +++ b/view/tpl/admin_accounts.tpl @@ -21,7 +21,7 @@ <td class="created">{{$u.reg_created}}<br>{{$u.reg_n}} {{if $u.reg_expires < $now}} ★EXPIRED★{{/if}}</td> <td class="created">{{$u.reg_startup}}<br>{{$u.reg_expires}}</td> - <td class="email">{{$u.reg_did2}}<br>{{$u.reg_vfd}}</td> + <td class="email">{{$u.reg_did2}}<br>{{if $u.reg_vfd}}verified{{else}}not yet verified{{/if}}</td> <td class="email">{{$u.reg_email}}<br>{{$u.reg_atip}}</td> <td class="checkbox_bulkedit"><input type="checkbox" class="pending_ckbx" id="id_pending_{{$n}}" name="pending[]" value="{{$n}}"></td> <td class="tools"> |