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.4.2.1 -r1.4.2.2 --- openacs-4/packages/acs-subsite/www/pvt/home.adp 5 Jun 2003 16:40:50 -0000 1.4.2.1 +++ openacs-4/packages/acs-subsite/www/pvt/home.adp 2 Jul 2003 20:03:41 -0000 1.4.2.2 @@ -1,70 +1,36 @@ -@full_name@'s workspace at @system_name@ -@context@ + @page_title@ + @context@ + first_names - - -

What we tell other users about you

- -In general we identify content that you've posted by your full name. -In an attempt to protect you from unsolicited bulk email (spam), we -keep your email address hidden except from other registered users. -Total privacy is technically feasible but an important element of an -online community is that people can learn from each other. So we try -to make it possible for users with common interests to contact each -other. - -

- -If you want to check what other users of this service are shown, visit -@member_link@ - -

Basic Information

- - -

(update)

- - - - -

Your Portrait

-Show everyone else at @system_name@ how great looking you are: upload a portrait - + +

Portrait

+

+ Show everyone else at @system_name@ how great looking you are: upload a portrait +

+
+ +

Portrait

+

+ On @portrait_publish_date@, you uploaded @portrait_title@. +

+
- - -

Your Portrait

-On @portrait_publish_date@, you uploaded @portrait_title@. - -
- - - -

If you're getting too much email from us

- -Then you should either - - -

or

- Index: openacs-4/packages/acs-subsite/www/pvt/home.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/pvt/home.tcl,v diff -u -r1.5 -r1.5.2.1 --- openacs-4/packages/acs-subsite/www/pvt/home.tcl 6 Sep 2002 21:50:08 -0000 1.5 +++ openacs-4/packages/acs-subsite/www/pvt/home.tcl 2 Jul 2003 20:03:40 -0000 1.5.2.1 @@ -19,67 +19,90 @@ member_link:onevalue } -set user_id [ad_verify_and_get_user_id] +ad_maybe_redirect_for_registration -# If there are requirements to fulfill. +set user_id [ad_conn user_id] -# if {![string compare [db_string pvt_home_check_requirements { -# select user_fulfills_requirements_p(:user_id) from dual -# }] "f"]} { -# ad_returnredirect "fulfill-requirements" -# return -# } +acs_user::get -array user -include_bio -# # if this user is part of intranet employees, send 'em over! -# if { [im_enabled_p] } { -# if { [im_user_is_employee_p $user_id] } { -# ad_returnredirect [im_url_stub] -# return -# } -# if { [im_user_is_customer_p $user_id] } { -# set portal_extension [ad_parameter PortalExtension portals .ptl] -# set group_name [ad_parameter CustomerPortalName intranet "Customer Portals"] -# regsub -all { } [string tolower $group_name] {-} group_name_in_link -# ad_returnredirect "/portals/${group_name_in_link}-1$portal_extension" -# return -# } -# } +set page_title [ad_pvt_home_name] -set user_exists_p [db_0or1row pvt_home_user_info { - select first_names, last_name, email, url, - nvl(screen_name,'< none set up >') as screen_name - from cc_users - where user_id=:user_id -}] +set context [list $page_title] +set ad_url [ad_url] +set community_member_url [acs_community_member_url -user_id $user_id] -set bio [db_string biography " -select attr_value -from acs_attribute_values -where object_id = :user_id -and attribute_id = - (select attribute_id - from acs_attributes - where object_type = 'person' - and attribute_name = 'bio')" -default ""] +set system_name [ad_system_name] -if { ! $user_exists_p } { - if {$user_id == 0} { - ad_redirect_for_registration - ad_script_abort +# LARS: +# This form doesn't include screen_name, because we currently don't use that anywhere + +ad_form -name user_info -cancel_url [ad_conn url] -mode display -form { + {first_names:text + {label "First names"} + {html {size 50}} } - ad_return_error "Account Unavailable" "We can't find you (user #$user_id) in the users table. Probably your account was deleted for some reason. You can visit the log out page and then start over." + {last_name:text + {label "Last Name"} + {html {size 50}} + } + {email:text + {label "Email"} + {html {size 50}} + } + {screen_name:text,optional + {label "Screen name"} + {html {size 50}} + } + {url:text,optional + {label "Home Page"} + {html {size 80}} + } + {bio:text(textarea),optional + {label "About yourself"} + {html {rows 8 cols 60}} + } +} -on_request { + foreach var { first_names last_name email screen_name url bio } { + set $var $user($var) + } +} -on_submit { + db_transaction { + person::update \ + -person_id $user_id \ + -first_names $first_names \ + -last_name $last_name + + party::update \ + -party_id $user_id \ + -email $email \ + -url $url + + acs_user::update \ + -user_id $user_id \ + -screen_name $screen_name + + person::update_bio \ + -person_id $user_id \ + -bio $bio + } +} -after_submit { + ad_returnredirect [ad_conn url] ad_script_abort } -if { ![empty_string_p $first_names] || ![empty_string_p $last_name] } { - set full_name "$first_names $last_name" -} else { - set full_name "name unknown" +# TODO: Validate email: [util_email_valid_p $email] +# TODO: Validate email unique + +# LARS HACK: Make the URL and email elements real links +if { ![form is_valid user_info] } { + element set_properties user_info email -display_value "[element get_value user_info email]" + element set_properties user_info url -display_value "[element get_value user_info url]" } -set system_name [ad_system_name] +# The template needs to know if this is a request +set form_request_p [expr [form is_request user_info] && [empty_string_p [form get_action user_info]]] if [ad_parameter SolicitPortraitP "user-info" 0] { # we have portraits for some users @@ -101,109 +124,6 @@ } -# [ad_decorate_top "

$full_name

-# workspace at [ad_system_name] -# " [ad_parameter WorkspacePageDecoration pvt]] -set header [ad_header "$full_name's workspace at $system_name"] - -if {[ad_conn package_url] == "/"} { - set context [list "[ad_pvt_home_name]"] -} else { - set context [list "Home"] -} - -# set site_map [ad_parameter SiteMap content] - -# if ![empty_string_p $site_map] { -# append page_content "\n

\n

  • site map\n" -# } - -# db_foreach pvt_home_administration_group_info { -# select ug.group_id, ug.group_name, ai.url as ai_url -# from user_groups ug, administration_info ai -# where ug.group_id = ai.group_id -# and ad_group_member_p ( :user_id, ug.group_id ) = 't' -# } { -# append admin_items "
  • $group_name\n" -# } - -# if [info exists admin_items] { -# append page_content "

    - -#

  • You have the following administrative roles for this site: -# -#

    -# " -# } - -# db_foreach pvt_home_non_administration_info { -# select ug.group_id, ug.group_name, ug.short_name -# from user_groups ug -# where ug.group_type <> 'administration' -# and ad_group_member_p ( :user_id, ug.group_id ) = 't' -# } { - -# append group_items "

  • $group_name\n" -# } - -# if [info exists group_items] { -# append page_content "

    - -#

  • You're a member of the following groups: -# -#

    -# " -# } - -# if { [ad_parameter IntranetEnabledP intranet 0] == 1 } { -# # Right now only employees can see the intranet -# # append page_content "

  • Intranet

    \n" -#} - -set export_user_id [export_url_vars user_id] -set ad_url [ad_url] - -set member_link [acs_community_member_link -user_id $user_id -label "${ad_url}[acs_community_member_url -user_id $user_id]"] - -set interest_items "" - -# db_foreach pvt_home_categories_list { -# select c.category, c.category_id, -# decode(ui.category_id,NULL,NULL,'t') as selected_p -# from categories c, (select * -# from users_interests -# where user_id = :user_id -# and interest_level > 0) ui -# where c.enabled_p = 't' -# and c.category_id = ui.category_id(+) -# } { - -# if { $selected_p == "t" } { -# append interest_items " $category
    \n" -# } else { -# append interest_items " $category
    \n" -# } -# } - -# if ![empty_string_p $interest_items] { -# append page_content " -#

    Your Interests (According to Us)

    - -#
    -#
    -# $interest_items -#
    -#
    -# -#
    -#
    -# " -# } - ad_return_template