Index: openacs-4/packages/acs-admin/www/users/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/users/index.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/acs-admin/www/users/index.tcl 18 Nov 2002 18:01:17 -0000 1.3
+++ openacs-4/packages/acs-admin/www/users/index.tcl 19 Oct 2003 19:06:58 -0000 1.4
@@ -24,13 +24,8 @@
set context [list "Users"]
- # XXX This query should be optimized
- db_1row users_n_users "select
- count(*) as n_users,
- sum(decode(member_state,'deleted',1,0)) as n_deleted_users,
- max(creation_date) as last_registration
- from cc_users
- where email not in ('anonymous', 'system')"
+ db_1row users_n_users {}
+ db_1row users_deleted_users {}
set n_users [util_commify_number $n_users]
set last_registration [lc_time_fmt $last_registration "%q"]
Index: openacs-4/packages/acs-admin/www/users/index.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-admin/www/users/index.xql,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-admin/www/users/index.xql 29 Apr 2001 00:47:48 -0000 1.4
+++ openacs-4/packages/acs-admin/www/users/index.xql 19 Oct 2003 19:06:58 -0000 1.5
@@ -3,15 +3,32 @@
- select
- count(*) as n_users,
- sum(case when member_state = 'deleted' then 1 else 0 end) as n_deleted_users,
- max(creation_date) as last_registration
- from cc_users
- where email not in ('anonymous', 'system')
+ select count(user_id) as n_users,
+ max(creation_date) as last_registration
+ from users u,
+ acs_objects o
+ where o.object_id = u.user_id
+
+
+
+ select count(user_id) as n_deleted_users
+ from users u,
+ group_member_map m,
+ membership_rels mr,
+ acs_magic_objects amo
+ where u.user_id = m.member_id
+ and amo.name = 'registered_users'
+ and m.group_id = amo.object_id
+ and m.container_id = m.group_id
+ and mr.rel_id = m.rel_id
+ and mr.member_state = 'deleted'
+
+
+
+