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: %email%
+Username: %username%
Password: %password%
The full name given didn't match. There must be something wrong.
Index: openacs-4/packages/acs-subsite/www/register/email-confirm.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/register/email-confirm.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/acs-subsite/www/register/email-confirm.tcl 3 Sep 2003 15:05:36 -0000 1.5
+++ openacs-4/packages/acs-subsite/www/register/email-confirm.tcl 3 Sep 2003 19:48:05 -0000 1.6
@@ -2,21 +2,20 @@
@cvs-id $Id$
} {
- row_id:notnull,trim
- user_id
+ token:notnull,trim
+ user_id:integer
}
-set token [auth::get_user_secret_token -user_id $user_id]
-
-if { [string equal $token $row_id] } {
- ad_return_error "[_ acs-subsite.lt_Couldnt_find_your_rec]" "[_ acs-subsite.lt_Row_id_row_id_is_not_]"
+if { [string equal $token [auth::get_user_secret_token -user_id $user_id]] } {
+ ad_return_error [_ acs-subsite.lt_Couldnt_find_your_rec] [_ acs-subsite.lt_Row_id_row_id_is_not_]
return
}
-auth::confirm_email -user_id $user_id
+auth::set_email_verified -user_id $user_id
+
acs_user::get -user_id $user_id -array user_info
-set export_vars [export_form_vars email]
+set export_vars [export_vars -form { email }]
set email $user_info(email)
set site_link [ad_site_home_link]
set system_name [ad_system_name]
Index: openacs-4/packages/acs-subsite/www/register/login-include.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/register/Attic/login-include.tcl,v
diff -u -r1.4 -r1.5
--- openacs-4/packages/acs-subsite/www/register/login-include.tcl 3 Sep 2003 09:51:58 -0000 1.4
+++ openacs-4/packages/acs-subsite/www/register/login-include.tcl 3 Sep 2003 19:48:05 -0000 1.5
@@ -12,6 +12,14 @@
set subsite_id [subsite::get_element -element object_id]
}
+if { ![info exists authority_id] } {
+ set authority_id {}
+}
+
+if { ![info exists username] } {
+ set username {}
+}
+
# Persistent login
# The logic is:
# 1. Allowed if allowed both site-wide (on acs-kernel) and on the subsite
@@ -45,7 +53,7 @@
set authority_options [auth::authority::get_authority_options]
-set forgotten_pwd_url [export_vars -base [auth::password::get_forgotten_url] { username authority_id }]
+set forgotten_pwd_url [auth::password::get_forgotten_url -authority_id $authority_id -username $username]
set register_url "[subsite::get_element -element url]register/user-new"
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 -r1.3 -r1.4
--- openacs-4/packages/acs-subsite/www/register/recover-password.adp 3 Sep 2003 14:06:01 -0000 1.3
+++ openacs-4/packages/acs-subsite/www/register/recover-password.adp 3 Sep 2003 19:48:05 -0000 1.4
@@ -3,17 +3,12 @@
@context@
@focus@
- Enter your username to begin password recovery.
+
+ @recover_info.password_message@
+ To log in, visit the login page.
+
+
+ Enter your username to begin password recovery.
+
+
-
-
- @recover_info.password_message@
-
-
-
-
-
-
-
-
-
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 -r1.4 -r1.5
--- openacs-4/packages/acs-subsite/www/register/recover-password.tcl 3 Sep 2003 15:05:36 -0000 1.4
+++ openacs-4/packages/acs-subsite/www/register/recover-password.tcl 3 Sep 2003 19:48:05 -0000 1.5
@@ -73,4 +73,4 @@
-username $username]
}
-
+set login_url [ad_get_login_url -authority_id $authority_id -username $username]
Index: openacs-4/packages/acs-subsite/www/register/user-new.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/register/user-new.adp,v
diff -u -r1.11 -r1.12
--- openacs-4/packages/acs-subsite/www/register/user-new.adp 3 Sep 2003 12:37:00 -0000 1.11
+++ openacs-4/packages/acs-subsite/www/register/user-new.adp 3 Sep 2003 19:48:05 -0000 1.12
@@ -1,5 +1,6 @@
#acs-subsite.Register#
{#acs-subsite.Register#}
+ register.username
Index: openacs-4/packages/acs-subsite/www/register/user-new.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/register/user-new.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/acs-subsite/www/register/user-new.tcl 3 Sep 2003 12:37:00 -0000 1.7
+++ openacs-4/packages/acs-subsite/www/register/user-new.tcl 3 Sep 2003 19:48:05 -0000 1.8
@@ -2,42 +2,47 @@
Page for users to register themselves on the site.
@cvs-id $Id$
-} -validate {
- password_1 {
- if {![string equal $password_1 $password_2]} {
- ad_complain "[_ acs-subsite.lt_The_passwords_youve_e]"
- }
- }
}
+# TODO: Move to includeable chunk
+
+
+# TODO: log user out if currently logged in, if specified in the includeable chunk's parameters, e.g. not when creating accounts for other users
+ad_user_logout
+
+
ad_form -name register -form [auth::get_registration_form_elements] -on_submit {
array set creation_info [auth::create_user \
- -first_names $first_names \
- -last_name $last_name \
- -email $email \
- -url $url \
- -username $username \
- -password $password_1 \
- -secret_question $secret_question \
- -secret_answer $secret_answer]
+ -first_names $first_names \
+ -last_name $last_name \
+ -email $email \
+ -url $url \
+ -username $username \
+ -password $password \
+ -password_confirm $password_confirm \
+ -secret_question $secret_question \
+ -secret_answer $secret_answer]
# Handle registration problems
-
+
switch $creation_info(creation_status) {
ok {
# Continue below
}
default {
- # Adding the error to just some element, not sure where it makes sense
- # AFAIK, we can't add errors to the form in general ...
- ad_form_complain -element first_names -error creation_info(auth_message)
-
+ # Adding the error to the first element, but only if there are no element messages
+ if { [llength $creation_info(element_messages)] == 0 } {
+ array set reg_elms [auth::get_registration_elements]
+ set first_elm [lindex [concat $reg_elms(required) $reg_elms(optional)] 0]
+ form set_error register $first_elm $creation_info(creation_message)
+ }
+
# Element messages
foreach { elm_name elm_error } $creation_info(element_messages) {
- ad_form_complain -element $elm_name -error $elm_error
+ form set_error register $elm_name $elm_error
}
- continue
+ break
}
}