Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.ast_ES.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/acs-subsite.ast_ES.ISO-8859-1.xml,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.ast_ES.ISO-8859-1.xml 28 Aug 2003 07:58:56 -0000 1.3 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.ast_ES.ISO-8859-1.xml 4 Sep 2003 16:35:03 -0000 1.4 @@ -1,5 +1,5 @@ - + Mira'l Buz�n Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.da_DK.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/acs-subsite.da_DK.ISO-8859-1.xml,v diff -u -N -r1.8 -r1.9 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.da_DK.ISO-8859-1.xml 28 Aug 2003 07:58:56 -0000 1.8 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.da_DK.ISO-8859-1.xml 4 Sep 2003 16:35:03 -0000 1.9 @@ -1,5 +1,5 @@ - + Omkring dig @@ -171,6 +171,5 @@ Din konto er i �jeblikket markeret som "slettet", hvis du �nsker det, kan vi Din e-mail: Din email-adresse: - Dit kodeord: Dit portr�t Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.de_DE.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/acs-subsite.de_DE.ISO-8859-1.xml,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.de_DE.ISO-8859-1.xml 28 Aug 2003 07:58:56 -0000 1.6 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.de_DE.ISO-8859-1.xml 4 Sep 2003 16:35:03 -0000 1.7 @@ -1,5 +1,5 @@ - + Ausgew�hlte Benutzerinformation @@ -177,6 +177,5 @@ Ihre Benutzeridentifikation ist zurzeit als "gel�scht" markiert. Wenn sie m�chten, k�nnen wir Ihre E-Mail: Ihre eMail-Adresse: - Ihr Passwort: Ihr Passbild Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.el_GR.ISO-8859-7.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/Attic/acs-subsite.el_GR.ISO-8859-7.xml,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.el_GR.ISO-8859-7.xml 28 Aug 2003 07:58:56 -0000 1.5 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.el_GR.ISO-8859-7.xml 4 Sep 2003 16:35:03 -0000 1.6 @@ -1,5 +1,5 @@ - + ����������� 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 -N -r1.16 -r1.17 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.en_US.ISO-8859-1.xml 3 Sep 2003 19:48:05 -0000 1.16 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.en_US.ISO-8859-1.xml 4 Sep 2003 16:35:03 -0000 1.17 @@ -1,5 +1,5 @@ - + About You @@ -15,8 +15,8 @@ Change my Password Check Your Inbox Children - Confirm: - Current Password: + Confirm + Current Password Current users: Customize Question Direct Permissions @@ -29,6 +29,14 @@ Error sending mail Feature disabled First names + Here is your new login information: + +Username: %username% +Password: %password% + +Please visit the following link to change your password: + +%reset_password_url% Full Name: Grant Grant Permission @@ -130,9 +138,9 @@ Saving email address and password Show everyone else at %system_name% how great looking you are: Sorry but it seems that you've been banned from %system_name%. - Thank you for visiting %system_name%. Here's how you can log in at %system_url%: + Thank you for visiting %system_name%" "<#_ Here's how you can log in at %system_url%: -Username: %username% +Username: %email% Password: %password% The full name given didn't match. There must be something wrong. @@ -190,15 +198,15 @@ %site_link% to use the service. Your URL doesn't have the correct form. A valid URL would be something like \"%valid_url_example%\"." Name: - New Password: + New Password New users: your portrait &lt; none set up &gt; none Note: on or - Password: + Password Permissions Permissions for %name% personal URL: @@ -230,8 +238,5 @@ can Your email: Your email address: - Your password: - Recover Password - Continue Your Portrait Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.es_ES.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/acs-subsite.es_ES.ISO-8859-1.xml,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.es_ES.ISO-8859-1.xml 28 Aug 2003 07:58:56 -0000 1.6 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.es_ES.ISO-8859-1.xml 4 Sep 2003 16:35:03 -0000 1.7 @@ -1,5 +1,5 @@ - + Mi informaci�n @@ -174,6 +174,5 @@ Su cuenta est� marcada como "borrada". Si lo desea, puede Su correo: Su direcci�n de correo: - Su contrase�a: Su foto Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.fr_FR.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/acs-subsite.fr_FR.ISO-8859-1.xml,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.fr_FR.ISO-8859-1.xml 28 Aug 2003 07:58:56 -0000 1.4 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.fr_FR.ISO-8859-1.xml 4 Sep 2003 16:35:03 -0000 1.5 @@ -1,5 +1,5 @@ - + A propos de vous @@ -175,6 +175,5 @@ Votre compte a �t� marqu� comme "effac�". Si vous le d�sirez, vous pouvez Votre adresse email: Votre adresse email: - Votre mot de passe: Votre photo Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.it_IT.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/acs-subsite.it_IT.ISO-8859-1.xml,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.it_IT.ISO-8859-1.xml 28 Aug 2003 07:58:56 -0000 1.5 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.it_IT.ISO-8859-1.xml 4 Sep 2003 16:35:03 -0000 1.6 @@ -1,5 +1,5 @@ - + Conferma Password: Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.ja_JP.Shift_JIS.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/Attic/acs-subsite.ja_JP.Shift_JIS.xml,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.ja_JP.Shift_JIS.xml 28 Aug 2003 07:58:56 -0000 1.3 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.ja_JP.Shift_JIS.xml 4 Sep 2003 16:35:03 -0000 1.4 @@ -1,5 +1,5 @@ - + ���Ȃ��ɂ‚��� Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.ko_KR.EUC-KR.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/Attic/acs-subsite.ko_KR.EUC-KR.xml,v diff -u -N -r1.3 -r1.4 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.ko_KR.EUC-KR.xml 28 Aug 2003 07:58:56 -0000 1.3 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.ko_KR.EUC-KR.xml 4 Sep 2003 16:35:03 -0000 1.4 @@ -1,5 +1,5 @@ - + ��ſ� ���� @@ -174,6 +174,5 @@ ����� ������ ���� "����"ǥ�õǾ� �ֽ��ϴ�. ���ϽŴٸ� ������ �� �ֽ��ϴ�. �������� ���ڿ����ּ�: �������� ���ڿ��� �ּ�: - �������� ��й�ȣ: ���� Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.ms_my.US-ASCII.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/Attic/acs-subsite.ms_my.US-ASCII.xml,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.ms_my.US-ASCII.xml 28 Aug 2003 07:58:56 -0000 1.2 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.ms_my.US-ASCII.xml 4 Sep 2003 16:35:03 -0000 1.3 @@ -1,5 +1,5 @@ - + Tentang Anda @@ -47,5 +47,4 @@ Kemaskini Kata Laluan E-mel anda: Alamat e-mel anda: - Kata Laluan Anda: Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.nl_NL.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/acs-subsite.nl_NL.ISO-8859-1.xml,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.nl_NL.ISO-8859-1.xml 28 Aug 2003 07:58:56 -0000 1.6 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.nl_NL.ISO-8859-1.xml 4 Sep 2003 16:35:03 -0000 1.7 @@ -1,5 +1,5 @@ - + Over u @@ -175,6 +175,5 @@ De account is momenteel gemarkeerd als zijnde verwijderd. Indien gewenst, kunnen we E-mail: E-mailadres: - Wachtwoord: Portret: Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.no_NO.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/acs-subsite.no_NO.ISO-8859-1.xml,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.no_NO.ISO-8859-1.xml 28 Aug 2003 07:58:56 -0000 1.5 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.no_NO.ISO-8859-1.xml 4 Sep 2003 16:35:03 -0000 1.6 @@ -1,5 +1,5 @@ - + Om deg @@ -175,6 +175,5 @@ Kontoen din er for tiden merket "slettet". Dersom du �nsker det, kan vi Din e-post: Din e-postadresse: - Ditt passord: Ditt bilde: Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.pl_PL.ISO-8859-2.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/Attic/acs-subsite.pl_PL.ISO-8859-2.xml,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.pl_PL.ISO-8859-2.xml 28 Aug 2003 07:58:56 -0000 1.6 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.pl_PL.ISO-8859-2.xml 4 Sep 2003 16:35:03 -0000 1.7 @@ -1,5 +1,5 @@ - + O Tobie @@ -176,6 +176,5 @@ Twoje konto jest oznaczone jako "usuni�te". Je�li chcesz mo�emy Tw�j email: Tw�j email: - Twoje has�o: Tw�j Portret Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.ru_RU.windows-1251.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/Attic/acs-subsite.ru_RU.windows-1251.xml,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.ru_RU.windows-1251.xml 28 Aug 2003 07:58:56 -0000 1.5 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.ru_RU.windows-1251.xml 4 Sep 2003 16:35:03 -0000 1.6 @@ -1,5 +1,5 @@ - + � ��� Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.sh_HR.ISO-8859-5.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/Attic/acs-subsite.sh_HR.ISO-8859-5.xml,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.sh_HR.ISO-8859-5.xml 28 Aug 2003 07:58:56 -0000 1.5 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.sh_HR.ISO-8859-5.xml 4 Sep 2003 16:35:03 -0000 1.6 @@ -1,5 +1,5 @@ - + O tebi @@ -96,6 +96,5 @@ Vas konto je trenutno oznacen kao "izbrisan". Ako zelite, mi mozemo Vasa elektronska adresa: Vasa elektronska adresa: - Vasa lozinka: Vas portret Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.sv_SE.ISO-8859-1.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/acs-subsite.sv_SE.ISO-8859-1.xml,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.sv_SE.ISO-8859-1.xml 28 Aug 2003 07:58:56 -0000 1.6 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.sv_SE.ISO-8859-1.xml 4 Sep 2003 16:35:03 -0000 1.7 @@ -1,5 +1,5 @@ - + Om dig @@ -174,6 +174,5 @@ Ditt konto �r f�r n�rvarande "borttaget". Om du �nskar kan vi Din epostadress: Din epostadress: - Ditt l�senord: Ditt portr�tt: Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.tr_TR.ISO-8859-9.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/Attic/acs-subsite.tr_TR.ISO-8859-9.xml,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.tr_TR.ISO-8859-9.xml 28 Aug 2003 07:58:56 -0000 1.2 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.tr_TR.ISO-8859-9.xml 4 Sep 2003 16:35:03 -0000 1.3 @@ -1,5 +1,5 @@ - + Sizin Hakk�n�zda Index: openacs-4/packages/acs-subsite/catalog/acs-subsite.zh_TW.Big5.xml =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/catalog/Attic/acs-subsite.zh_TW.Big5.xml,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/acs-subsite/catalog/acs-subsite.zh_TW.Big5.xml 28 Aug 2003 07:58:56 -0000 1.2 +++ openacs-4/packages/acs-subsite/catalog/acs-subsite.zh_TW.Big5.xml 4 Sep 2003 16:35:03 -0000 1.3 @@ -1,5 +1,5 @@ - + ����A Index: openacs-4/packages/acs-subsite/www/register/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/register/index.adp,v diff -u -N -r1.11 -r1.12 --- openacs-4/packages/acs-subsite/www/register/index.adp 4 Sep 2003 07:50:51 -0000 1.11 +++ openacs-4/packages/acs-subsite/www/register/index.adp 4 Sep 2003 16:35:04 -0000 1.12 @@ -1,6 +1,6 @@ -#acs-subsite.Log_In# -login.username -{#acs-subsite.Log_In#} + #acs-subsite.Log_In# + login.username + {#acs-subsite.Log_In#} Index: openacs-4/packages/acs-subsite/www/register/recover-password.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/register/recover-password.adp,v diff -u -N -r1.4 -r1.5 --- openacs-4/packages/acs-subsite/www/register/recover-password.adp 3 Sep 2003 19:48:05 -0000 1.4 +++ openacs-4/packages/acs-subsite/www/register/recover-password.adp 4 Sep 2003 16:35:04 -0000 1.5 @@ -1,14 +1,14 @@ @page_title@ @context@ - @focus@ + recover.username - - @recover_info.password_message@ -

To log in, visit the login page.

+ +

Enter your username to begin password recovery.

+
-

Enter your username to begin password recovery.

- + @recover_info.password_message@ +

To log in, visit the login page.

Index: openacs-4/packages/acs-subsite/www/register/recover-password.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/register/recover-password.tcl,v diff -u -N -r1.6 -r1.7 --- openacs-4/packages/acs-subsite/www/register/recover-password.tcl 4 Sep 2003 10:26:00 -0000 1.6 +++ openacs-4/packages/acs-subsite/www/register/recover-password.tcl 4 Sep 2003 16:35:04 -0000 1.7 @@ -11,66 +11,46 @@ set page_title [_ acs-subsite.Recover_Password] set context [list $page_title] -set focus "" +if { ![exists_and_not_null authority_id] } { + set authority_id [auth::authority::local] +} + # Display form to collect username and authority set authority_options [auth::authority::get_authority_options] +ad_form -name recover -edit_buttons [list [list [_ acs-kernel.common_continue] ok]] -form { {dummy:text(hidden),optional} } + if { [llength $authority_options] > 1 } { - ad_form -name recover_password -edit_buttons [list [list [_ acs-kernel.common_continue] ok]] -form { + ad_form -extend -name recover -form { {authority_id:integer(select) - {label "[_ acs-kernel.authentication_authority]"} + {label {[_ acs-kernel.authentication_authority]}} {options $authority_options} - {value $authority_id} } } -} else { - ad_form -name recover_password -edit_buttons [list [list [_ acs-kernel.common_continue] ok]] -form { - {authority_id:integer(hidden),optional - {value $authority_id} - } - } } -ad_form -extend -name recover_password -form { +set submission_p 0 + +ad_form -extend -name recover -form { {username:text {label "Username"} {value $username} } -} -on_submit { - - if { ![exists_and_not_null authority_id] } { - # Will be defaulted to local authority - set authority_id "" - } - - - - array set recover_info [auth::password::recover_password \ - -authority_id $authority_id \ - -username $username] - } -validate { {username { ![empty_string_p [acs_user::get_by_username -authority_id $authority_id -username $username]] } { Could not find username at authority } } } -if { [llength $authority_options] > 1 } { - set focus "recover_password.authority_id" -} else { - set focus "recover_password.username" -} - -set form_valid_p [form is_valid recover_password] -set form_submitted_p [form is_submission recover_password] - - -if { [exists_and_not_null username] && !$form_submitted_p } { +# We handle form submission here, because otherwise we can't handle both the case where we use the form +# and the case where we don't in one go +if { [form is_valid recover] || (![form is_submission recover] && [exists_and_not_null username]) } { array set recover_info [auth::password::recover_password \ -authority_id $authority_id \ -username $username] + + set login_url [ad_get_login_url -authority_id $authority_id -username $username] } -set login_url [ad_get_login_url -authority_id $authority_id -username $username] Index: openacs-4/packages/acs-subsite/www/user/password-update-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/Attic/password-update-2.tcl,v diff -u -N --- openacs-4/packages/acs-subsite/www/user/password-update-2.tcl 3 Sep 2003 08:33:34 -0000 1.11 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,61 +0,0 @@ -ad_page_contract { - Updates the users password if -
    -
  • old_password is correct -
  • password_1 matches password_2 -
      - @cvs-id $Id: password-update-2.tcl,v 1.11 2003/09/03 08:33:34 simonc Exp $ -} { - password_1:notnull - password_2:notnull - {old_password ""} - {user_id:integer ""} - {return_url ""} -} -validate { - confirm_password -requires {password_2:notnull} { - if {[empty_string_p $password_2]} { - ad_complain "You need to confirm the password that you typed. (Type the same thing again.)" - } - } -} - -if {[empty_string_p $user_id]} { - set user_id [ad_verify_and_get_user_id] -} - -if { ![auth::password::can_change_p -user_id $user_id] } { - # We are not allowd to change password - # SIMON: What should we do here? - ad_return_error "Not allowed" "Changing password is not allowed. Sorry" -} - -set admin_p [permission::permission_p -object_id $user_id -privilege admin] - -if {!$admin_p} { - permission::require_permission -party_id $user_id -object_id $user_id -privilege write -} - - -array set change_pwd_info [auth::password::change \ - -user_id $user_id \ - -old_password $old_password \ - -new_password $password_1] - -if { [string equal $change_pwd_info(password_status) "ok"] } { - # Make sure the user is logged in - if { ![ad_conn user_id] } { - ad_user_login $user_id - } - - if {[empty_string_p $return_url]} { - set return_url [ad_parameter -package_id [ad_acs_kernel_id] "HomeURL"] - } - - ad_returnredirect $return_url - -} else { - # Changing password failed, display password_message - # SIMON: What should we do here? - ad_return_error "Failure" $change_pwd_info(password_status) -} - Index: openacs-4/packages/acs-subsite/www/user/password-update.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/password-update.adp,v diff -u -N -r1.14 -r1.15 --- openacs-4/packages/acs-subsite/www/user/password-update.adp 3 Sep 2003 08:33:34 -0000 1.14 +++ openacs-4/packages/acs-subsite/www/user/password-update.adp 4 Sep 2003 16:35:04 -0000 1.15 @@ -1,42 +1,6 @@ #acs-subsite.Update_Password# - #acs-subsite.lt_for_first_names_last_# - #acs-subsite.Update_Password# - pwd.old_password - -

      - Welcome to @system_name@. -

      -

      - Your login was successful, but your password has expired, and must - be updated now, before you can proceed to use @system_name@. -

      -
      + @context;noquote@ + @focus;noquote@ -
      - - - - - - - - - - - - - - - - - - - - - - - -
      #acs-subsite.Current_Password#
      #acs-subsite.New_Password#
      #acs-subsite.Confirm#
      - -
      + Index: openacs-4/packages/acs-subsite/www/user/password-update.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/password-update.tcl,v diff -u -N -r1.12 -r1.13 --- openacs-4/packages/acs-subsite/www/user/password-update.tcl 3 Sep 2003 08:33:34 -0000 1.12 +++ openacs-4/packages/acs-subsite/www/user/password-update.tcl 4 Sep 2003 16:35:04 -0000 1.13 @@ -4,35 +4,110 @@ @cvs-id $Id$ } { - {user_id ""} + {user_id {[ad_conn user_id]}} {return_url ""} {old_password ""} - {expired_p:boolean "0"} } -if {[empty_string_p $user_id]} { - set user_id [ad_verify_and_get_user_id] -} +# This is a bit confusing, but old_password is what we get passed in here, +# whereas password_old is the form element. + if { ![auth::password::can_change_p -user_id $user_id] } { ad_return_error "Not allowed" "Changing password is not allowed. Sorry" } -set context [list [list [ad_pvt_home] "Your Account"] [_ acs-subsite.Update_Password]] - -# We have a special provision here for expired passwords -# The user will not be logged in, but we're supposed to log them in after we're done -# We use template::util::is_true in order to be liberal in the input we accept -# SIMON: Do we still want to do this? -set expired_p [template::util::is_true $expired_p] - -set system_name [ad_system_name] - set admin_p [permission::permission_p -object_id $user_id -privilege admin] if { !$admin_p } { permission::require_permission -party_id $user_id -object_id $user_id -privilege write } -db_1row user_information {} + +set page_title [_ acs-subsite.Update_Password] +set context [list [list [ad_pvt_home] [ad_pvt_home_name]] $page_title] + +set system_name [ad_system_name] set site_link [ad_site_home_link] + + + +acs_user::get -user_id $user_id -array user + +ad_form -name update -edit_buttons [list [list [_ acs-kernel.common_update] "ok"]] -form { + {user_id:integer(hidden)} + {return_url:text(hidden),optional} + {old_password:text(hidden),optional} +} + +if { [exists_and_not_null old_password] } { + set focus "update.password_1" +} else { + ad_form -extend -name update -form { + {password_old:text(password) + {label {[_ acs-subsite.Current_Password]}} + } + } + set focus "update.password_old" +} + +ad_form -extend -name update -form { + {password_1:text(password) + {label {[_ acs-subsite.New_Password]}} + {html {size 20}} + } + {password_2:text(password) + {label {[_ acs-subsite.Confirm]}} + {html {size 20}} + } +} -on_request { + +} -validate { + {password_1 + { [string equal $password_1 $password_2] } + { Passwords don't match } + } +} -on_submit { + + if { [exists_and_not_null old_password] } { + set password_old $old_password + } + + array set result [auth::password::change \ + -user_id $user_id \ + -old_password $password_old \ + -new_password $password_1] + + switch $result(password_status) { + ok { + # Continue + } + old_password_bad { + if { ![exists_and_not_null old_password] } { + form set_error update password_old $result(password_message) + } else { + # This hack causes the form to reload as if submitted, but with the old password showing + ad_returnredirect [export_vars -base [ad_conn url] -entire_form -exclude { old_password } -override { { password_old $old_password } }] + ad_script_abort + } + break + } + default { + form set_error update password_1 $result(password_message) + break + } + } + + # Make sure the user is logged in + # LARS: This looks fairly dangerous to me + if { [ad_conn user_id] == 0 } { + ad_user_login $user_id + } + +} -after_submit { + if { [empty_string_p $return_url] } { + set return_url [ad_pvt_home] + } + ad_returnredirect $return_url + ad_script_abort +} Index: openacs-4/packages/acs-subsite/www/user/password-update.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/user/Attic/password-update.xql,v diff -u -N --- openacs-4/packages/acs-subsite/www/user/password-update.xql 15 Apr 2002 22:40:50 -0000 1.2 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,15 +0,0 @@ - - - - - - select first_names, - last_name, - email, - url - from cc_users - where user_id = :user_id - - - -