Index: openacs-4/packages/openacs-bootstrap3-theme/resources/templates/packages/acs-subsite/lib/login.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/openacs-bootstrap3-theme/resources/templates/packages/acs-subsite/lib/login.tcl,v diff -u -r1.4.2.5 -r1.4.2.6 --- openacs-4/packages/openacs-bootstrap3-theme/resources/templates/packages/acs-subsite/lib/login.tcl 8 Aug 2020 11:19:23 -0000 1.4.2.5 +++ openacs-4/packages/openacs-bootstrap3-theme/resources/templates/packages/acs-subsite/lib/login.tcl 11 Mar 2021 15:25:48 -0000 1.4.2.6 @@ -116,14 +116,25 @@ } set username_widget text -if { [parameter::get -parameter UsePasswordWidgetForUsername -package_id [ad_acs_kernel_id]] } { +if {[namespace which ::template::widget::email] ne ""} { + set email_widget email +} else { + # + # Failover to avoid breaking the login page if the acs-templating package + # has not been updated to a version supporting the 'email' widget yet. + # + set email_widget text +} + +if { [parameter::get -parameter UsePasswordWidgetForUsername -package_id $::acs::kernel_id] } { set username_widget password + set email_widget password } set focus {} if { [auth::UseEmailForLoginP] } { ad_form -extend -name login \ - -form [list [list email:text($username_widget),nospell \ + -form [list [list email:text($email_widget),nospell \ [list label [_ acs-subsite.Email]:] \ {html {style "width: 300px" class "form-control"}}]] set user_id_widget_name email @@ -283,7 +294,7 @@ } else { set operation create } - element $operation login email -widget $username_widget -datatype text -label [_ acs-subsite.Email] + element $operation login email -widget $email_widget -datatype text -label [_ acs-subsite.Email] if {[element error_p login email]} { template::form::set_error login email [_ acs-subsite.Email_not_provided_by_authority] } Index: openacs-4/packages/acs-subsite/lib/login.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-subsite/lib/login.tcl,v diff -u -r1.41.2.8 -r1.41.2.9 --- openacs-4/packages/acs-subsite/lib/login.tcl 11 Jul 2019 10:57:27 -0000 1.41.2.8 +++ openacs-4/packages/acs-subsite/lib/login.tcl 11 Mar 2021 15:25:56 -0000 1.41.2.9 @@ -118,14 +118,25 @@ } -csrf_protection_p true set username_widget text +if {[namespace which ::template::widget::email] ne ""} { + set email_widget email +} else { + # + # Failover to avoid breaking the login page if the acs-templating package + # has not been updated to a version supporting the 'email' widget yet. + # + set email_widget text +} + if { [parameter::get -parameter UsePasswordWidgetForUsername -package_id $::acs::kernel_id] } { set username_widget password + set email_widget password } set focus {} if { [auth::UseEmailForLoginP] } { ad_form -extend -name login \ - -form [list [list email:text($username_widget),nospell \ + -form [list [list email:text($email_widget),nospell \ [list label "[_ acs-subsite.Email]"] \ {html {style "width: 150px" autocomplete "email"}}]] set user_id_widget_name email @@ -294,7 +305,7 @@ set operation create } element $operation login email \ - -widget $username_widget \ + -widget $email_widget \ -datatype text \ -label [_ acs-subsite.Email] if {[element error_p login email]} {