Index: openacs-4/packages/dotlrn/www/control-panel.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn/www/control-panel.tcl,v diff -u -r1.9.2.1 -r1.9.2.2 --- openacs-4/packages/dotlrn/www/control-panel.tcl 31 May 2005 23:13:06 -0000 1.9.2.1 +++ openacs-4/packages/dotlrn/www/control-panel.tcl 18 May 2006 19:24:28 -0000 1.9.2.2 @@ -34,7 +34,7 @@ set portal_id [dotlrn::get_portal_id -user_id [ad_get_user_id]] # Make sure user is logged in -set user_id [ad_maybe_redirect_for_registration] +set user_id [auth::require_login -account_status closed] set title [parameter::get -localize -parameter admin_page_name] set admin_p [dotlrn::admin_p] @@ -47,3 +47,50 @@ set pvt_home [ad_pvt_home] set pvt_home_name [ad_pvt_home_name] +acs_user::get -array user -include_bio -user_id $user_id + +set account_status [ad_conn account_status] + +set community_member_url [acs_community_member_url -user_id $user_id] + +set notifications_url [lindex [site_node::get_children -node_id [subsite::get_element -element node_id] -package_key "notifications"] 0] + +set system_name [ad_system_name] + +set portrait_upload_url [export_vars -base "../user/portrait/upload" { { return_url [ad_return_url] } }] + +if { [llength [lang::system::get_locales]] > 1 } { + set change_locale_url [apm_package_url_from_key "acs-lang"] +} + + + +if [ad_parameter SolicitPortraitP "user-info" 0] { + # we have portraits for some users + if ![db_0or1row get_portrait_info " + select cr.publish_date, nvl(cr.title,'your portrait') as portrait_title, + nvl(cr.description,'no description') as portrait_description + from cr_revisions cr, cr_items ci, acs_rels a + where cr.revision_id = ci.live_revision + and ci.item_id = a.object_id_two + and a.object_id_one = :user_id + and a.rel_type = 'user_portrait_rel' + "] { + set portrait_state "upload" + } else { + if { [empty_string_p $portrait_title] } { + set portrait_title "[_ acs-subsite.no_portrait_title_message]" + } + + set portrait_state "show" + set portrait_publish_date [lc_time_fmt $publish_date "%q"] + } +} else { + set portrait_state "none" +} + + +set whos_online_url "[subsite::get_element -element url]shared/whos-online" +set make_visible_url "[subsite::get_element -element url]shared/make-visible" +set make_invisible_url "[subsite::get_element -element url]shared/make-invisible" +set invisible_p [whos_online::user_invisible_p [ad_conn untrusted_user_id]]