Index: openacs-4/packages/dotlrn-admin/www/admin/admin-add-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/admin-add-2.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-admin/www/admin/admin-add-2.tcl 20 Aug 2004 14:44:22 -0000 1.1 +++ openacs-4/packages/dotlrn-admin/www/admin/admin-add-2.tcl 28 Jun 2015 12:09:33 -0000 1.2 @@ -46,7 +46,7 @@ select group_id from groups where group_name='dotlrn-admin'" -default ""] if {!$member_p} { - if {![empty_string_p $group_id] } { + if {$group_id ne "" } { group::add_member -group_id $group_id -user_id $user_id } } Index: openacs-4/packages/dotlrn-admin/www/admin/admin-remove.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/admin-remove.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-admin/www/admin/admin-remove.tcl 1 Mar 2005 00:01:28 -0000 1.2 +++ openacs-4/packages/dotlrn-admin/www/admin/admin-remove.tcl 28 Jun 2015 12:09:33 -0000 1.3 @@ -26,7 +26,7 @@ set group_id [db_string group_id_from_name " select group_id from groups where group_name='dotlrn-admin'" -default ""] - if {![empty_string_p $group_id] } { + if {$group_id ne "" } { group::remove_member -group_id $group_id -user_id $user_id } Index: openacs-4/packages/dotlrn-admin/www/admin/class-instance-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/class-instance-new.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-admin/www/admin/class-instance-new.tcl 8 Aug 2006 21:26:31 -0000 1.2 +++ openacs-4/packages/dotlrn-admin/www/admin/class-instance-new.tcl 28 Jun 2015 12:09:34 -0000 1.3 @@ -91,7 +91,7 @@ -join_policy $join_policy \ ] - if {[empty_string_p $referer]} { + if {$referer eq ""} { set referer "class?class_key=$class_key" } Index: openacs-4/packages/dotlrn-admin/www/admin/classes-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/classes-chunk.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-admin/www/admin/classes-chunk.tcl 8 Aug 2006 21:26:31 -0000 1.2 +++ openacs-4/packages/dotlrn-admin/www/admin/classes-chunk.tcl 28 Jun 2015 12:09:34 -0000 1.3 @@ -26,7 +26,7 @@ classes:multirow } -if {![exists_and_not_null department_key]} { +if {![info exists department_key] || $department_key eq ""} { set department_key "" } @@ -53,12 +53,12 @@ form get_values department_form department_key } -if {![exists_and_not_null referer]} { - set referer "classes?[export_vars department_key]" +if {![info exists referer] || $referer eq ""} { + set referer [export_vars -base classes department_key] } set query select_classes -if {![empty_string_p $department_key]} { +if {$department_key ne ""} { set query select_classes_by_department } Index: openacs-4/packages/dotlrn-admin/www/admin/cockpit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/cockpit.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-admin/www/admin/cockpit.tcl 8 Aug 2006 21:26:31 -0000 1.2 +++ openacs-4/packages/dotlrn-admin/www/admin/cockpit.tcl 28 Jun 2015 12:09:34 -0000 1.3 @@ -1,117 +1,117 @@ -# -# Copyright (C) 2001, 2002 MIT -# -# This file is part of dotLRN. -# -# dotLRN is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. -# -# dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# - -ad_page_contract { - Figure out if ds and monitoring exists and lists the active users - - @author Nima Mazloumi (mazloumi@uni-mannheim.d) - @creation-date 2004-08-09 - @version $Id$ -} - -set admin_pretty_name [parameter::get -package_id [dotlrn::get_package_id] -localize -parameter dotlrn_admin_pretty_name] - -# Does Developer support exists -set ds_exists_p 0 -set ds_url "/ds/" - -if { [site_node::exists_p -url "/ds"] } { - set ds_exists_p 1 -} else { - set url [site_node::get_package_url -package_key "acs-developer-support"] - if { $url != "" } { - set ds_exists_p 1 - } -} - -# Does monitoring exists -set monitor_exists_p 0 -set monitor_url "/monitor/" - -if { [site_node::exists_p -url "/monitor"] } { - set monitor_exists_p 1 -} else { - set monitor_url [site_node::get_package_url -package_key "monitoring"] - if { $monitor_url != "" } { - set monitor_exists_p 1 - } -} - -# Who is currently online -set whos_online_interval [whos_online::interval] - -template::list::create \ - -name online_users \ - -multirow online_users \ - -elements { - name { - label "[_ dotlrn.Name]" - html { align left } - link_url_col url - } - online_time_pretty { - label "[_ dotlrn.Minutes]" - html { align right } - } - username { - label "[_ dotlrn.Email_1]" - link_url_col email - html { align left nowrap } - } - user_id { - label "[_ dotlrn.User_ID_1]" - link_url_col id_url - html { align right } - } - } - - -set users [list] - -set count 0 - -foreach user_id [whos_online::user_ids] { - acs_user::get -user_id $user_id -array user - - set first_request_minutes [expr [whos_online::seconds_since_first_request $user_id] / 60] - lappend users [list \ - "$user(first_names) $user(last_name)" \ - [acs_community_member_url -user_id $user_id] \ - "$first_request_minutes" \ - "$user(username)" \ - "mailto:$user(email)" \ - "$user(user_id)" \ - "/acs-admin/users/one?user_id=$user(user_id)" ] - incr count -} - - -set users [lsort -index 0 $users] - -multirow create online_users name url online_time_pretty username email user_id id_url - -foreach elm $users { - multirow append online_users \ - [lindex $elm 0] \ - [lindex $elm 1] \ - [lindex $elm 2] \ - [lindex $elm 3] \ - [lindex $elm 4] \ - [lindex $elm 5] \ - [lindex $elm 6] -} - +# +# Copyright (C) 2001, 2002 MIT +# +# This file is part of dotLRN. +# +# dotLRN is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# + +ad_page_contract { + Figure out if ds and monitoring exists and lists the active users + + @author Nima Mazloumi (mazloumi@uni-mannheim.d) + @creation-date 2004-08-09 + @version $Id$ +} + +set admin_pretty_name [parameter::get -package_id [dotlrn::get_package_id] -localize -parameter dotlrn_admin_pretty_name] + +# Does Developer support exists +set ds_exists_p 0 +set ds_url "/ds/" + +if { [site_node::exists_p -url "/ds"] } { + set ds_exists_p 1 +} else { + set url [site_node::get_package_url -package_key "acs-developer-support"] + if { $url ne "" } { + set ds_exists_p 1 + } +} + +# Does monitoring exists +set monitor_exists_p 0 +set monitor_url "/monitor/" + +if { [site_node::exists_p -url "/monitor"] } { + set monitor_exists_p 1 +} else { + set monitor_url [site_node::get_package_url -package_key "monitoring"] + if { $monitor_url ne "" } { + set monitor_exists_p 1 + } +} + +# Who is currently online +set whos_online_interval [whos_online::interval] + +template::list::create \ + -name online_users \ + -multirow online_users \ + -elements { + name { + label "[_ dotlrn.Name]" + html { align left } + link_url_col url + } + online_time_pretty { + label "[_ dotlrn.Minutes]" + html { align right } + } + username { + label "[_ dotlrn.Email_1]" + link_url_col email + html { align left nowrap } + } + user_id { + label "[_ dotlrn.User_ID_1]" + link_url_col id_url + html { align right } + } + } + + +set users [list] + +set count 0 + +foreach user_id [whos_online::user_ids] { + acs_user::get -user_id $user_id -array user + + set first_request_minutes [expr {[whos_online::seconds_since_first_request $user_id] / 60}] + lappend users [list \ + "$user(first_names) $user(last_name)" \ + [acs_community_member_url -user_id $user_id] \ + "$first_request_minutes" \ + "$user(username)" \ + "mailto:$user(email)" \ + "$user(user_id)" \ + "/acs-admin/users/one?user_id=$user(user_id)" ] + incr count +} + + +set users [lsort -index 0 $users] + +multirow create online_users name url online_time_pretty username email user_id id_url + +foreach elm $users { + multirow append online_users \ + [lindex $elm 0] \ + [lindex $elm 1] \ + [lindex $elm 2] \ + [lindex $elm 3] \ + [lindex $elm 4] \ + [lindex $elm 5] \ + [lindex $elm 6] +} + ad_return_template \ No newline at end of file Index: openacs-4/packages/dotlrn-admin/www/admin/community-members-add-to-community.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/community-members-add-to-community.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-admin/www/admin/community-members-add-to-community.tcl 20 Aug 2004 14:44:22 -0000 1.1 +++ openacs-4/packages/dotlrn-admin/www/admin/community-members-add-to-community.tcl 28 Jun 2015 12:09:34 -0000 1.2 @@ -75,7 +75,7 @@ form get_values select_community \ source_community_id community_id - if {![empty_string_p $community_id]} { + if {$community_id ne ""} { db_transaction { foreach user $users { set user_id [ns_set get $user user_id] @@ -112,6 +112,6 @@ ad_script_abort } -set estimated_number_of_seconds [expr [llength $users] * 3] +set estimated_number_of_seconds [expr {[llength $users] * 3}] ad_return_template Index: openacs-4/packages/dotlrn-admin/www/admin/department-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/department-delete.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-admin/www/admin/department-delete.tcl 8 Aug 2006 21:26:31 -0000 1.2 +++ openacs-4/packages/dotlrn-admin/www/admin/department-delete.tcl 28 Jun 2015 12:09:34 -0000 1.3 @@ -68,7 +68,7 @@ if {[form is_valid delete_department]} { form get_values delete_department department_key pretty_name referer no_button yes_button - if {[string equal $yes_button $yes_label]} { + if {$yes_button eq $yes_label} { db_transaction { set subcomm_id [dotlrn_department::delete \ Index: openacs-4/packages/dotlrn-admin/www/admin/department.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/department.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-admin/www/admin/department.tcl 8 Aug 2006 21:26:31 -0000 1.2 +++ openacs-4/packages/dotlrn-admin/www/admin/department.tcl 28 Jun 2015 12:09:34 -0000 1.3 @@ -30,7 +30,7 @@ classes:multirow } -if {[empty_string_p $department_key]} { +if {$department_key eq ""} { ad_returnredirect "[dotlrn_admin::get_admin_url]/classes" ad_script_abort } Index: openacs-4/packages/dotlrn-admin/www/admin/password-update-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/password-update-2.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-admin/www/admin/password-update-2.tcl 2 Dec 2013 09:25:24 -0000 1.2 +++ openacs-4/packages/dotlrn-admin/www/admin/password-update-2.tcl 28 Jun 2015 12:09:34 -0000 1.3 @@ -10,12 +10,12 @@ } -validate { confirm_password -requires {password_2:notnull} { - if {[empty_string_p $password_2]} { + if {$password_2 eq ""} { ad_complain "[_ dotlrn.lt_You_need_to_confirm_t]" } } new_password_match -requires {password_1:notnull password_2:notnull confirm_password} { - if {![string equal $password_1 $password_2]} { + if {$password_1 ne $password_2 } { ad_complain "[_ dotlrn.lt_Your_passwords_dont_m]" } } @@ -28,13 +28,13 @@ set system_name [ad_system_name] set subject "[_ dotlrn.lt_Your_password_on_syst]" -set change_password_url "[ad_url]/user/password-update?[export_vars {user_id {password_old $password_1}}]" +set change_password_url [export_vars -base [ad_url]/user/password-update {user_id {password_old $password_1}}] set body "[_ dotlrn.lt_Please_follow_the_fol]" set email [acs_user::get_element -user_id $user_id -element email] # Send email -if [catch {acs_mail_lite::send -to_addr $email -from_addr $system_owner -subject $subject -body $body} errmsg] { +if {[catch {acs_mail_lite::send -to_addr $email -from_addr $system_owner -subject $subject -body $body} errmsg]} { ns_log Error "[_ dotlrn.lt_Error_sending_email_t]" $errmsg ad_return_error \ "[_ dotlrn.Error_sending_mail]" \ @@ -46,7 +46,7 @@ set admin_message "[_ dotlrn.lt_The_following_email_w_1]" - if [catch {acs_mail_lite::send -to_addr $system_owner -from_addr $system_owner -subject $admin_subject -body $admin_message} errmsg] { + if {[catch {acs_mail_lite::send -to_addr $system_owner -from_addr $system_owner -subject $admin_subject -body $admin_message} errmsg]} { ns_log Error "Error sending email from password-update-2.tcl" $errmsg ad_return_error \ @@ -56,7 +56,7 @@ } -if {[empty_string_p $return_url]} { +if {$return_url eq ""} { set return_url "user?user_id=$user_id" } Index: openacs-4/packages/dotlrn-admin/www/admin/site-wide-admin-toggle.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/site-wide-admin-toggle.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-admin/www/admin/site-wide-admin-toggle.tcl 20 Aug 2004 14:44:22 -0000 1.1 +++ openacs-4/packages/dotlrn-admin/www/admin/site-wide-admin-toggle.tcl 28 Jun 2015 12:09:34 -0000 1.2 @@ -35,9 +35,9 @@ </blockquote>" } -if {[string equal $value "grant"] == 1} { +if {$value eq "grant"} { ad_permission_grant $user_id [acs_magic_object "security_context_root"] "admin" -} elseif {[string equal $value "revoke"] == 1} { +} elseif {$value eq "revoke"} { ad_permission_revoke $user_id [acs_magic_object "security_context_root"] "admin" } Index: openacs-4/packages/dotlrn-admin/www/admin/term-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/term-edit.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-admin/www/admin/term-edit.tcl 20 Aug 2004 14:44:22 -0000 1.1 +++ openacs-4/packages/dotlrn-admin/www/admin/term-edit.tcl 28 Jun 2015 12:09:34 -0000 1.2 @@ -35,7 +35,7 @@ ad_script_abort } -set referer "term?[export_vars {term_id}]" +set referer [export_vars -base term {term_id}] set context_bar [list [list terms [_ dotlrn.Terms]] [list $referer "$term_name $term_year"] [_ dotlrn.Edit]] ad_form -name edit_term -export term_pretty_name -select_query_name select_term_info -form { Index: openacs-4/packages/dotlrn-admin/www/admin/term.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/term.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-admin/www/admin/term.tcl 8 Aug 2006 21:26:31 -0000 1.2 +++ openacs-4/packages/dotlrn-admin/www/admin/term.tcl 28 Jun 2015 12:09:34 -0000 1.3 @@ -85,19 +85,19 @@ form get_values term_form term_id department_key if {$term_id != -1} { - ad_returnredirect "term?[export_vars {term_id department_key}]" + ad_returnredirect [export_vars -base term {term_id department_key}] } } -if {![exists_and_not_null referer]} { +if {(![info exists referer] || $referer eq "")} { set referer "terms" } set query "select_classes" if {$term_id == -1} { set query "select_all_classes" } -if {![empty_string_p $department_key]} { +if {$department_key ne ""} { append query "_by_department" } Index: openacs-4/packages/dotlrn-admin/www/admin/unarchive.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/unarchive.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-admin/www/admin/unarchive.tcl 20 Aug 2004 14:44:22 -0000 1.1 +++ openacs-4/packages/dotlrn-admin/www/admin/unarchive.tcl 28 Jun 2015 12:09:34 -0000 1.2 @@ -1,39 +1,39 @@ -# -# Copyright (C) 2001, 2002 MIT -# -# This file is part of dotLRN. -# -# dotLRN is free software; you can redistribute it and/or modify it under the -# terms of the GNU General Public License as published by the Free Software -# Foundation; either version 2 of the License, or (at your option) any later -# version. -# -# dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY -# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more -# details. -# - -ad_page_contract { - Unarchive a Community - - @author Nima Mazloumi - @creation-date 2004-04-25 - @version $Id: unarchive.tcl -} -query { - {community_id ""} - {referer "."} -} - -if { [exists_and_not_null community_id] } { - set is_archived_p [db_0or1row select_is_archived "select archived_p from dotlrn_communities_all where community_id = :community_id"] - if { $is_archived_p } { - ns_log Notice "Unarchiving $community_id" - dotlrn_community::unarchive -community_id $community_id - } else { - ad_return -code error "community must be archived to get unarchived" - } -} else { - ad_return -code error "community id expected to unarchive a community" -} -ad_returnredirect $referer +# +# Copyright (C) 2001, 2002 MIT +# +# This file is part of dotLRN. +# +# dotLRN is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# dotLRN is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +# details. +# + +ad_page_contract { + Unarchive a Community + + @author Nima Mazloumi + @creation-date 2004-04-25 + @version $Id: unarchive.tcl +} -query { + {community_id ""} + {referer "."} +} + +if { ([info exists community_id] && $community_id ne "") } { + set is_archived_p [db_0or1row select_is_archived "select archived_p from dotlrn_communities_all where community_id = :community_id"] + if { $is_archived_p } { + ns_log Notice "Unarchiving $community_id" + dotlrn_community::unarchive -community_id $community_id + } else { + ad_return -code error "community must be archived to get unarchived" + } +} else { + ad_return -code error "community id expected to unarchive a community" +} +ad_returnredirect $referer Index: openacs-4/packages/dotlrn-admin/www/admin/user-new-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user-new-2.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn-admin/www/admin/user-new-2.tcl 2 Dec 2013 09:25:24 -0000 1.3 +++ openacs-4/packages/dotlrn-admin/www/admin/user-new-2.tcl 28 Jun 2015 12:09:34 -0000 1.4 @@ -84,7 +84,7 @@ set subject "Your [ad_system_name] membership has been approved" set message "Your [ad_system_name] membership has been approved. Please return to [ad_url] to log into [ad_system_name]." - set email_from [ad_parameter -package_id [ad_acs_kernel_id] SystemOwner] + set email_from [parameter::get -package_id [ad_acs_kernel_id] -parameter SystemOwner] db_transaction { @@ -100,7 +100,7 @@ } - if [catch {acs_mail_lite::send -to_addr $email -from_addr $email_from -subject $subject -body $message} errmsg] { + if {[catch {acs_mail_lite::send -to_addr $email -from_addr $email_from -subject $subject -body $message} errmsg]} { ns_log Error "Error sending email from user-new-2.tcl" $errmsg ad_return_error \ @@ -118,7 +118,7 @@ Message: $message" - if [catch {acs_mail_lite::send -to_addr $email_from -from_addr $email_from -subject $admin_subject -body $admin_message} errmsg] { + if {[catch {acs_mail_lite::send -to_addr $email_from -from_addr $email_from -subject $admin_subject -body $admin_message} errmsg]} { ns_log Error "Error sending email from user-new-2.tcl" $errmsg ad_return_error \ Index: openacs-4/packages/dotlrn-admin/www/admin/user-nuke.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user-nuke.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-admin/www/admin/user-nuke.tcl 8 Aug 2006 21:26:31 -0000 1.2 +++ openacs-4/packages/dotlrn-admin/www/admin/user-nuke.tcl 28 Jun 2015 12:09:34 -0000 1.3 @@ -35,10 +35,10 @@ set context_bar [list [list users [_ dotlrn.Users]] [_ dotlrn.Nuke]] -if [form is_valid confirm_delete] { +if {[form is_valid confirm_delete]} { form get_values confirm_delete user_id confirmed_p - if [string equal $confirmed_p t] { - if [catch { dotlrn::remove_user_completely -user_id $user_id } errMsg ] { + if {$confirmed_p == "t"} { + if {[catch { dotlrn::remove_user_completely -user_id $user_id } errMsg ]} { set error_msg $errMsg ad_return_template user-nuke-error } else { Index: openacs-4/packages/dotlrn-admin/www/admin/user.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/user.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-admin/www/admin/user.tcl 8 Aug 2006 21:26:31 -0000 1.2 +++ openacs-4/packages/dotlrn-admin/www/admin/user.tcl 28 Jun 2015 12:09:34 -0000 1.3 @@ -43,7 +43,7 @@ set oacs_site_wide_admin_p [acs_user::site_wide_admin_p] -set return_url "[ad_parameter -package_id [ad_acs_kernel_id] CommunityMemberAdminURL]?user_id=$user_id" +set return_url "[parameter::get -package_id [ad_acs_kernel_id] -parameter CommunityMemberAdminURL]?user_id=$user_id" set export_edit_vars "user_id=$user_id&return_url=$return_url" set dotlrn_url [dotlrn::get_url] @@ -52,11 +52,11 @@ ad_return_complaint 1 "<li>[_ dotlrn.couldnt_find_user_id [list user_id $user_id]]</li>" ad_script_abort } -if {[empty_string_p $screen_name]} { +if {$screen_name eq ""} { set screen_name "<[_ dotlrn.none_set_up]>" } set registration_date [lc_time_fmt $registration_date "%q"] -if {![empty_string_p $last_visit]} { +if {$last_visit ne ""} { set last_visit [lc_time_fmt $last_visit "%q"] } @@ -68,7 +68,7 @@ set can_browse_p [dotlrn::user_can_browse_p -user_id $user_id] set portrait_p 0 -if {[ad_parameter "show_portrait_p" dotlrn] && [db_0or1row select_portrait_info {}]} { +if {[parameter::get -parameter "show_portrait_p"] && [db_0or1row select_portrait_info {}]} { set portrait_p 1 } @@ -96,7 +96,8 @@ set approve_user_url "/acs-admin/users/member-state-change?user_id=$user_id&member_state=approved&return_url=$dual_approve_return_url" -set remove_user_url "\[<small><a href=\"[export_vars -base user-nuke {user_id}]\">Nuke</a></small>\]" +set href [export_vars -base user-nuke {user_id}] +set remove_user_url [subst {\[<small><a href="[ns_quotehtml $href]">Nuke</a></small>\]}] # Used in some en_US messages in the adp file set class_instances_pretty_name [parameter::get -package_id [dotlrn::get_package_id] -localize -parameter class_instances_pretty_name] Index: openacs-4/packages/dotlrn-admin/www/admin/users-add-to-community.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-add-to-community.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-admin/www/admin/users-add-to-community.tcl 20 Aug 2004 14:44:22 -0000 1.1 +++ openacs-4/packages/dotlrn-admin/www/admin/users-add-to-community.tcl 28 Jun 2015 12:09:34 -0000 1.2 @@ -70,7 +70,7 @@ form get_values select_community \ users community_id - if {![empty_string_p $community_id]} { + if {$community_id ne ""} { db_transaction { foreach user $users { dotlrn_community::add_user $community_id $user @@ -87,8 +87,8 @@ } } - set subject "You have been added to the \"$community_name\" community at [ad_parameter -package_id [ad_acs_kernel_id] SystemURL]" - set message "To visit the community's home page, point your browser at [ad_parameter -package_id [ad_acs_kernel_id] SystemURL], + set subject "You have been added to the \"$community_name\" community at [parameter::get -package_id [ad_acs_kernel_id] -parameter SystemURL]" + set message "To visit the community's home page, point your browser at [parameter::get -package_id [ad_acs_kernel_id] -parameter SystemURL], log in, and click on the \"$community_name\" link in the \"Groups\" portlet. " Index: openacs-4/packages/dotlrn-admin/www/admin/users-bulk-upload-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-bulk-upload-2.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/dotlrn-admin/www/admin/users-bulk-upload-2.tcl 2 Dec 2013 09:25:24 -0000 1.3 +++ openacs-4/packages/dotlrn-admin/www/admin/users-bulk-upload-2.tcl 28 Jun 2015 12:09:34 -0000 1.4 @@ -58,7 +58,7 @@ # Check if this user already exists set user_id [cc_lookup_email_user $row(email)] - if {![empty_string_p $user_id]} { + if {$user_id ne ""} { doc_body_append [_ dotlrn.user_email_already_exists [list user_email $row(email)]] lappend list_of_user_ids $user_id } else { @@ -110,14 +110,14 @@ doc_body_append [_ dotlrn.user_email_created [list user_email $row(email)]] set msg_subst_list [list system_name [ad_system_name] \ - system_url [ad_parameter SystemUrl] \ + system_url [parameter::get -parameter SystemUrl] \ user_email $row(email) \ user_password $password] set message [_ dotlrn.user_add_confirm_email_body $msg_subst_list] set subject [_ dotlrn.user_add_confirm_email_subject $msg_subst_list] # Send note to new user - if [catch {acs_mail_lite::send -to_addr $row(email) -from_addr $admin_email -subject $subject -body $message} errmsg] { + if {[catch {acs_mail_lite::send -to_addr $row(email) -from_addr $admin_email -subject $subject -body $message} errmsg]} { doc_body_append "[_ dotlrn.lt_emailing_this_user_fa]" set fail_p 1 } else { @@ -140,15 +140,15 @@ doc_body_append "<p>Sending email notifications to users...<p>" foreach {email password} $list_of_addresses_and_passwords { - if { ![string equal $password ""] } { + if { $password ne "" } { set message " -You have been added as a user to [ad_system_name] at [ad_parameter -package_id [ad_acs_kernel_id] SystemURL]. +You have been added as a user to [ad_system_name] at [parameter::get -package_id [ad_acs_kernel_id] -parameter SystemURL]. Login: $email Password: $password " # Send note to new user - if [catch {acs_mail_lite::send -to_addr $email -from_addr $admin_email -subject "You have been added as a user to [ad_system_name] at [ad_parameter -package_id [ad_acs_kernel_id] SystemURL]" -body $message} errmsg] { + if [catch {acs_mail_lite::send -to_addr $email -from_addr $admin_email -subject "You have been added as a user to [ad_system_name] at [parameter::get -package_id [ad_acs_kernel_id] -parameter SystemURL]" -body $message} errmsg] { doc_body_append "emailing \"$email\" failed!<br>" set fail_p 1 } else { Index: openacs-4/packages/dotlrn-admin/www/admin/users-chunk-large.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-chunk-large.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-admin/www/admin/users-chunk-large.tcl 8 Aug 2006 21:26:31 -0000 1.2 +++ openacs-4/packages/dotlrn-admin/www/admin/users-chunk-large.tcl 28 Jun 2015 12:09:34 -0000 1.3 @@ -25,11 +25,11 @@ users:multirow } -if {![exists_and_not_null type]} { +if {(![info exists type] || $type eq "")} { set type admin } -if {![exists_and_not_null referer]} { +if {(![info exists referer] || $referer eq "")} { set referer "[dotlrn_admin::get_admin_url]/users" } @@ -63,12 +63,12 @@ set root_object_id [acs_magic_object security_context_root] set i 1 - if {[string equal $type deactivated] == 1} { + if {$type eq "deactivated"} { db_multirow users select_deactivated_users {} { set users:${i}(access_level) Limited incr i } - } elseif {[string equal $type pending] == 1} { + } elseif {$type eq "pending"} { db_multirow users select_non_dotlrn_users {} { set users:${i}(access_level) N/A incr i Index: openacs-4/packages/dotlrn-admin/www/admin/users-chunk-medium.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-chunk-medium.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-admin/www/admin/users-chunk-medium.tcl 8 Aug 2006 21:26:31 -0000 1.2 +++ openacs-4/packages/dotlrn-admin/www/admin/users-chunk-medium.tcl 28 Jun 2015 12:09:34 -0000 1.3 @@ -30,11 +30,11 @@ set dotlrn_package_id [dotlrn::get_package_id] set root_object_id [acs_magic_object security_context_root] -if {![exists_and_not_null type]} { +if {(![info exists type] || $type eq "")} { set type admin } -if {![exists_and_not_null referer]} { +if {(![info exists referer] || $referer eq "")} { set referer "[dotlrn_admin::get_admin_url]/users" } @@ -47,18 +47,18 @@ set control_bar [portal::dimensional -no_bars [list [list section {} $section $dimensions]]] set i 1 -if {[string equal $type deactivated] == 1} { +if {$type eq "deactivated"} { set query select_deactivated_users - if {[string match Other $section]} { + if {"Other" eq $section} { append query "_other" } db_multirow users $query {} { set users:${i}(access_level) Limited incr i } -} elseif {[string equal $type pending] == 1} { +} elseif {$type eq "pending"} { set query select_non_dotlrn_users - if {[string match Other $section]} { + if {"Other" eq $section} { append query "_other" } db_multirow users $query {} { @@ -67,7 +67,7 @@ } } else { set query select_dotlrn_users - if {[string match Other $section]} { + if {"Other" eq $section} { append query "_other" } db_multirow users $query {} { Index: openacs-4/packages/dotlrn-admin/www/admin/users-chunk-small.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-chunk-small.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-admin/www/admin/users-chunk-small.tcl 8 Aug 2006 21:26:31 -0000 1.2 +++ openacs-4/packages/dotlrn-admin/www/admin/users-chunk-small.tcl 28 Jun 2015 12:09:34 -0000 1.3 @@ -28,22 +28,22 @@ set dotlrn_package_id [dotlrn::get_package_id] set root_object_id [acs_magic_object security_context_root] -if {![exists_and_not_null type]} { +if {(![info exists type] || $type eq "")} { set type admin } -if {![exists_and_not_null referer]} { +if {(![info exists referer] || $referer eq "")} { set referer "[dotlrn_admin::get_admin_url]/users" } # Currently, just present a list of dotLRN users set i 1 -if {[string equal $type deactivated] == 1} { +if {$type eq "deactivated"} { db_multirow users select_deactivated_users {} { set users:${i}(access_level) Limited incr i } -} elseif {[string equal $type pending] == 1} { +} elseif {$type eq "pending"} { db_multirow users select_non_dotlrn_users {} { set users:${i}(access_level) N/A incr i Index: openacs-4/packages/dotlrn-admin/www/admin/users-chunk.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-chunk.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/dotlrn-admin/www/admin/users-chunk.tcl 8 Aug 2006 21:26:31 -0000 1.2 +++ openacs-4/packages/dotlrn-admin/www/admin/users-chunk.tcl 28 Jun 2015 12:09:34 -0000 1.3 @@ -27,7 +27,7 @@ set oacs_site_wide_admin_p [acs_user::site_wide_admin_p] set user_id [ad_conn user_id] -if {![exists_and_not_null referer]} { +if {(![info exists referer] || $referer eq "")} { set referer "[dotlrn_admin::get_admin_url]/users" } Index: openacs-4/packages/dotlrn-admin/www/admin/users-search.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users-search.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-admin/www/admin/users-search.tcl 20 Aug 2004 14:44:22 -0000 1.1 +++ openacs-4/packages/dotlrn-admin/www/admin/users-search.tcl 28 Jun 2015 12:09:34 -0000 1.2 @@ -64,16 +64,16 @@ switch -exact $search_action { "spam" { - ad_returnredirect "users-spam?[export_vars {{users $selected_users}}]" + ad_returnredirect [export_vars -base users-spam {{users $selected_users}}] } "add_to_community" { - ad_returnredirect "users-add-to-community?[export_vars {{users $selected_users}}]" + ad_returnredirect [export_vars -base users-add-to-community {{users $selected_users}}] } "deactivate" { - ad_returnredirect "users-deactivate?[export_vars {{users $selected_users}}]" + ad_returnredirect [export_vars -base users-deactivate {{users $selected_users}}] } "delete" { - ad_returnredirect "users-delete?[export_vars {{users $selected_users}}]" + ad_returnredirect [export_vars -base users-delete {{users $selected_users}}] } } } @@ -149,7 +149,7 @@ form get_values user_search \ id type can_browse_p guest_p last_visit_greater last_visit_less name join_criteria - if {([string equal "and" $join_criteria] == 0) && ([string equal "or" $join_criteria] == 0)} { + if {("and" ne $join_criteria ) && ("or" ne $join_criteria )} { ad_return_error \ "[_ dotlrn.lt_There_was_a_bug_in_th]" \ "[_ dotlrn.lt_There_was_a_bug_in_th_1]" @@ -168,16 +168,16 @@ ] set wheres [list] - if {![empty_string_p $name]} { + if {$name ne ""} { lappend wheres "(lower(dotlrn_users.last_name) like lower('%' || :name || '%') or lower(dotlrn_users.first_names) like lower('%' || :name || '%') or lower(dotlrn_users.email) like lower('%' || :name || '%'))" } - if {![empty_string_p $id]} { + if {$id ne ""} { lappend wheres "(lower(dotlrn_users.id) like lower('%' || :id || '%'))" } - if {![empty_string_p $type]} { - if {[string equal "any" $type] == 1} { + if {$type ne ""} { + if {"any" eq $type} { lappend wheres "dotlrn_users.type in (\'[join [dotlrn::get_user_types] \',\']\')" } else { lappend wheres "dotlrn_users.type = :type" @@ -204,15 +204,15 @@ } } - if {![empty_string_p $last_visit_greater]} { - if {[lsearch -exact $tables "users"] == -1} { + if {$last_visit_greater ne ""} { + if {"users" ni $tables} { lappend tables "users" } lappend wheres "(dotlrn_users.user_id = users.user_id and users.last_visit <= (sysdate - :last_visit_greater))" } - if {![empty_string_p $last_visit_less]} { - if {[lsearch -exact $tables "users"] == -1} { + if {$last_visit_less ne ""} { + if {"users" ni $tables} { lappend tables "users" } lappend wheres "(dotlrn_users.user_id = users.user_id and users.last_visit >= (sysdate - :last_visit_less))" @@ -222,7 +222,7 @@ set role_list_length [llength $role_list] if {$role_list_length} { - if {[lsearch -exact $tables "acs_rels"] == -1} { + if {"acs_rels" ni $tables} { lappend tables "acs_rels" } set in_clause "(dotlrn_users.user_id = acs_rels.object_id_two and acs_rels.rel_type in (" @@ -255,7 +255,8 @@ set selected_users_options [list] set selected_users_values [list] db_foreach select_users $sql { - lappend selected_users_options [list "<a href=\"user?[export_vars user_id]\">$last_name, $first_names</a> ($email)" $user_id] + set href [export_vars -base user user_id] + lappend selected_users_options [list [subst {<a href="[ns_quotehtml $href]">$last_name, $first_names</a> ($email)}] $user_id] lappend selected_users_values $user_id } Index: openacs-4/packages/dotlrn-admin/www/admin/users.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-admin/www/admin/users.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/dotlrn-admin/www/admin/users.tcl 20 Aug 2004 14:44:22 -0000 1.1 +++ openacs-4/packages/dotlrn-admin/www/admin/users.tcl 28 Jun 2015 12:09:34 -0000 1.2 @@ -55,9 +55,9 @@ set control_bar [ad_dimensional [list [list type "[_ dotlrn.User_Type]:" $type $dotlrn_roles_localized]]] -if {[string equal $type "deactivated"] == 1} { +if {$type eq "deactivated"} { set n_users $n_deactivated_users -} elseif {[string equal $type "pending"] == 1} { +} elseif {$type eq "pending"} { set n_users $n_pending_users } else { set n_users [db_string select_dotlrn_users_count {}]