aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-04-16 18:13:20 +0000
committerMario <mario@mariovavti.com>2021-04-16 18:13:20 +0000
commit88f7c2041d74d82db5c84b45f30e1eb64dfcc216 (patch)
treeecb7db547685d327a69cc6e9946d6e9a18e635bf
parentb8a5f5fbf2b1702642c9489ea5ae3360c5b731bb (diff)
downloadvolse-hubzilla-88f7c2041d74d82db5c84b45f30e1eb64dfcc216.tar.gz
volse-hubzilla-88f7c2041d74d82db5c84b45f30e1eb64dfcc216.tar.bz2
volse-hubzilla-88f7c2041d74d82db5c84b45f30e1eb64dfcc216.zip
register: add option to show all register entries
-rw-r--r--Zotlabs/Module/Admin/Accounts.php14
-rw-r--r--include/account.php10
-rw-r--r--view/js/mod_register.js6
-rw-r--r--view/tpl/admin_accounts.tpl20
4 files changed, 33 insertions, 17 deletions
diff --git a/Zotlabs/Module/Admin/Accounts.php b/Zotlabs/Module/Admin/Accounts.php
index 32029eb00..76d332268 100644
--- a/Zotlabs/Module/Admin/Accounts.php
+++ b/Zotlabs/Module/Admin/Accounts.php
@@ -206,14 +206,20 @@ class Accounts {
$tao = 'tao.zar.zarax = ' . "'" . '<img src="' . z_root() . '/images/zapax16.gif">' . "';\n";
- $pending = get_pending_accounts();
+
+ // by default we will only return verified results. if reg_all is set we will return everything''
+ $get_all = isset($_REQUEST['get_all']);
+ $pending = get_pending_accounts($get_all);
unset($_SESSION[self::MYP]);
+
if ($pending) {
// collect and group all ip
- $atips = q("SELECT reg_atip AS atip, COUNT(reg_atip) AS atips FROM register "
- ." WHERE reg_vital = 1 GROUP BY reg_atip ");
- $atips ? $atipn = array_column($atips, 'atips', 'atip') : $atipn = array('' => 0);
+ $atips = dbq("SELECT reg_atip AS atip, COUNT(reg_atip) AS atips FROM register
+ WHERE reg_vital = 1 GROUP BY reg_atip"
+ );
+
+ (($atips) ? $atipn = array_column($atips, 'atips', 'atip') : $atipn = ['' => 0]);
$tao .= 'tao.zar.zarar = {';
foreach ($pending as $n => $v) {
diff --git a/include/account.php b/include/account.php
index 991e799b5..a7a87f331 100644
--- a/include/account.php
+++ b/include/account.php
@@ -1261,7 +1261,7 @@ function zar_register_dutystate( $now=NULL, $day=NULL ) {
}
-function get_pending_accounts() {
+function get_pending_accounts($get_all = false) {
/* get pending */
// [hilmar ->
@@ -1271,9 +1271,13 @@ function get_pending_accounts() {
// better useability at the moment to tell all (ACCOUNT_PENDING >= 0) instead of (> 0 for those need approval)
+ $sql_extra = " AND (reg_flags & " . ACCOUNT_UNVERIFIED . ") = 0 ";
+
+ 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
- FROM register WHERE reg_vital = 1 AND (reg_flags & %d) = 0 AND (reg_flags & %d) >= 0",
- intval(ACCOUNT_UNVERIFIED),
+ FROM register WHERE reg_vital = 1 $sql_extra AND (reg_flags & %d) >= 0",
intval(ACCOUNT_PENDING)
);
diff --git a/view/js/mod_register.js b/view/js/mod_register.js
index 7dbc2aca8..1fc5ad2fa 100644
--- a/view/js/mod_register.js
+++ b/view/js/mod_register.js
@@ -68,6 +68,9 @@ $(document).ready(function() {
});
$('#id_name').blur(function() {
+ if($('#id_name').val() == '')
+ return;
+
$('#name-spinner').fadeIn();
var zreg_name = $('#id_name').val();
$.get('new_channel/autofill.json?f=&name=' + encodeURIComponent(zreg_name),function(data) {
@@ -81,6 +84,9 @@ $(document).ready(function() {
});
$('#id_nickname').blur(function() {
+ if($('#id_name').val() == '')
+ return;
+
$('#nick-spinner').fadeIn();
$('#nick-hub').fadeOut();
var zreg_nick = $('#id_nickname').val();
diff --git a/view/tpl/admin_accounts.tpl b/view/tpl/admin_accounts.tpl
index ed4cf5a4b..490468e79 100644
--- a/view/tpl/admin_accounts.tpl
+++ b/view/tpl/admin_accounts.tpl
@@ -5,8 +5,8 @@
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<h3>{{$h_pending}}</h3>
- {{if $debug}}<div>{{$debug}}</div>{{/if}}
- {{if $pending}}
+ {{if $debug}}<div>{{$debug}}</div>{{/if}}
+ {{if $pending}}
<table id="pending">
<thead>
<tr>
@@ -16,12 +16,12 @@
</tr>
</thead>
<tbody>
- {{foreach $pending as $n => $u}}
+ {{foreach $pending as $n => $u}}
<tr class="">
- <td class="created">{{$u.reg_created}}</td>
- <td class="email">{{$u.reg_did2}}</td>
- <td class="email">{{$u.reg_email}}</td>
- <td class="email">{{$u.reg_atip}}</td>
+ <td class="text-nowrap">{{$u.reg_created}}</td>
+ <td class="text-break">{{$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>
<td class="checkbox_bulkedit"><input type="checkbox" class="pending_ckbx" id="id_pending_{{$n}}" name="pending[]" value="{{$n}}"></td>
<td class="tools">
@@ -33,7 +33,7 @@
<tr>
<td colspan="7"><strong>{{$msg}}:</strong> {{$u.msg}}</td>
</tr>
- {{/foreach}}
+ {{/foreach}}
</tbody>
</table>
{{* before, alternate:
@@ -46,9 +46,9 @@
<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>
- {{else}}
+ {{else}}
<p>{{$no_pending}}</p>
- {{/if}}
+ {{/if}}
<h3>{{$h_users}}</h3>