Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.en_US.ISO-8859-1.xml
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/acs-subsite.en_US.ISO-8859-1.xml,v
diff -u -r1.28 -r1.29
--- openacs-4/packages/acs-subsite/catalog/acs-subsite.en_US.ISO-8859-1.xml 30 Sep 2003 10:22:36 -0000 1.28
+++ openacs-4/packages/acs-subsite/catalog/acs-subsite.en_US.ISO-8859-1.xml 3 Oct 2003 10:14:30 -0000 1.29
@@ -47,6 +47,8 @@
» Members
+
Index: openacs-4/packages/acs-subsite/www/admin/configure.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/configure.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/acs-subsite/www/admin/configure.tcl 22 Sep 2003 09:52:09 -0000 1.5
+++ openacs-4/packages/acs-subsite/www/admin/configure.tcl 3 Oct 2003 10:14:31 -0000 1.6
@@ -13,16 +13,29 @@
# TODO: Add join policy
-
ad_form -name name -cancel_url [ad_conn url] -mode display -form {
{instance_name:text
{label "Subsite name"}
{html {size 50}}
}
+ {master_template:text(select)
+ {label "Template"}
+ {help_text "Choose the layout and navigation you want for your community."}
+ {options [subsite::get_template_options]}
+ }
+ {join_policy:text(select)
+ {label "Join policy"}
+ {options [group::get_join_policy_options]}
+ }
} -on_request {
set instance_name [ad_conn instance_name]
+ set master_template [parameter::get -parameter DefaultMaster -package_id [ad_conn package_id]]
+ set join_policy [group::join_policy -group_id [application_group::group_id_from_package_id]]
} -on_submit {
apm_package_rename -instance_name $instance_name
+ parameter::set_value -parameter DefaultMaster -package_id [ad_conn package_id] -value $master_template
+ set group(join_policy) $join_policy
+ group::update -group_id [application_group::group_id_from_package_id] -array group
} -after_submit {
ad_returnredirect [ad_conn url]
ad_script_abort
Index: openacs-4/packages/acs-subsite/www/admin/subsite-add.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/admin/subsite-add.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/acs-subsite/www/admin/subsite-add.tcl 2 Oct 2003 22:15:49 -0000 1.5
+++ openacs-4/packages/acs-subsite/www/admin/subsite-add.tcl 3 Oct 2003 10:14:31 -0000 1.6
@@ -34,6 +34,10 @@
{help_text "Choose the layout and navigation you want for your community."}
{options [subsite::get_template_options]}
}
+ {join_policy:text(select)
+ {label "Join policy"}
+ {options [group::get_join_policy_options]}
+ }
} -on_submit {
set folder [site_node::verify_folder_name \
-parent_node_id [ad_conn node_id] \
@@ -54,6 +58,8 @@
-package_key acs-subsite]
parameter::set_value -parameter DefaultMaster -package_id $new_package_id -value $master_template
+ set group(join_policy) $join_policy
+ group::update -group_id [application_group::group_id_from_package_id -package_id $new_package_id] -array group
} errsmg] } {
ad_return_error "Problem Creating Application" "We had a problem creating the community."
}
Index: openacs-4/packages/acs-subsite/www/pvt/home.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/pvt/home.adp,v
diff -u -r1.16 -r1.17
--- openacs-4/packages/acs-subsite/www/pvt/home.adp 1 Oct 2003 15:48:37 -0000 1.16
+++ openacs-4/packages/acs-subsite/www/pvt/home.adp 3 Oct 2003 10:14:31 -0000 1.17
@@ -21,16 +21,22 @@
+
+
- » #acs-subsite.lt_What_other_people_see# -
++ » #acs-subsite.lt_What_other_people_see# +
+@@ -44,5 +50,21 @@
+ » #acs-subsite.Whos_Online_link_label# +
+ +
-
path
: a path to the file read
mtime
: the mtime of the file read
- provides
and $requires
: lists of dependency
+ provides
and requires
: lists of dependency
information, containing elements of the form [list $url $version]
owners
: a list of owners containing elements of the form
[list $url $name]
Index: openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl,v
diff -u -r1.47 -r1.48
--- openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 1 Oct 2003 13:54:31 -0000 1.47
+++ openacs-4/packages/acs-tcl/tcl/request-processor-procs.tcl 3 Oct 2003 10:14:30 -0000 1.48
@@ -638,8 +638,8 @@
# Who's online
# Don't record requests for not-logged in users
- if { [ad_conn user_id] != "0"} {
- util::whos_online::user_requested_page [ad_conn user_id]
+ if { [ad_conn untrusted_user_id] != 0 } {
+ whos_online::user_requested_page [ad_conn untrusted_user_id]
}
#####
Index: openacs-4/packages/acs-tcl/tcl/utilities-init.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/utilities-init.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-tcl/tcl/utilities-init.tcl 1 Oct 2003 13:54:31 -0000 1.4
+++ openacs-4/packages/acs-tcl/tcl/utilities-init.tcl 3 Oct 2003 10:14:30 -0000 1.5
@@ -13,5 +13,4 @@
# Create mutex for util_background_exec
nsv_set util_background_exec_mutex . [ns_mutex create]
-# Schedule proc to clean up whos_online data structure
-util::whos_online::init
+
Index: openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl,v
diff -u -r1.51 -r1.52
--- openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 2 Oct 2003 14:32:22 -0000 1.51
+++ openacs-4/packages/acs-tcl/tcl/utilities-procs.tcl 3 Oct 2003 10:14:30 -0000 1.52
@@ -9,7 +9,6 @@
}
namespace eval util {}
-namespace eval util::whos_online {}
# Let's define the nsv arrays out here, so we can call nsv_exists
# on their keys without checking to see if it already exists.
@@ -4443,197 +4442,3 @@
}
-####################
-#
-# Procs in the util::whos_online namespace
-#
-####################
-
-ad_proc -private util::whos_online::init {} {
- Schedules the flush proc that cleans up old who's online values.
- Makes sure the unregistered visitor (user_id=0) is invisible.
-
- @author Bjoern Kiesbye
-} {
- ad_schedule_proc -thread t 3600 util::whos_online::flush
-
- # We typically don't want to see the unregistered user in the who's online list
- set_invisible 0
-}
-
-ad_proc -private util::whos_online::flush {} {
- Removing all user_ids from the last_hit (nsv_set) wich have a time Stamp older than
- the number of seconds indicated by the proc util::whos_online::interval.
-
- @author Bjoern Kiesbye
-} {
- array set last_hit [nsv_array get last_hit]
- set onliners_out [list]
- set interval 1
- set oldtime [expr [ns_time] - [interval]]
-
- for {set search [array startsearch last_hit]} {[array anymore last_hit $search]} {} {
- set user [array nextelement last_hit $search]
- set time $last_hit($user)
- if {$time<$oldtime} {
- lappend onliners_out $user
- }
- }
-
- array donesearch last_hit $search
-
- for {set i 0 } { $i < [llength $onliners_out]} {incr i} {
- set user_id [lindex $onliners_out $i]
- if { [nsv_exists last_hit $user_id] } {
- nsv_unset last_hit $user_id
- }
- if { [nsv_exists invisible_users $user_id] } {
- nsv_unset invisible_users $user_id
- }
- }
-}
-
-ad_proc -private util::whos_online::interval {} {
- Returns the last number of seconds within a user must have requested
- a page to be considered online. Based on the LastVisitUpdateInterval parameter
- of the main site and defaults to 600 seconds = 10 minutes.
-
- @author Peter Marklund
-} {
- return [parameter::get \
- -package_id [subsite::main_site_id] \
- -parameter LastVisitUpdateInterval \
- -default 600]
-}
-
-ad_proc -private util::whos_online::user_requested_page { user_id } {
- Records that the user with given id requested a page on the server
-
- @author Bjoern Kiesbye
-} {
- nsv_set last_hit $user_id [ns_time]
-}
-
-ad_proc -public util::whos_online::time_since_last_request { user_id } {
- Returns the number of seconds since the user with given id requested
- a page.
-
- @author Peter Marklund
-} {
- return [expr [ns_time] - [nsv_get last_hit $user_id]]
-}
-
-ad_proc -public util::whos_online::user_ids {} {
- This function returns a list of user_ids from users wich have requested a page
- from this Server in the last 10 min.And aren't set to invisible.
-
- @author Bjoern Kiesbye
-} {
- array set last_hit [nsv_array get last_hit]
- set onliners [list]
- set oldtime [expr [ns_time] - [interval]]
-
- array set invisible [nsv_array get invisible_users]
-
- for {set search [array startsearch last_hit]} {[array anymore last_hit $search]} {} {
- set user [array nextelement last_hit $search]
- set time $last_hit($user)
- set invi 0
- if {$time>$oldtime} {
- for { set search2 [array startsearch invisible]} {[array anymore invisible $search2]} {} {
- set user_cur [array nextelement invisible $search2]
- if {$user_cur == $user} {
- set invi 255
- break
- }
- }
- array donesearch invisible $search2
- if {$invi == 0} {
- lappend onliners $user
- }
- }
- }
-
- array donesearch last_hit $search
-
- return $onliners
-}
-
-ad_proc -public util::whos_online::all_user_ids {} {
- This function returns a list of user_ids from users wich have requested a page
- from this Server in the last 10 min.Even those wich are set to invisible.
-
- @author Bjoern Kiesbye
-} {
- array set last_hit [nsv_array get last_hit]
- set onliners [list]
- set oldtime [expr [ns_time] - [interval]]
-
- array set invisible [nsv_array get invisible_users]
-
- for {set search [array startsearch last_hit]} {[array anymore last_hit $search]} {} {
- set user [array nextelement last_hit $search]
- set time $last_hit($user)
- set invi 0
- if {$time>$oldtime} {
- lappend onliners $user
- }
- }
-
- array donesearch last_hit $search
-
- return $onliners
-}
-
-ad_proc -public util::whos_online::set_invisible {user_id} {
- This procedure sets the user user_id to invisible,
- his user_id will not be returned by user_ids.
- The invisible state will only last as long as the user is online.
-
- @author Bjoern Kiesbye
-} {
- nsv_set invisible_users $user_id [ns_time]
-}
-
-ad_proc -public util::whos_online::unset_invisible {user_id} {
- This procedure unsets the invisible state of user_id.
-
- @author Bjoern Kiesbye
-} {
- nsv_unset invisible_users $user_id
-}
-
-
-ad_proc -public util::whos_online::check_invisible {user_id} {
- This function checks if the user user_id is set
- to invisible (true) , or is not set to invisible (false)
-
- @author Bjoern Kiesbye
-} {
- array set invisible [nsv_array get invisible_users]
-
- for {set search [array startsearch invisible]} {[array anymore invisible $search]} {} {
- set user [array nextelement invisible $search]
- if {$user == $user_id} {
- array donesearch invisible $search
- return "true"
- }
- array donesearch invisible $search
- return "false"
- }
-}
-
-ad_proc -public util::whos_online::all_invisible_user_ids {} {
- This function returns a list with all user_ids wich are set to invisible
-
- @author Bjoern Kiesbye
-} {
- array set invisible [nsv_array get invisible_users]
- set return_invisible [list]
- for {set search [array startsearch invisible]} {[array anymore invisible $search]} {} {
- lappend return_invisible [array nextelement invisible $search]
- }
-
- array donesearch invisible $search
- return $return_invisible
-}
Index: openacs-4/packages/acs-tcl/tcl/whos-online-init.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/whos-online-init.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-tcl/tcl/whos-online-init.tcl 3 Oct 2003 10:14:30 -0000 1.1
@@ -0,0 +1,10 @@
+ad_library {
+
+ Initializes datastrctures for whos online.
+
+ @creation-date 03 October 2003
+ @cvs-id $Id: whos-online-init.tcl,v 1.1 2003/10/03 10:14:30 lars Exp $
+}
+
+# Schedule proc to clean up whos_online data structure
+whos_online::init
Index: openacs-4/packages/acs-tcl/tcl/whos-online-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/whos-online-procs.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-tcl/tcl/whos-online-procs.tcl 3 Oct 2003 10:14:30 -0000 1.1
@@ -0,0 +1,179 @@
+ad_library {
+ Provides support for registering which users are online.
+
+ @author Bjoern Kiesbye
+ @author Peter Marklund
+ @author Lars Pind
+ @creation-date 03 October 2003
+ @cvs-id $Id: whos-online-procs.tcl,v 1.1 2003/10/03 10:14:30 lars Exp $
+}
+
+namespace eval whos_online {}
+
+
+ad_proc -private whos_online::init {} {
+ Schedules the flush proc that cleans up old who's online values.
+ Makes sure the unregistered visitor (user_id=0) is invisible.
+
+ @author Bjoern Kiesbye
+} {
+ ad_schedule_proc -thread t 3600 whos_online::flush
+
+ # We typically don't want to see the unregistered user in the who's online list
+ set_invisible 0
+}
+
+ad_proc -private whos_online::flush {} {
+ Removing all user_ids from the last_hit (nsv_set) wich have a time Stamp older than
+ the number of seconds indicated by the proc whos_online::interval.
+
+ @author Bjoern Kiesbye
+} {
+ array set last_hit [nsv_array get last_hit]
+ set onliners_out [list]
+ set interval 1
+ set oldtime [expr [ns_time] - [interval]]
+
+ for {set search [array startsearch last_hit]} {[array anymore last_hit $search]} {} {
+ set user [array nextelement last_hit $search]
+ set time $last_hit($user)
+ if {$time<$oldtime} {
+ lappend onliners_out $user
+ }
+ }
+
+ array donesearch last_hit $search
+
+ for {set i 0 } { $i < [llength $onliners_out]} {incr i} {
+ set user_id [lindex $onliners_out $i]
+ foreach name { last_hit invsible_users first_hit } {
+ if { [nsv_exists $name $user_id] } {
+ nsv_unset $name $user_id
+ }
+ }
+ }
+}
+
+ad_proc -private whos_online::interval {} {
+ Returns the last number of seconds within a user must have requested
+ a page to be considered online. Based on the LastVisitUpdateInterval parameter
+ of the main site and defaults to 600 seconds = 10 minutes.
+
+ @author Peter Marklund
+} {
+ return [parameter::get \
+ -package_id [subsite::main_site_id] \
+ -parameter LastVisitUpdateInterval \
+ -default 600]
+}
+
+ad_proc -private whos_online::user_requested_page { user_id } {
+ Records that the user with given id requested a page on the server
+
+ @author Bjoern Kiesbye
+} {
+ nsv_set last_hit $user_id [ns_time]
+ if { ![nsv_exists first_hit $user_id] } {
+ nsv_set first_hit $user_id [ns_time]
+ }
+}
+
+ad_proc -public whos_online::seconds_since_last_request { user_id } {
+ Returns the number of seconds since the user with given id requested
+ a page. Returns the empty string if the user is not currently online.
+
+ @author Peter Marklund
+} {
+ if { [nsv_exists last_hit $user_id] } {
+ return [expr [ns_time] - [nsv_get last_hit $user_id]]
+ } else {
+ return {}
+ }
+}
+
+ad_proc -public whos_online::seconds_since_first_request { user_id } {
+ Returns the number of seconds since the user with given id first requested
+ a page. Returns the empty string if the user is not currently online.
+
+ @author Peter Marklund
+} {
+ if { [nsv_exists last_hit $user_id] } {
+ return [expr [ns_time] - [nsv_get first_hit $user_id]]
+ } else {
+ return {}
+ }
+}
+
+ad_proc -public whos_online::user_ids {
+ {-all:boolean}
+} {
+ This function returns a list of user_ids from users wich have requested a page
+ from this Server in the last 10 min.And aren't set to invisible.
+
+ @param all Set this flag if you want to include invisible users.
+
+ @author Bjoern Kiesbye
+} {
+ array set last_hit [nsv_array get last_hit]
+ set onliners [list]
+ set oldtime [expr [ns_time] - [interval]]
+
+ for {set search [array startsearch last_hit]} {[array anymore last_hit $search]} {} {
+ set user_id [array nextelement last_hit $search]
+ if { $last_hit($user_id) > $oldtime } {
+ # User is online
+ if { $all_p || ![user_invisible_p $user_id] } {
+ # And he's not invisible, or we want all users
+ lappend onliners $user_id
+ }
+ }
+ }
+
+ array donesearch last_hit $search
+
+ return $onliners
+}
+
+ad_proc -public whos_online::set_invisible {
+ user_id
+} {
+ This procedure sets the user user_id to invisible,
+ his user_id will not be returned by user_ids.
+ The invisible state will only last as long as the user is online.
+
+ @author Bjoern Kiesbye
+} {
+ nsv_set invisible_users $user_id [ns_time]
+}
+
+ad_proc -public whos_online::unset_invisible {
+ user_id
+} {
+ This procedure unsets the invisible state of user_id.
+
+ @author Bjoern Kiesbye
+} {
+ if { [nsv_exists invisible_users $user_id] } {
+ nsv_unset invisible_users $user_id
+ }
+}
+
+
+ad_proc -public whos_online::user_invisible_p {
+ user_id
+} {
+ This function checks if the user user_id is set
+ to invisible. Returns a Tcl boolean.
+
+ @author Bjoern Kiesbye
+} {
+ return [nsv_exists invisible_users $user_id]
+}
+
+ad_proc -public whos_online::all_invisible_user_ids {} {
+ This function returns a list with all user_ids wich are set to invisible
+
+ @author Bjoern Kiesbye
+} {
+ return [nsv_array names invisible_users]
+}