Index: openacs-4/packages/acs-subsite/lib/user-info.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/lib/user-info.adp,v diff -u -r1.1 -r1.2 --- openacs-4/packages/acs-subsite/lib/user-info.adp 12 Sep 2003 13:25:19 -0000 1.1 +++ openacs-4/packages/acs-subsite/lib/user-info.adp 17 Sep 2003 12:03:00 -0000 1.2 @@ -1 +1,7 @@ +@focus;noquote@ + + + +

Notice: Certain elements are not editable, because they are managed by @authority_name@.

+
Index: openacs-4/packages/acs-subsite/lib/user-info.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/lib/user-info.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/lib/user-info.tcl 16 Sep 2003 13:08:38 -0000 1.2 +++ openacs-4/packages/acs-subsite/lib/user-info.tcl 17 Sep 2003 12:03:00 -0000 1.3 @@ -1,7 +1,7 @@ # # Expects: # user_id:optional -# return_url:optional +# return_url:optional # ad_maybe_redirect_for_registration @@ -20,14 +20,42 @@ acs_user::get -array user -include_bio +set authority_name [auth::authority::get_element -authority_id $user(authority_id) -element pretty_name] + +set form_elms { username first_names last_name email screen_name url bio } +foreach elm $form_elms { + set mode($elm) {} +} +set read_only_elements [auth::sync::get_sync_elements -authority_id $user(authority_id)] +foreach elm $read_only_elements { + set mode($elm) {display} +} +set focus {} +foreach elm $form_elms { + if { [empty_string_p $mode($elm)] } { + set focus "user_login.$elm" + break + } +} +set read_only_notice_p [expr [llength $read_only_elements] > 0] +set edit_mode_p [expr ![empty_string_p [form::get_action user_info]]] + ad_form -name user_info -cancel_url $return_url -action $action_url -mode display -form { {return_url:text(hidden),optional {value $return_url}} } -if { ![auth::UseEmailForLoginP] } { +if { [llength [auth::authority::get_authority_options]] > 1 } { ad_form -extend -name user_info -form { - {username:text(inform) + {authority_name:text(inform) + {label "Authority"} + } + } +} +if { $user(authority_id) != [auth::authority::local] || ![auth::UseEmailForLoginP] } { + ad_form -extend -name user_info -form { + {username:text(text) {label "Username"} + {mode $mode(username)} } } } @@ -36,33 +64,42 @@ {first_names:text {label "First names"} {html {size 50}} + {mode $mode(first_names)} } {last_name:text {label "Last Name"} {html {size 50}} + {mode $mode(last_name)} } {email:text {label "Email"} {html {size 50}} + {mode $mode(email)} } {screen_name:text,optional {label "Screen name"} {html {size 50}} + {mode $mode(screen_name)} } {url:text,optional {label "Home Page"} {html {size 50}} + {mode $mode(url)} } {bio:text(textarea),optional {label "About yourself"} {html {rows 8 cols 60}} + {mode $mode(bio)} } } -on_request { foreach var { first_names last_name email username screen_name url bio } { set $var $user($var) } } -on_submit { db_transaction { + + # TODO: Only change editable elements + person::update \ -person_id $user_id \ -first_names $first_names \ Index: openacs-4/packages/acs-subsite/www/user/basic-info-update.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/basic-info-update.adp,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-subsite/www/user/basic-info-update.adp 12 Sep 2003 13:25:20 -0000 1.7 +++ openacs-4/packages/acs-subsite/www/user/basic-info-update.adp 17 Sep 2003 12:03:00 -0000 1.8 @@ -1,5 +1,8 @@ @page_title@ @context;noquote@ + @focus;noquote@ +

#acs-subsite.Basic_Information#

+ Index: openacs-4/packages/acs-subsite/www/user/basic-info-update.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/basic-info-update.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-subsite/www/user/basic-info-update.tcl 12 Sep 2003 13:25:20 -0000 1.4 +++ openacs-4/packages/acs-subsite/www/user/basic-info-update.tcl 17 Sep 2003 12:03:00 -0000 1.5 @@ -18,5 +18,4 @@ set context [list $page_title] } - - +set focus {}