From c658bbca2416bc1d3e51ef6072fea57151d40981 Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 16 Mar 2021 12:32:20 +0100 Subject: simplify get_pending_accounts query so that it will work in postgres. this will introduce a regression in rendering the table background color. --- include/account.php | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'include/account.php') 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) ); -- cgit v1.2.3