Index: openacs-4/packages/acs-subsite/acs-subsite.info
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/acs-subsite.info,v
diff -u -r1.90 -r1.91
--- openacs-4/packages/acs-subsite/acs-subsite.info	14 May 2007 20:30:23 -0000	1.90
+++ openacs-4/packages/acs-subsite/acs-subsite.info	29 May 2007 05:40:54 -0000	1.91
@@ -7,7 +7,7 @@
     <initial-install-p>t</initial-install-p>
     <singleton-p>f</singleton-p>
     
-    <version name="5.4.0d4" url="http://openacs.org/repository/download/apm/acs-subsite-5.4.0d4.apm">
+    <version name="5.4.0d5" url="http://openacs.org/repository/download/apm/acs-subsite-5.4.0d5.apm">
         <owner url="http://openacs.org">OpenACS</owner>
         <summary>Subsite</summary>
         <release-date>2007-04-22</release-date>
@@ -16,7 +16,7 @@
         <license>GPL</license>
         <maturity>3</maturity>
 
-        <provides url="acs-subsite" version="5.4.0d4"/>
+        <provides url="acs-subsite" version="5.4.0d5"/>
         <requires url="acs-authentication" version="5.3.1"/>
         <requires url="acs-content-repository" version="5.3.1"/>
         <requires url="acs-kernel" version="5.3.1"/>
@@ -59,6 +59,7 @@
             <parameter datatype="string"  min_n_values="1"  max_n_values="1"  name="RegistrationProvidesRandomPasswordP"  default="0" description="have the system generate a random password instead of the user" section_name="user-login"/>
             <parameter datatype="string"  min_n_values="1"  max_n_values="1"  name="RegistrationRequiresApprovalP"  default="0" description="set this to 1 if user does not go live immediately" section_name="user-login"/>
             <parameter datatype="string"  min_n_values="1"  max_n_values="1"  name="RegistrationRequiresEmailVerificationP"  default="0" description="set this to 1 if the user has to receive and email and come back to the site" section_name="user-login"/>
+            <parameter datatype="string"  min_n_values="1"  max_n_values="1"  name="EmailConfirmTemplate"  default="/packages/acs-subsite/lib/email-confirm" description="Template to use for the page the user comes to for verification of the email. Can be used to trigger additional events."/>
             <parameter datatype="string"  min_n_values="1"  max_n_values="1"  name="RegistrationRedirectUrl"  description="A URL to redirect to instead of showing the normal registration page. Useful if you want to replace the registration page with a custom page." section_name="user-login" />
             <parameter datatype="number"  min_n_values="1"  max_n_values="1"  name="RestrictEntireServerToRegisteredUsersP"  default="0" description="Do we want to allow only registered users to visit this subsite? (restart required)"/>
             <parameter datatype="string"  min_n_values="1"  max_n_values="1"  name="RestrictToSSL"  default="admin/*" description="URLs we want restricted to SSL. Note that this only takes effect if you have an SSL listener configured on your AOLserver and kernel parameter RegisterRestrictToSSLFilters is set to 1 (its default)."/>
Index: openacs-4/packages/acs-subsite/lib/email-confirm.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/lib/email-confirm.adp,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-subsite/lib/email-confirm.adp	29 May 2007 05:40:54 -0000	1.1
@@ -0,0 +1,32 @@
+
+<if @user_info.email_verified_p@ true>
+
+  <property name="title">#acs-subsite.lt_Your_email_is_confirm#</property>
+
+  <if @user_info.member_state@ eq "approved">
+
+    #acs-subsite.lt_Your_email_has_been_c#
+    <p>
+    <form action="index" method=post>
+    @export_vars;noquote@
+    <input type=submit value="#acs-kernel.common_continue#">
+    </form>
+
+  </if>
+  <else>
+
+    <p> #acs-subsite.lt_Your_email_has_been_c_1# </p>
+
+  </else>
+
+</if>
+<else>
+
+  <property name="title">#acs-subsite.Email_not_Requested#</property>
+
+  <p> #acs-subsite.lt_We_were_not_awaiting_# </p>
+
+  <p> #acs-subsite.lt_Please_try_to_a_hrefi# </p>
+    
+</else>
+
Index: openacs-4/packages/acs-subsite/lib/email-confirm.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/lib/email-confirm.tcl,v
diff -u
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/acs-subsite/lib/email-confirm.tcl	29 May 2007 05:40:54 -0000	1.1
@@ -0,0 +1,14 @@
+if {![db_0or1row userp {select 1 from users where user_id = :user_id}]
+    || $token ne [auth::get_user_secret_token -user_id $user_id] } {
+    set title "Bad token"
+    set message "The link given to authenticate your email was invalid."
+    ad_return_template /packages/acs-subsite/lib/message
+} else {
+    auth::set_email_verified -user_id $user_id
+
+    acs_user::get -user_id $user_id -array user_info
+
+    set export_vars [export_vars -form { { username $user_info(username) } }]
+    set site_link [ad_site_home_link]
+    set system_name [ad_system_name]
+}
Index: openacs-4/packages/acs-subsite/www/register/email-confirm.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/www/register/email-confirm.adp,v
diff -u -r1.9 -r1.10
--- openacs-4/packages/acs-subsite/www/register/email-confirm.adp	10 Sep 2003 17:01:39 -0000	1.9
+++ openacs-4/packages/acs-subsite/www/register/email-confirm.adp	29 May 2007 05:40:54 -0000	1.10
@@ -1,34 +1,4 @@
 <master>
   <property name="context">{#acs-subsite.Email_Confirmation#}</property>
 
-<if @user_info.email_verified_p@ true>
-
-  <property name="title">#acs-subsite.lt_Your_email_is_confirm#</property>
-
-  <if @user_info.member_state@ eq "approved">
-
-    #acs-subsite.lt_Your_email_has_been_c#
-    <p>
-    <form action="index" method=post>
-    @export_vars;noquote@
-    <input type=submit value="#acs-kernel.common_continue#">
-    </form>
-
-  </if>
-  <else>
-
-    <p> #acs-subsite.lt_Your_email_has_been_c_1# </p>
-
-  </else>
-
-</if>
-<else>
-
-  <property name="title">#acs-subsite.Email_not_Requested#</property>
-
-  <p> #acs-subsite.lt_We_were_not_awaiting_# </p>
-
-  <p> #acs-subsite.lt_Please_try_to_a_hrefi# </p>
-    
-</else>
-
+<include src="@email_confirm_template@" user_id="@user_id@" token="@token;noquote@" return_url="@return_url;noquote@" />
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.10 -r1.11
--- openacs-4/packages/acs-subsite/www/register/email-confirm.tcl	10 Jan 2007 21:22:09 -0000	1.10
+++ openacs-4/packages/acs-subsite/www/register/email-confirm.tcl	29 May 2007 05:40:54 -0000	1.11
@@ -1,22 +1,17 @@
 ad_page_contract {
-    @cvs-id $Id$
+    Page for users to register themselves on the site.
 
+    @cvs-id $Id$
 } {
     token:notnull,trim
     user_id:integer
+    
+    {return_url ""}
 }
 
-if {![db_0or1row userp {select 1 from users where user_id = :user_id}]
-    || $token ne [auth::get_user_secret_token -user_id $user_id] } {
-    set title "Bad token"
-    set message "The link given to authenticate your email was invalid."
-    ad_return_template /packages/acs-subsite/lib/message
-} else {
-    auth::set_email_verified -user_id $user_id
+set subsite_id [ad_conn subsite_id]
+set email_confirm_template [parameter::get -parameter "EmailConfirmTemplate" -package_id $subsite_id]
 
-    acs_user::get -user_id $user_id -array user_info
-
-    set export_vars [export_vars -form { { username $user_info(username) } }]
-    set site_link [ad_site_home_link]
-    set system_name [ad_system_name]
+if {$email_confirm_template eq ""} {
+    set email_confirm_template "/packages/acs-subsite/lib/email-confirm"
 }