aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-04-19 19:07:50 +0000
committerMario <mario@mariovavti.com>2021-04-19 19:07:50 +0000
commit20ca6676d291cf03e6790d6ec5106c10712dd6e8 (patch)
tree371ff03a1c9cb4fafbdbc5ecb3a08b30d3089a4e
parenteded0f6c09475a138e042de4f6845d54e7a6e60c (diff)
downloadvolse-hubzilla-20ca6676d291cf03e6790d6ec5106c10712dd6e8.tar.gz
volse-hubzilla-20ca6676d291cf03e6790d6ec5106c10712dd6e8.tar.bz2
volse-hubzilla-20ca6676d291cf03e6790d6ec5106c10712dd6e8.zip
registration: reveal possibility to show all registrations in the UI
-rw-r--r--Zotlabs/Module/Admin/Accounts.php12
-rw-r--r--include/account.php2
-rw-r--r--view/tpl/admin_accounts.tpl19
3 files changed, 20 insertions, 13 deletions
diff --git a/Zotlabs/Module/Admin/Accounts.php b/Zotlabs/Module/Admin/Accounts.php
index 76d332268..4d32beee1 100644
--- a/Zotlabs/Module/Admin/Accounts.php
+++ b/Zotlabs/Module/Admin/Accounts.php
@@ -235,6 +235,13 @@ class Accounts {
$pending[$n]['reg_atip_n'] = $atipn[$v['reg_atip']];
}
+ $pending[$n]['status'] = '';
+ if($pending[$n]['reg_flags'] & ACCOUNT_UNVERIFIED > 0)
+ $pending[$n]['status'] = [t('Unverified'), 'bg-warning'];
+
+ if($pending[$n]['status'] && $pending[$n]['reg_expires'] < datetime_convert())
+ $pending[$n]['status'] = [t('Expired'), 'bg-danger text-white'];
+
// timezone adjust date_time for display
$pending[$n]['reg_created'] = datetime_convert('UTC', date_default_timezone_get(), $pending[$n]['reg_created']);
$pending[$n]['reg_startup'] = datetime_convert('UTC', date_default_timezone_get(), $pending[$n]['reg_startup']);
@@ -300,11 +307,12 @@ class Accounts {
'$title' => t('Administration'),
'$page' => t('Accounts'),
'$submit' => t('Submit'),
- '$select_all' => t('select all'),
+ '$get_all' => (($get_all) ? t('Show verified registrations') : t('Show all registrations')),
+ '$get_all_link' => (($get_all) ? z_root() .'/admin/accounts' : z_root() .'/admin/accounts?get_all'),
'$sel_tall' => t('Select toggle'),
'$sel_deny' => t('Deny selected'),
'$sel_aprv' => t('Approve selected'),
- '$h_pending' => t('Verified registrations waiting for approval'),
+ '$h_pending' => (($get_all) ? t('All registrations') : t('Verified registrations waiting for approval')),
'$th_pending' => array(t('Request date'), 'dId2', t('Email'), 'IP', t('Requests')),
'$no_pending' => t('No verified registrations.'),
'$approve' => t('Approve'),
diff --git a/include/account.php b/include/account.php
index a7a87f331..349c6cfee 100644
--- a/include/account.php
+++ b/include/account.php
@@ -1276,7 +1276,7 @@ function get_pending_accounts($get_all = false) {
if($get_all)
$sql_extra = '';
- $r = q("SELECT reg_did2, reg_created, reg_startup, reg_expires, reg_email, reg_atip, reg_hash, reg_id, reg_stuff
+ $r = q("SELECT reg_did2, reg_created, reg_startup, reg_expires, reg_email, reg_atip, reg_hash, reg_id, reg_flags, reg_stuff
FROM register WHERE reg_vital = 1 $sql_extra AND (reg_flags & %d) >= 0",
intval(ACCOUNT_PENDING)
);
diff --git a/view/tpl/admin_accounts.tpl b/view/tpl/admin_accounts.tpl
index 490468e79..815a6f6f3 100644
--- a/view/tpl/admin_accounts.tpl
+++ b/view/tpl/admin_accounts.tpl
@@ -17,9 +17,9 @@
</thead>
<tbody>
{{foreach $pending as $n => $u}}
- <tr class="">
+ <tr title="{{$u.status.0}}" class="{{$u.status.1}}">
<td class="text-nowrap">{{$u.reg_created}}</td>
- <td class="text-break">{{$u.reg_did2}}</td>
+ <td class="text-nowrap">{{$u.reg_did2}}</td>
<td class="text-break">{{$u.reg_email}}</td>
<td class="">{{$u.reg_atip}}</td>
<td class="">{{$u.reg_atip_n}}</td>
@@ -30,27 +30,26 @@
<span id="zarreax_{{$n}}" class="zarreax"></span>
</td>
</tr>
- <tr>
+ <tr title="{{$u.status.0}}" class="{{$u.status.1}}">
<td colspan="7"><strong>{{$msg}}:</strong> {{$u.msg}}</td>
</tr>
{{/foreach}}
</tbody>
</table>
- {{* before, alternate:
- *
- <a href="#" onclick="return toggle_selectall('pending_ckbx');">{{$select_all}}</a>
- *
- *}}
- <div class="selectall">
+ <div class="float-left">
+ <a class="btn btn-link" href="{{$get_all_link}}">{{$get_all}}</a>
+ </div>
+ <div class="float-right">
<a id="zar2sat" class="btn btn-sm btn-primary" href="javascript:;">{{$sel_tall}}</a>
<a id="zar2aas" class="zar2xas btn btn-sm btn-success" href="javascript:;"><i class="fa fa-check"></i> {{$sel_aprv}}</a>
<a id="zar2das" class="zar2xas btn btn-sm btn-danger" href="javascript:;"><i class="fa fa-close"></i> {{$sel_deny}}</a>
</div>
+ <div class="clearfix"></div>
{{else}}
<p>{{$no_pending}}</p>
{{/if}}
-
+ <br><br>
<h3>{{$h_users}}</h3>
{{if $users}}
<table id="users">