]> git.ipfire.org Git - ipfire.org.git/commitdiff
people: Show pending registrations
authorMichael Tremer <michael.tremer@ipfire.org>
Tue, 10 Dec 2019 11:38:57 +0000 (11:38 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Tue, 10 Dec 2019 11:38:57 +0000 (11:38 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/backend/accounts.py
src/templates/people/stats.html

index d4241c10823bba1d7309783ce0db75bd358eb6c8..42d16249c42205dbe223e6ebd6fb73914fb185da 100644 (file)
@@ -334,6 +334,12 @@ class Accounts(Object):
                        "(&(objectClass=inetOrgPerson)(|(sipAuthenticationUser=%s)(telephoneNumber=%s)(homePhone=%s)(mobile=%s)))" \
                        % (number, number, number, number))
 
+       @property
+       def pending_registrations(self):
+               res = self.db.get("SELECT COUNT(*) AS c FROM account_activations")
+
+               return res.c or 0
+
        async def check_spam(self, uid, email, address):
                sfs = StopForumSpam(self.backend, uid, email, address)
 
index 93c026a521d8828ed180388c5b4e6326b8ce4dfe..3a1d2b6b26f565075c0dfa3512c805e7f5e327bb 100644 (file)
 
                                        <h1>{{ backend.accounts.count_created_after(t) }}</h1>
                                        <h5 class="mb-0">{{ _("Created This Month") }}</h5>
+
+                                       {% set pending_registrations = backend.accounts.pending_registrations %}
+                                       {% if pending_registrations %}
+                                               <hr>
+
+                                               <h1>{{ pending_registrations }}</h1>
+                                               <h5 class="mb-0">{{ _("Pending Registrations") }}</h5>
+                                       {% end %}
                                </div>
                        </div>
                </div>