Index: openacs-4/packages/download/www/admin/report-by-ip-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-by-ip-oracle.xql,v diff -u -r1.1.4.1 -r1.1.4.2 --- openacs-4/packages/download/www/admin/report-by-ip-oracle.xql 6 Dec 2002 11:31:28 -0000 1.1.4.1 +++ openacs-4/packages/download/www/admin/report-by-ip-oracle.xql 3 Jan 2003 17:29:47 -0000 1.1.4.2 @@ -4,19 +4,15 @@ - select min(d.user_id) as user_id, - min(u.last_name || ', ' || u.first_names) as user_name, - min(u.email) as email, - d.download_ip, + select d.download_ip, nvl(min(d.download_hostname),'unavailable') as download_hostname, - count(*) as num_downloads, - min('$downloaded') as downloaded + count(*) as num_downloads from download_downloads_repository d, cc_users u - where d.repository_id = $repository_id and + where d.repository_id = :repository_id and d.user_id = u.user_id [ad_dimensional_sql $dimensional where] group by d.download_ip - order by 2 desc + order by 2 Index: openacs-4/packages/download/www/admin/report-by-ip-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-by-ip-postgresql.xql,v diff -u -r1.1.4.1 -r1.1.4.2 --- openacs-4/packages/download/www/admin/report-by-ip-postgresql.xql 6 Dec 2002 11:31:28 -0000 1.1.4.1 +++ openacs-4/packages/download/www/admin/report-by-ip-postgresql.xql 3 Jan 2003 17:29:47 -0000 1.1.4.2 @@ -6,19 +6,15 @@ - select min(d.user_id) as user_id, - min(u.last_name || ', ' || u.first_names) as user_name, - min(u.email) as email, - d.download_ip, + select d.download_ip, coalesce(min(d.download_hostname),'unavailable') as download_hostname, - count(*) as num_downloads, - min('$downloaded'::varchar) as downloaded + count(*) as num_downloads from download_downloads_repository d, cc_users u - where d.repository_id = $repository_id and + where d.repository_id = :repository_id and d.user_id = u.user_id [ad_dimensional_sql $dimensional where] group by d.download_ip - order by 2 desc + order by 2 Index: openacs-4/packages/download/www/admin/report-by-ip.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-by-ip.adp,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/download/www/admin/report-by-ip.adp 6 Dec 2002 11:31:28 -0000 1.5.2.1 +++ openacs-4/packages/download/www/admin/report-by-ip.adp 3 Jan 2003 17:29:47 -0000 1.5.2.2 @@ -3,7 +3,11 @@ @context@

-Spam Downloaders +

+ @user_id_list_export@ + +

+ @dimensional_html@ @table@ \ No newline at end of file Index: openacs-4/packages/download/www/admin/report-by-ip.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-by-ip.tcl,v diff -u -r1.6.2.1 -r1.6.2.2 --- openacs-4/packages/download/www/admin/report-by-ip.tcl 6 Dec 2002 11:31:28 -0000 1.6.2.1 +++ openacs-4/packages/download/www/admin/report-by-ip.tcl 3 Jan 2003 17:29:47 -0000 1.6.2.2 @@ -7,10 +7,14 @@ @cvs-id $Id$ } { {downloaded "1m"} +} -properties { + context:onevalue + user_id_list_export:onevalue + dimensional_html:onevalue + table:onevalue } set repository_id [download_repository_id] -##TODO: Add support for other set dimensional { {downloaded "Download Period" 1m { @@ -28,36 +32,16 @@ {num_downloads "# Downloads" {no_sort} {}} } -set sql_query " - select min(d.user_id) as user_id, - min(u.last_name || ', ' || u.first_names) as user_name, - min(u.email) as email, - d.download_ip, - nvl(min(d.download_hostname),'unavailable') as download_hostname, - count(*) as num_downloads, - min('$downloaded') as downloaded - from download_downloads_repository d, cc_users u - where d.repository_id = $repository_id and - d.user_id = u.user_id - [ad_dimensional_sql $dimensional where] - group by d.download_ip - order by 2 desc -" - set dimensional_html [ad_dimensional $dimensional] set table [ad_table \ - -Ttable_extra_html { width= 90% align=center} \ + -Ttable_extra_html { width="90%" align="center" } \ -bind [ad_tcl_vars_to_ns_set repository_id downloaded] \ - download_table $sql_query $table_def ] + download_table { *SQL* } $table_def ] -# vinodk: the download_table query gets the list of users (plus other data) -# we reuse the same query to get the list of user_id's to spam. -# Since we're using db_list, it's important that the first column -# of the query is the user_id. +# query users to spam +set user_id_list [db_list users_to_spam { *SQL* }] +set user_id_list_export [export_vars -form -sign user_id_list] -set user_id_list [db_list download_table { *SQL* }] -set user_id_list_export [export_vars -url -sign user_id_list] - set context [list "Downloads by IP"] ad_return_template \ No newline at end of file Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/download/www/admin/report-by-ip.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/download/www/admin/report-by-user-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-by-user-oracle.xql,v diff -u -r1.1.4.1 -r1.1.4.2 --- openacs-4/packages/download/www/admin/report-by-user-oracle.xql 6 Dec 2002 11:31:28 -0000 1.1.4.1 +++ openacs-4/packages/download/www/admin/report-by-user-oracle.xql 3 Jan 2003 17:29:47 -0000 1.1.4.2 @@ -7,14 +7,13 @@ select d.user_id, min(u.last_name || ', ' || u.first_names) as user_name, min(u.email) as email, - count(*) as num_downloads, - min('$downloaded') as downloaded + count(*) as num_downloads from download_downloads_repository d, cc_users u - where d.repository_id = $repository_id and + where d.repository_id = :repository_id and d.user_id = u.user_id [ad_dimensional_sql $dimensional where] group by d.user_id - order by 2 desc + order by 2 Index: openacs-4/packages/download/www/admin/report-by-user-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-by-user-postgresql.xql,v diff -u -r1.1.4.1 -r1.1.4.2 --- openacs-4/packages/download/www/admin/report-by-user-postgresql.xql 6 Dec 2002 11:31:28 -0000 1.1.4.1 +++ openacs-4/packages/download/www/admin/report-by-user-postgresql.xql 3 Jan 2003 17:29:47 -0000 1.1.4.2 @@ -9,14 +9,13 @@ select d.user_id, min(u.last_name || ', ' || u.first_names) as user_name, min(u.email) as email, - count(*) as num_downloads, - min('$downloaded'::varchar) as downloaded + count(*) as num_downloads from download_downloads_repository d, cc_users u - where d.repository_id = $repository_id and + where d.repository_id = :repository_id and d.user_id = u.user_id [ad_dimensional_sql $dimensional where] group by d.user_id - order by 2 desc + order by 2 Index: openacs-4/packages/download/www/admin/report-by-user.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-by-user.adp,v diff -u -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/download/www/admin/report-by-user.adp 6 Dec 2002 11:31:28 -0000 1.4.2.1 +++ openacs-4/packages/download/www/admin/report-by-user.adp 3 Jan 2003 17:29:47 -0000 1.4.2.2 @@ -3,7 +3,11 @@ @context@

-Spam Downloaders +

+ @user_id_list_export@ + +

+ @dimensional_html@ @table@ \ No newline at end of file Index: openacs-4/packages/download/www/admin/report-by-user.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-by-user.tcl,v diff -u -r1.6.2.1 -r1.6.2.2 --- openacs-4/packages/download/www/admin/report-by-user.tcl 6 Dec 2002 11:31:28 -0000 1.6.2.1 +++ openacs-4/packages/download/www/admin/report-by-user.tcl 3 Jan 2003 17:29:47 -0000 1.6.2.2 @@ -1,15 +1,20 @@ # /packages/download/www/admin/report-by-user.tcl ad_page_contract { Show list of users who have downloaded a specified archive. + @author jbank@arsdigita.com [jbank@arsdigita.com] @creation-date Wed Dec 13 13:39:29 2000 @cvs-id $Id$ } { {downloaded "1m"} +} -properties { + context:onevalue + user_id_list_export:onevalue + dimensional_html:onevalue + table:onevalue } set repository_id [download_repository_id] -##TODO: Add support for other set dimensional { {downloaded "Download Period" 1m { @@ -26,33 +31,15 @@ {num_downloads "# Downloads" {no_sort} {}} } -set sql_query " - select d.user_id, - min(u.last_name || ', ' || u.first_names) as user_name, - min(u.email) as email, - count(*) as num_downloads, - min('$downloaded') as downloaded - from download_downloads_repository d, cc_users u - where d.repository_id = $repository_id and - d.user_id = u.user_id - [ad_dimensional_sql $dimensional where] - group by d.user_id - order by 2 desc -" - set dimensional_html [ad_dimensional $dimensional] set table [ad_table \ - -Ttable_extra_html { width="90%" align="center"} \ + -Ttable_extra_html { width="90%" align="center" } \ -bind [ad_tcl_vars_to_ns_set repository_id downloaded] \ - download_table $sql_query $table_def ] + download_table { *SQL* } $table_def ] -# vinodk: the download_table query gets the list of users (plus other data) -# we reuse the same query to get the list of user_id's to spam. -# Since we're using db_list, it's important that the first column -# of the query is the user_id. +# query users to spam +set user_id_list [db_list users_to_spam { *SQL* }] +set user_id_list_export [export_vars -form -sign user_id_list] -set user_id_list [db_list download_table { *SQL* }] -set user_id_list_export [export_vars -url -sign user_id_list] - set context [list "Downloads by User"] ad_return_template \ No newline at end of file Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/download/www/admin/report-by-user.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/download/www/admin/report-one-ip-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-one-ip-oracle.xql,v diff -u -r1.2.4.1 -r1.2.4.2 --- openacs-4/packages/download/www/admin/report-one-ip-oracle.xql 6 Dec 2002 11:31:28 -0000 1.2.4.1 +++ openacs-4/packages/download/www/admin/report-one-ip-oracle.xql 3 Jan 2003 17:29:47 -0000 1.2.4.2 @@ -15,10 +15,10 @@ nvl(d.download_hostname,'unavailable') as download_hostname, nvl2(d.reason_id, dr.reason, d.reason) as reason from download_archives_obj da, download_arch_revisions_obj dar, download_downloads d, download_reasons dr, cc_users u - where da.repository_id = $repository_id + where da.repository_id = :repository_id and da.archive_id = dar.archive_id and d.revision_id = dar.revision_id - and d.download_ip = '$download_ip' + and d.download_ip = :download_ip and dr.download_reason_id(+) = d.reason_id and u.user_id = d.user_id [ad_dimensional_sql $dimensional where] @@ -27,6 +27,7 @@ + Index: openacs-4/packages/download/www/admin/report-one-ip-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-one-ip-postgresql.xql,v diff -u -r1.1.4.1 -r1.1.4.2 --- openacs-4/packages/download/www/admin/report-one-ip-postgresql.xql 6 Dec 2002 11:31:28 -0000 1.1.4.1 +++ openacs-4/packages/download/www/admin/report-one-ip-postgresql.xql 3 Jan 2003 17:29:47 -0000 1.1.4.2 @@ -21,10 +21,10 @@ download_archives_obj da, download_arch_revisions_obj dar, cc_users u - where da.repository_id = $repository_id + where da.repository_id = :repository_id and da.archive_id = dar.archive_id and d.revision_id = dar.revision_id - and d.download_ip = '$download_ip' + and d.download_ip = :download_ip and u.user_id = d.user_id [ad_dimensional_sql $dimensional where] [ad_order_by_from_sort_spec $orderby $table_def] Index: openacs-4/packages/download/www/admin/report-one-ip.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-one-ip.adp,v diff -u -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/download/www/admin/report-one-ip.adp 6 Dec 2002 11:31:28 -0000 1.4.2.1 +++ openacs-4/packages/download/www/admin/report-one-ip.adp 3 Jan 2003 17:29:47 -0000 1.4.2.2 @@ -3,7 +3,11 @@ @context@

-Spam Downloaders +

+ @user_id_list_export@ + +

+ @dimensional_html@ @table@ \ No newline at end of file Index: openacs-4/packages/download/www/admin/report-one-ip.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-one-ip.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/download/www/admin/report-one-ip.tcl 6 Dec 2002 11:31:28 -0000 1.5.2.1 +++ openacs-4/packages/download/www/admin/report-one-ip.tcl 3 Jan 2003 17:29:47 -0000 1.5.2.2 @@ -1,5 +1,6 @@ -# /packages/download/www/admin/report-one-ip-.tcl +# /packages/download/www/admin/report-one-ip.tcl ad_page_contract { + Show all downloaders from a single IP address @author jbank@arsdigita.com [jbank@arsdigita.com] @creation-date Thu Dec 14 16:11:49 2000 @@ -8,6 +9,12 @@ download_ip:notnull {orderby "archive_name"} {downloaded "1m"} +} -properties { + download_ip:onevalue + context:onevalue + user_id_list_export:onevalue + dimensional_html:onevalue + table:onevalue } @@ -40,36 +47,15 @@ {}} } -set sql_query " - select u.user_id, - u.last_name || ', ' || u.first_names as user_name, - u.email, - da.archive_name, - da.archive_id, - dar.revision_id, - dar.version_name, - d.download_date, - nvl(d.download_hostname,'unavailable') as download_hostname, - nvl2(d.reason_id, d.reason, dr.reason) as reason - from download_archives_obj da, download_arch_revisions_obj dar, download_downloads d, download_reasons dr, cc_users u - where da.repository_id = $repository_id - and da.archive_id = dar.archive_id - and d.revision_id = dar.revision_id - and d.download_ip = '$download_ip' - and dr.download_reason_id(+) = d.reason_id - and u.user_id = d.user_id - [ad_dimensional_sql $dimensional where] - [ad_order_by_from_sort_spec $orderby $table_def] -" - set dimensional_html [ad_dimensional $dimensional] set table [ad_table \ - -Ttable_extra_html { width="90%" align="center"} \ + -Ttable_extra_html { width="90%" align="center" } \ -bind [ad_tcl_vars_to_ns_set repository_id download_ip] \ - download_table $sql_query $table_def ] + download_table { *SQL* } $table_def ] -set user_id_list [db_list download_table { *SQL* }] -set user_id_list_export [export_vars -url -sign user_id_list] +# query users to spam +set user_id_list [db_list users_to_spam { *SQL* }] +set user_id_list_export [export_vars -form -sign user_id_list] set context [list [list "report-by-ip" "Downloads by IP"] "$download_ip"] Fisheye: Tag 1.1 refers to a dead (removed) revision in file `openacs-4/packages/download/www/admin/report-one-ip.xql'. Fisheye: No comparison available. Pass `N' to diff? Index: openacs-4/packages/download/www/admin/report-one-user-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-one-user-oracle.xql,v diff -u -r1.2 -r1.2.4.1 --- openacs-4/packages/download/www/admin/report-one-user-oracle.xql 23 May 2001 16:35:03 -0000 1.2 +++ openacs-4/packages/download/www/admin/report-one-user-oracle.xql 3 Jan 2003 17:29:47 -0000 1.2.4.1 @@ -14,10 +14,10 @@ nvl(d.download_hostname,'unavailable') as download_hostname, nvl2(d.reason_id, dr.reason, d.reason) as reason from download_archives_obj da, download_arch_revisions_obj dar, download_downloads d, download_reasons dr - where da.repository_id = $repository_id + where da.repository_id = :repository_id and da.archive_id = dar.archive_id and d.revision_id = dar.revision_id - and d.user_id = $user_id + and d.user_id = :user_id and dr.download_reason_id(+) = d.reason_id [ad_dimensional_sql $dimensional where] [ad_order_by_from_sort_spec $orderby $table_def] Index: openacs-4/packages/download/www/admin/report-one-user-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-one-user-postgresql.xql,v diff -u -r1.1 -r1.1.4.1 --- openacs-4/packages/download/www/admin/report-one-user-postgresql.xql 22 May 2001 04:17:45 -0000 1.1 +++ openacs-4/packages/download/www/admin/report-one-user-postgresql.xql 3 Jan 2003 17:29:47 -0000 1.1.4.1 @@ -22,7 +22,7 @@ where da.repository_id = :repository_id and da.archive_id = dar.archive_id and d.revision_id = dar.revision_id - and d.user_id = $user_id + and d.user_id = :user_id [ad_dimensional_sql $dimensional where] [ad_order_by_from_sort_spec $orderby $table_def] Index: openacs-4/packages/download/www/admin/report-one-user.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-one-user.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/download/www/admin/report-one-user.tcl 6 Dec 2002 11:31:28 -0000 1.5.2.1 +++ openacs-4/packages/download/www/admin/report-one-user.tcl 3 Jan 2003 17:29:47 -0000 1.5.2.2 @@ -8,6 +8,12 @@ user_id:integer,notnull {orderby "archive_name"} {downloaded "1m"} +} -properties { + first_names:onevalue + last_name:onevalue + context:onevalue + dimensional_html:onevalue + table:onevalue } set repository_id [download_repository_id] @@ -23,51 +29,29 @@ set table_def { {archive_name "Archive" - {archive_name $order} - {$archive_name}} + {archive_name $order} + {$archive_name}} {version_name "Version" - {version_name $order} - {$version_name}} + {version_name $order} + {$version_name}} {download_date "Download Date" - {download_date} - {}} + {download_date} + {}} {download_ip "From IP" - {download_ip} - {$download_ip ($download_hostname)}} + {download_ip} + {$download_ip ($download_hostname)}} {reason "Download Reason" - {reason} - {}} + {reason} + {}} } -set sql_query " - select da.repository_id, - da.archive_name, - da.archive_id, - dar.revision_id, - dar.version_name, - d.download_date, - d.download_ip, - nvl(d.download_hostname,'unavailable') as download_hostname, - nvl2(d.reason_id, d.reason, dr.reason) as reason - from download_archives_obj da, download_arch_revisions_obj dar, download_downloads d, download_reasons dr - where da.repository_id = $repository_id - and da.archive_id = dar.archive_id - and d.revision_id = dar.revision_id - and d.user_id = $user_id - and dr.download_reason_id(+) = d.reason_id - [ad_dimensional_sql $dimensional where] - [ad_order_by_from_sort_spec $orderby $table_def] -" +db_1row name_select { *SQL* } -db_1row name_select "select u.last_name, u.first_names - from cc_users u - where u.user_id = :user_id " - set dimensional_html [ad_dimensional $dimensional] set table [ad_table \ - -Ttable_extra_html { width="90%" align="center"} \ + -Ttable_extra_html { width="90%" align="center" } \ -bind [ad_tcl_vars_to_ns_set repository_id user_id] \ - download_table $sql_query $table_def ] + download_table { *SQL* } $table_def ] set context [list [list "report-by-user" "Downloads by User"] "$first_names $last_name"] ad_return_template Index: openacs-4/packages/download/www/admin/report-one-user.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-one-user.xql,v diff -u -r1.2 -r1.2.4.1 --- openacs-4/packages/download/www/admin/report-one-user.xql 22 May 2001 04:17:45 -0000 1.2 +++ openacs-4/packages/download/www/admin/report-one-user.xql 3 Jan 2003 17:29:47 -0000 1.2.4.1 @@ -4,8 +4,8 @@ select u.last_name, u.first_names - from cc_users u - where u.user_id = :user_id + from cc_users u + where u.user_id = :user_id Index: openacs-4/packages/download/www/admin/report-version-downloads-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-version-downloads-oracle.xql,v diff -u -r1.2.4.1 -r1.2.4.2 --- openacs-4/packages/download/www/admin/report-version-downloads-oracle.xql 6 Dec 2002 11:31:28 -0000 1.2.4.1 +++ openacs-4/packages/download/www/admin/report-version-downloads-oracle.xql 3 Jan 2003 17:29:47 -0000 1.2.4.2 @@ -17,7 +17,7 @@ nvl2(d.reason_id, dr.reason, d.reason) as reason from download_arch_revisions_obj dar, download_downloads d, download_reasons dr, cc_users u where d.user_id = u.user_id - and dar.archive_id = $archive_id + and dar.archive_id = :archive_id and dar.revision_id = d.revision_id and dr.download_reason_id(+) = d.reason_id [ad_dimensional_sql $dimensional where] @@ -26,6 +26,7 @@
+ Index: openacs-4/packages/download/www/admin/report-version-downloads-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-version-downloads-postgresql.xql,v diff -u -r1.2.4.1 -r1.2.4.2 --- openacs-4/packages/download/www/admin/report-version-downloads-postgresql.xql 6 Dec 2002 11:31:28 -0000 1.2.4.1 +++ openacs-4/packages/download/www/admin/report-version-downloads-postgresql.xql 3 Jan 2003 17:29:47 -0000 1.2.4.2 @@ -29,7 +29,6 @@ - Index: openacs-4/packages/download/www/admin/report-version-downloads.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-version-downloads.adp,v diff -u -r1.4.2.1 -r1.4.2.2 --- openacs-4/packages/download/www/admin/report-version-downloads.adp 6 Dec 2002 11:31:28 -0000 1.4.2.1 +++ openacs-4/packages/download/www/admin/report-version-downloads.adp 3 Jan 2003 17:29:47 -0000 1.4.2.2 @@ -2,12 +2,14 @@ @archive_name@ Download History @context@ +

+

+ @user_id_list_export@ + +
+

- - @dimensional_html@ -
Total downloads listed: @count@; Overall Total for @archive_name@: @total_count@ +
Total downloads listed: @current_count@; Overall Total for @archive_name@: @total_count@
@table@ \ No newline at end of file Index: openacs-4/packages/download/www/admin/report-version-downloads.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-version-downloads.tcl,v diff -u -r1.5.2.1 -r1.5.2.2 --- openacs-4/packages/download/www/admin/report-version-downloads.tcl 6 Dec 2002 11:31:28 -0000 1.5.2.1 +++ openacs-4/packages/download/www/admin/report-version-downloads.tcl 3 Jan 2003 17:29:47 -0000 1.5.2.2 @@ -9,8 +9,18 @@ {orderby "last_name"} {downloaded 1m} {versions "current"} +} -properties { + archive_name:onevalue + context:onevalue + user_id_list_export:onevalue + dimensional_html:onevalue + current_count:onevalue + total_count:onevalue + table:onevalue } +set repository_id [download_repository_id] + ad_require_permission $archive_id "admin" set dimensional { @@ -29,87 +39,36 @@ set table_def { {user_name "User Name" - {user_name $order} - {$user_name}} + {user_name $order} + {$user_name}} {version_name "Version" - {version_name $order} - {$version_name}} + {version_name $order} + {$version_name}} {download_date "Download Date" - {download_date $order} - {}} + {download_date $order} + {}} {download_ip "From IP (hostname)" - {download_ip $order} - {$download_ip ($download_hostname)}} + {download_ip $order} + {$download_ip ($download_hostname)}} {reason "Download Reason" - {reason $order} - {$reason}} + {reason $order} + {$reason}} } -db_1row name_select { - select da.archive_name from download_archives_obj da where da.archive_id = :archive_id -} +db_1row name_select { *SQL* } -if {$versions == "all" } { - set version_str " in ( - select revision_id from download_arch_revisions_obj - where archive_id = :archive_id )" -} else { - set version_str " = ( - select revision_id from download_arch_revisions_obj - where archive_id = :archive_id - and revision_id = content_item.get_live_revision(:archive_id)) - " -} +set current_count [db_string current_count { *SQL* }] +set total_count [db_string total_count { *SQL* }] -set count [db_string count_select "select count(*) -from download_downloads d, download_arch_revisions_obj dar -where dar.archive_id = :archive_id and - d.revision_id = dar.revision_id - [ad_dimensional_sql $dimensional where] -"] - -#FIXME -# what is temp_downloaded for? -# why are count and total_count the same query? -# do we need version_str above? - -set temp_downloaded $downloaded - -set total_count [db_string count_select "select count(*) -from download_downloads d, download_arch_revisions_obj dar -where dar.archive_id = :archive_id and - d.revision_id = dar.revision_id - [ad_dimensional_sql $dimensional where] -"] -set downloaded $temp_downloaded - -set sql_query " - select u.user_id, - u.email, - u.last_name || ', ' || u.first_names as user_name, - d.download_date, - d.download_ip, - nvl(d.download_hostname,'unavailable') as download_hostname, - nvl(dar.version_name, 'unnamed') as version_name, - dar.revision_id, - nvl2(d.reason_id, d.reason, dr.reason) as reason - from download_arch_revisions_obj dar, download_downloads d, download_reasons dr, cc_users u - where d.user_id = u.user_id - and dar.archive_id = $archive_id - and dar.revision_id = d.revision_id - and dr.download_reason_id(+) = d.reason_id - [ad_dimensional_sql $dimensional where] - [ad_order_by_from_sort_spec $orderby $table_def] -" - set dimensional_html [ad_dimensional $dimensional] set table [ad_table \ - -Ttable_extra_html { width= 90% align=center} \ + -Ttable_extra_html { width="90%" align="center" } \ -bind [ad_tcl_vars_to_ns_set archive_id] \ - download_table $sql_query $table_def ] + download_table { *SQL* } $table_def ] -set user_id_list [db_list download_table { *SQL* }] -set user_id_list_export [export_vars -url -sign user_id_list] +# query users to spam +set user_id_list [db_list users_to_spam { *SQL* }] +set user_id_list_export [export_vars -form -sign user_id_list] set context [list "$archive_name Download History"] Index: openacs-4/packages/download/www/admin/report-version-downloads.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/report-version-downloads.xql,v diff -u -r1.2 -r1.2.4.1 --- openacs-4/packages/download/www/admin/report-version-downloads.xql 22 May 2001 04:17:45 -0000 1.2 +++ openacs-4/packages/download/www/admin/report-version-downloads.xql 3 Jan 2003 17:29:47 -0000 1.2.4.1 @@ -10,16 +10,41 @@ - + select count(*) from download_downloads d, download_arch_revisions_obj dar where dar.archive_id = :archive_id and - d.revision_id = dar.revision_id + d.revision_id = dar.revision_id [ad_dimensional_sql $dimensional where] + + + select count(*) +from download_downloads d, download_arch_revisions_obj dar +where dar.archive_id = :archive_id and + d.revision_id = dar.revision_id + + + + + + + +select distinct d.user_id +from download_downloads_repository d, + download_arch_revisions_obj dar +where d.repository_id = :repository_id + and dar.archive_id = :archive_id + and dar.revision_id = d.revision_id + [ad_dimensional_sql $dimensional where] + + + + + Index: openacs-4/packages/download/www/admin/spam-users.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/spam-users.adp,v diff -u -r1.3.2.1 -r1.3.2.2 --- openacs-4/packages/download/www/admin/spam-users.adp 6 Dec 2002 11:31:28 -0000 1.3.2.1 +++ openacs-4/packages/download/www/admin/spam-users.adp 3 Jan 2003 17:29:47 -0000 1.3.2.2 @@ -11,6 +11,9 @@

Users who have requested not to be spammed will NOT receive your email. +
+ (@no_spam_count@ users removed + from the list for this reason)

Index: openacs-4/packages/download/www/admin/spam-users.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/download/www/admin/spam-users.tcl,v diff -u -r1.3.2.1 -r1.3.2.2 --- openacs-4/packages/download/www/admin/spam-users.tcl 6 Dec 2002 11:31:28 -0000 1.3.2.1 +++ openacs-4/packages/download/www/admin/spam-users.tcl 3 Jan 2003 17:29:47 -0000 1.3.2.2 @@ -11,16 +11,21 @@ } -properties { users:multirow user_id_list_export:onevalue + no_spam_count:onevalue } ad_require_permission [ad_conn package_id] "admin" set user_id [ad_verify_and_get_user_id] -# ACS version passed sql_query as a query variable -# I've changed it to send only a list of signed user_ids -# -- vinodk +# get name, email and +# remove any users who don't want spam -db_multirow users user_select { *SQL* } +set want_spam_list {} +db_multirow users user_select { *SQL* } { + lappend want_spam_list $user_id +} +set no_spam_count [expr [llength user_id_list] - [llength want_spam_list]] +set user_id_list $want_spam_list set user_id_list_export [export_vars -form -sign {user_id_list}]