[geeklog-cvs] geeklog: The "Users" entry in the Admins block now displays the ...

geeklog-cvs at lists.geeklog.net geeklog-cvs at lists.geeklog.net
Sun Mar 14 07:31:04 EDT 2010


changeset 7787:00ed7c32d008
url:  http://project.geeklog.net/cgi-bin/hgwebdir.cgi/geeklog/rev/00ed7c32d008
user: Dirk Haun <dirk at haun-online.de>
date: Sun Mar 14 12:03:15 2010 +0100
description:
The "Users" entry in the Admins block now displays the number of active users only, i.e. it only counts users that logged in at least once

diffstat:

 public_html/docs/history   |   2 ++
 public_html/lib-common.php |  19 ++++++++++---------
 2 files changed, 12 insertions(+), 9 deletions(-)

diffs (42 lines):

diff -r 9670c951f5fa -r 00ed7c32d008 public_html/docs/history
--- a/public_html/docs/history	Sun Mar 14 11:56:05 2010 +0100
+++ b/public_html/docs/history	Sun Mar 14 12:03:15 2010 +0100
@@ -3,6 +3,8 @@
 Apr ??, 2010 (1.6.2)
 ------------
 
+- The "Users" entry in the Admins block now displays the number of active users
+  only, i.e. it only counts users that logged in at least once [Dirk]
 - Fixed display of list of allowed HTML tags and available autotags in
   advanced story editor mode (bug #0001020, patch provided by Chetan)
 - Since we can now re-authenticate expired security tokens, we don't need to
diff -r 9670c951f5fa -r 00ed7c32d008 public_html/lib-common.php
--- a/public_html/lib-common.php	Sun Mar 14 11:56:05 2010 +0100
+++ b/public_html/lib-common.php	Sun Mar 14 12:03:15 2010 +0100
@@ -2625,16 +2625,17 @@
             $link_array[$LANG01[13]] = $menu_item;
         }
 
-        if( SEC_hasRights( 'user.edit' ))
-        {
+        if (SEC_hasRights('user.edit')) {
             $url = $_CONF['site_admin_url'] . '/user.php';
-            $adminmenu->set_var( 'option_url', $url );
-            $adminmenu->set_var( 'option_label', $LANG01[17] );
-            $adminmenu->set_var( 'option_count',
-                    COM_numberFormat( DB_count( $_TABLES['users'] ) -1 ));
-
-            $menu_item = $adminmenu->parse( 'item',
-                    ( $thisUrl == $url ) ? 'current' : 'option' );
+            $adminmenu->set_var('option_url', $url);
+            $adminmenu->set_var('option_label', $LANG01[17]);
+            $active_users = DB_count($_TABLES['users'], 'status',
+                                     USER_ACCOUNT_ACTIVE);
+            $adminmenu->set_var('option_count',
+                    COM_numberFormat($active_users - 1));
+
+            $menu_item = $adminmenu->parse('item',
+                    $thisUrl == $url ? 'current' : 'option');
             $link_array[$LANG01[17]] = $menu_item;
         }
 



More information about the geeklog-cvs mailing list