selectable templates for auth
This commit is contained in:
parent
2a1db10c8b
commit
ac877443ed
8 changed files with 122 additions and 19 deletions
|
|
@ -11,9 +11,11 @@
|
||||||
- Image Magick is now required to run WebGUI.
|
- Image Magick is now required to run WebGUI.
|
||||||
- Added an image resizer to the image asset.
|
- Added an image resizer to the image asset.
|
||||||
- Added Captcha verification option to WebGUI anonymous registration.
|
- Added Captcha verification option to WebGUI anonymous registration.
|
||||||
|
- Authentication templates are now selectable through the settings console.
|
||||||
- Added email validation option to WebGUI anonymous registration. Thanks to
|
- Added email validation option to WebGUI anonymous registration. Thanks to
|
||||||
Matt Wilson for inspiration.
|
Matt Wilson for inspiration.
|
||||||
- Thumbnails will now be generated a little sharper. Thanks to Nuba.
|
- Thumbnails will now be generated a little sharper. Thanks to Nuba.
|
||||||
|
- SSL is now more strictly enforced.
|
||||||
- Fixed resetting votes on Poll would crash it.
|
- Fixed resetting votes on Poll would crash it.
|
||||||
- Fixed not being able to set display title and other yes no questions to no.
|
- Fixed not being able to set display title and other yes no questions to no.
|
||||||
- Fixed a bug where URLs would become unreachable when using SSL.
|
- Fixed a bug where URLs would become unreachable when using SSL.
|
||||||
|
|
|
||||||
|
|
@ -4,4 +4,13 @@ insert into settings (name, value) values ('webguiValidateEmail', '0');
|
||||||
insert into settings (name, value) values ('webguiUseCaptcha', '1');
|
insert into settings (name, value) values ('webguiUseCaptcha', '1');
|
||||||
delete from template where assetId='PBtmpl0000000000000011';
|
delete from template where assetId='PBtmpl0000000000000011';
|
||||||
INSERT INTO template VALUES (' <h1><tmpl_var title></h1>\r\n\r\n<tmpl_if create.message>\r\n <tmpl_var create.message>\r\n</tmpl_if>\r\n\r\n<tmpl_var create.form.header>\r\n<table >\r\n<tmpl_if useCaptcha>\r\n<tr>\r\n <td class=\"formDescription\" valign=\"top\"><tmpl_var create.form.captcha.label></td>\r\n <td class=\"tableData\"><tmpl_var create.form.captcha></td>\r\n</tr>\r\n</tmpl_if>\r\n<tr>\r\n <td class=\"formDescription\" valign=\"top\"><tmpl_var create.form.username.label></td>\r\n <td class=\"tableData\"><tmpl_var create.form.username></td>\r\n</tr>\r\n<tr>\r\n <td class=\"formDescription\" valign=\"top\"><tmpl_var create.form.password.label></td>\r\n <td class=\"tableData\"><tmpl_var create.form.password></td>\r\n</tr>\r\n<tr>\r\n <td class=\"formDescription\" valign=\"top\"><tmpl_var create.form.passwordConfirm.label></td>\r\n <td class=\"tableData\"><tmpl_var create.form.passwordConfirm></td>\r\n</tr>\r\n<tmpl_loop create.form.profile>\r\n<tr>\r\n <td class=\"formDescription\" valign=\"top\"><tmpl_var profile.formElement.label></td>\r\n <td class=\"tableData\"><tmpl_var profile.formElement></td>\r\n</tr>\r\n</tmpl_loop>\r\n<tr>\r\n <td class=\"formDescription\" valign=\"top\"></td>\r\n <td class=\"tableData\"><tmpl_var create.form.submit></td>\r\n</tr>\r\n</table>\r\n<tmpl_var create.form.footer>\r\n\r\n<div class=\"accountOptions\">\r\n <ul>\r\n <li><a href=\"<tmpl_var login.url>\"><tmpl_var login.label></a></li>\r\n <tmpl_if recoverPassword.isAllowed>\r\n <li><a href=\"<tmpl_var recoverPassword.url>\"><tmpl_var recoverPassword.label></a></li>\r\n </tmpl_if>\r\n </ul>\r\n</div>','Auth/WebGUI/Create',1,1,'PBtmpl0000000000000011');
|
INSERT INTO template VALUES (' <h1><tmpl_var title></h1>\r\n\r\n<tmpl_if create.message>\r\n <tmpl_var create.message>\r\n</tmpl_if>\r\n\r\n<tmpl_var create.form.header>\r\n<table >\r\n<tmpl_if useCaptcha>\r\n<tr>\r\n <td class=\"formDescription\" valign=\"top\"><tmpl_var create.form.captcha.label></td>\r\n <td class=\"tableData\"><tmpl_var create.form.captcha></td>\r\n</tr>\r\n</tmpl_if>\r\n<tr>\r\n <td class=\"formDescription\" valign=\"top\"><tmpl_var create.form.username.label></td>\r\n <td class=\"tableData\"><tmpl_var create.form.username></td>\r\n</tr>\r\n<tr>\r\n <td class=\"formDescription\" valign=\"top\"><tmpl_var create.form.password.label></td>\r\n <td class=\"tableData\"><tmpl_var create.form.password></td>\r\n</tr>\r\n<tr>\r\n <td class=\"formDescription\" valign=\"top\"><tmpl_var create.form.passwordConfirm.label></td>\r\n <td class=\"tableData\"><tmpl_var create.form.passwordConfirm></td>\r\n</tr>\r\n<tmpl_loop create.form.profile>\r\n<tr>\r\n <td class=\"formDescription\" valign=\"top\"><tmpl_var profile.formElement.label></td>\r\n <td class=\"tableData\"><tmpl_var profile.formElement></td>\r\n</tr>\r\n</tmpl_loop>\r\n<tr>\r\n <td class=\"formDescription\" valign=\"top\"></td>\r\n <td class=\"tableData\"><tmpl_var create.form.submit></td>\r\n</tr>\r\n</table>\r\n<tmpl_var create.form.footer>\r\n\r\n<div class=\"accountOptions\">\r\n <ul>\r\n <li><a href=\"<tmpl_var login.url>\"><tmpl_var login.label></a></li>\r\n <tmpl_if recoverPassword.isAllowed>\r\n <li><a href=\"<tmpl_var recoverPassword.url>\"><tmpl_var recoverPassword.label></a></li>\r\n </tmpl_if>\r\n </ul>\r\n</div>','Auth/WebGUI/Create',1,1,'PBtmpl0000000000000011');
|
||||||
|
insert into settings (name, value) values ('webguiAccountTemplate', 'PBtmpl0000000000000010');
|
||||||
|
insert into settings (name, value) values ('webguiCreateAccountTemplate', 'PBtmpl0000000000000011');
|
||||||
|
insert into settings (name, value) values ('webguiExpiredPasswordTemplate', 'PBtmpl0000000000000012');
|
||||||
|
insert into settings (name, value) values ('webguiLoginTemplate', 'PBtmpl0000000000000013');
|
||||||
|
insert into settings (name, value) values ('webguiPasswordRecoveryTemplate', 'PBtmpl0000000000000014');
|
||||||
|
insert into settings (name, value) values ('ldapAccountTemplate', 'PBtmpl0000000000000004');
|
||||||
|
insert into settings (name, value) values ('ldapCreateAccountTemplate', 'PBtmpl0000000000000005');
|
||||||
|
insert into settings (name, value) values ('ldapLoginTemplate', 'PBtmpl0000000000000006');
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -561,6 +561,10 @@ Renders self->view based upon current style, subject to timeouts. Returns Privil
|
||||||
sub www_view {
|
sub www_view {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
return WebGUI::Privilege::noAccess() unless $self->canView;
|
return WebGUI::Privilege::noAccess() unless $self->canView;
|
||||||
|
if ($self->get("encryptPage") && $session{env}{HTTPS} ne "on") {
|
||||||
|
WebGUI::HTTP::setRedirect($self->getUrl);
|
||||||
|
return "";
|
||||||
|
}
|
||||||
$self->logView();
|
$self->logView();
|
||||||
my $cache;
|
my $cache;
|
||||||
my $output;
|
my $output;
|
||||||
|
|
|
||||||
|
|
@ -325,22 +325,40 @@ sub editUserSettingsForm {
|
||||||
-value=>$session{setting}{ldapWelcomeMessage},
|
-value=>$session{setting}{ldapWelcomeMessage},
|
||||||
-label=>WebGUI::International::get(869)
|
-label=>WebGUI::International::get(869)
|
||||||
);
|
);
|
||||||
|
$f->template(
|
||||||
|
-name=>"ldapAccountTemplate",
|
||||||
|
-value=>$session{setting}{ldapAccountTemplate},
|
||||||
|
-namespace=>"Auth/LDAP/Account",
|
||||||
|
-label=>WebGUI::International::get("account template","AuthLDAP")
|
||||||
|
);
|
||||||
|
$f->template(
|
||||||
|
-name=>"ldapCreateAccountTemplate",
|
||||||
|
-value=>$session{setting}{ldapCreateAccountTemplate},
|
||||||
|
-namespace=>"Auth/LDAP/Create",
|
||||||
|
-label=>WebGUI::International::get("create account template","AuthLDAP")
|
||||||
|
);
|
||||||
|
$f->template(
|
||||||
|
-name=>"ldapLoginTemplate",
|
||||||
|
-value=>$session{setting}{ldapLoginTemplate},
|
||||||
|
-namespace=>"Auth/LDAP/Login",
|
||||||
|
-label=>WebGUI::International::get("login template","AuthLDAP")
|
||||||
|
);
|
||||||
return $f->printRowsOnly;
|
return $f->printRowsOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub getAccountTemplateId {
|
sub getAccountTemplateId {
|
||||||
return "PBtmpl0000000000000004";
|
return $session{setting}{ldapAccountTemplate} || "PBtmpl0000000000000004";
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub getCreateAccountTemplateId {
|
sub getCreateAccountTemplateId {
|
||||||
return "PBtmpl0000000000000005";
|
return $session{setting}{ldapCreateAccountTemplate} || "PBtmpl0000000000000005";
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub getLoginTemplateId {
|
sub getLoginTemplateId {
|
||||||
return "PBtmpl0000000000000006";
|
return $session{setting}{ldapLoginTemplate} || "PBtmpl0000000000000006";
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -383,42 +383,72 @@ sub editUserSettingsForm {
|
||||||
-label=>WebGUI::International::get(6,'AuthWebGUI')
|
-label=>WebGUI::International::get(6,'AuthWebGUI')
|
||||||
);
|
);
|
||||||
$f->textarea("webguiRecoverPasswordEmail",WebGUI::International::get(134),$session{setting}{webguiRecoverPasswordEmail});
|
$f->textarea("webguiRecoverPasswordEmail",WebGUI::International::get(134),$session{setting}{webguiRecoverPasswordEmail});
|
||||||
$f->yesNo(
|
$f->yesNo(
|
||||||
-name=>"webguiValidateEmail",
|
-name=>"webguiValidateEmail",
|
||||||
-value=>$session{setting}{webguiValidateEmail},
|
-value=>$session{setting}{webguiValidateEmail},
|
||||||
-label=>WebGUI::International::get('validate email','AuthWebGUI')
|
-label=>WebGUI::International::get('validate email','AuthWebGUI')
|
||||||
);
|
);
|
||||||
$f->yesNo(
|
$f->yesNo(
|
||||||
-name=>"webguiUseCaptcha",
|
-name=>"webguiUseCaptcha",
|
||||||
-value=>$session{setting}{webguiUseCaptcha},
|
-value=>$session{setting}{webguiUseCaptcha},
|
||||||
-label=>WebGUI::International::get('use captcha','AuthWebGUI')
|
-label=>WebGUI::International::get('use captcha','AuthWebGUI')
|
||||||
);
|
);
|
||||||
|
$f->template(
|
||||||
|
-name=>"webguiAccountTemplate",
|
||||||
|
-value=>$session{setting}{webguiAccountTemplate},
|
||||||
|
-namespace=>"Auth/WebGUI/Account",
|
||||||
|
-label=>WebGUI::International::get("account template","AuthWebGUI")
|
||||||
|
);
|
||||||
|
$f->template(
|
||||||
|
-name=>"webguiCreateAccountTemplate",
|
||||||
|
-value=>$session{setting}{webguiCreateAccountTemplate},
|
||||||
|
-namespace=>"Auth/WebGUI/Create",
|
||||||
|
-label=>WebGUI::International::get("create account template","AuthWebGUI")
|
||||||
|
);
|
||||||
|
$f->template(
|
||||||
|
-name=>"webguiExpiredPasswordTemplate",
|
||||||
|
-value=>$session{setting}{webguiExpiredPasswordTemplate},
|
||||||
|
-namespace=>"Auth/WebGUI/Expired",
|
||||||
|
-label=>WebGUI::International::get("expired password template","AuthWebGUI")
|
||||||
|
);
|
||||||
|
$f->template(
|
||||||
|
-name=>"webguiLoginTemplate",
|
||||||
|
-value=>$session{setting}{webguiLoginTemplate},
|
||||||
|
-namespace=>"Auth/WebGUI/Login",
|
||||||
|
-label=>WebGUI::International::get("login template","AuthWebGUI")
|
||||||
|
);
|
||||||
|
$f->template(
|
||||||
|
-name=>"webguiPasswordRecoveryTemplate",
|
||||||
|
-value=>$session{setting}{webguiPasswordRecoveryTemplate},
|
||||||
|
-namespace=>"Auth/WebGUI/Recovery",
|
||||||
|
-label=>WebGUI::International::get("password recovery template","AuthWebGUI")
|
||||||
|
);
|
||||||
return $f->printRowsOnly;
|
return $f->printRowsOnly;
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub getAccountTemplateId {
|
sub getAccountTemplateId {
|
||||||
return "PBtmpl0000000000000010";
|
return $session{setting}{webguiAccountTemplate} || "PBtmpl0000000000000010";
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub getCreateAccountTemplateId {
|
sub getCreateAccountTemplateId {
|
||||||
return "PBtmpl0000000000000011";
|
return $session{setting}{webguiCreateAccountTemplate} || "PBtmpl0000000000000011";
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub getExpiredPasswordTemplateId {
|
sub getExpiredPasswordTemplateId {
|
||||||
return "PBtmpl0000000000000012";
|
return $session{setting}{webguiExpiredPasswordTemplate} || "PBtmpl0000000000000012";
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub getLoginTemplateId {
|
sub getLoginTemplateId {
|
||||||
return "PBtmpl0000000000000013";
|
return $session{setting}{webguiLoginTemplate} || "PBtmpl0000000000000013";
|
||||||
}
|
}
|
||||||
|
|
||||||
#-------------------------------------------------------------------
|
#-------------------------------------------------------------------
|
||||||
sub getPasswordRecoveryTemplateId {
|
sub getPasswordRecoveryTemplateId {
|
||||||
return "PBtmpl0000000000000014";
|
return $session{setting}{webguiPasswordRecoveryTemplate} || "PBtmpl0000000000000014";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -208,7 +208,7 @@ sub getSiteURL {
|
||||||
$site = $session{env}{HTTP_HOST} || $session{config}{defaultSitename};
|
$site = $session{env}{HTTP_HOST} || $session{config}{defaultSitename};
|
||||||
}
|
}
|
||||||
my $proto = "http://";
|
my $proto = "http://";
|
||||||
if ($session{env}{SERVER_PORT} == 443) {
|
if ($session{env}{HTTPS} eq "on") {
|
||||||
$proto = "https://";
|
$proto = "https://";
|
||||||
}
|
}
|
||||||
return $proto.$site;
|
return $proto.$site;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,21 @@
|
||||||
package WebGUI::i18n::English::AuthLDAP;
|
package WebGUI::i18n::English::AuthLDAP;
|
||||||
|
|
||||||
our $I18N = {
|
our $I18N = {
|
||||||
|
'account template' => {
|
||||||
|
message => q|Account Template|,
|
||||||
|
lastUpdated => 1078852969
|
||||||
|
},
|
||||||
|
|
||||||
|
'create account template' => {
|
||||||
|
message => q|Create Account Template|,
|
||||||
|
lastUpdated => 1078852969
|
||||||
|
},
|
||||||
|
|
||||||
|
'login template' => {
|
||||||
|
message => q|Login Template|,
|
||||||
|
lastUpdated => 1078852969
|
||||||
|
},
|
||||||
|
|
||||||
'account-1' => {
|
'account-1' => {
|
||||||
message => q|LDAP Authentication Display Account Template|,
|
message => q|LDAP Authentication Display Account Template|,
|
||||||
lastUpdated => 1078852969
|
lastUpdated => 1078852969
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,31 @@
|
||||||
package WebGUI::i18n::English::AuthWebGUI;
|
package WebGUI::i18n::English::AuthWebGUI;
|
||||||
|
|
||||||
our $I18N = {
|
our $I18N = {
|
||||||
|
'account template' => {
|
||||||
|
message => q|Account Template|,
|
||||||
|
lastUpdated => 1078852836
|
||||||
|
},
|
||||||
|
|
||||||
|
'create account template' => {
|
||||||
|
message => q|Create Account Template|,
|
||||||
|
lastUpdated => 1078852836
|
||||||
|
},
|
||||||
|
|
||||||
|
'expired password template' => {
|
||||||
|
message => q|Expired Password Template|,
|
||||||
|
lastUpdated => 1078852836
|
||||||
|
},
|
||||||
|
|
||||||
|
'login template' => {
|
||||||
|
message => q|Login Template|,
|
||||||
|
lastUpdated => 1078852836
|
||||||
|
},
|
||||||
|
|
||||||
|
'password recovery template' => {
|
||||||
|
message => q|Password Recovery Template|,
|
||||||
|
lastUpdated => 1078852836
|
||||||
|
},
|
||||||
|
|
||||||
'use captcha' => {
|
'use captcha' => {
|
||||||
message => q|Use captcha image?|,
|
message => q|Use captcha image?|,
|
||||||
lastUpdated => 1078852836
|
lastUpdated => 1078852836
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue