From 8bd4f8274af2e406603fb3ca9f504632effd0f62 Mon Sep 17 00:00:00 2001 From: JT Smith Date: Thu, 3 Mar 2005 01:33:57 +0000 Subject: [PATCH] password timeout fix --- docs/changelog/6.x.x.txt | 1 + lib/WebGUI/Auth/WebGUI.pm | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index eead743fb..7f0cc6c6c 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -6,6 +6,7 @@ - Fixed a bug where URLs would become unreachable when using SSL. - Added an initial configuration wizard which prompts the site owner to configure a custom admin username and password for better security. + - Fixed a password timeout bug caused by the change in the interval method. 6.3.0 diff --git a/lib/WebGUI/Auth/WebGUI.pm b/lib/WebGUI/Auth/WebGUI.pm index a57659d35..e37263948 100644 --- a/lib/WebGUI/Auth/WebGUI.pm +++ b/lib/WebGUI/Auth/WebGUI.pm @@ -15,6 +15,7 @@ use strict; use WebGUI::Asset::Template; use WebGUI::Auth; use WebGUI::DateTime; +use WebGUI::FormProcessor; use WebGUI::HTMLForm; use WebGUI::Macro; use WebGUI::Mail; @@ -81,7 +82,12 @@ sub addUserForm { my $userData = $self->getParams; my $f = WebGUI::HTMLForm->new; $f->password("authWebGUI.identifier",WebGUI::International::get(51),"password"); - $f->interval("authWebGUI.passwordTimeout",WebGUI::International::get(16,'AuthWebGUI'),WebGUI::DateTime::secondsToInterval(($userData->{passwordTimeout} || $session{setting}{webguiPasswordTimeout}))); + $f->interval( + -name=>"authWebGUI.passwordTimeout", + -label=>WebGUI::International::get(16,'AuthWebGUI'), + -value=>$userData->{passwordTimeout}, + -defaultValue=>$session{setting}{webguiPasswordTimeout} + ); my $userChange = $session{setting}{webguiChangeUsername}; if($userChange || $userChange eq "0"){ $userChange = $userData->{changeUsername}; @@ -119,7 +125,7 @@ sub addUserFormSave { } $properties->{changeUsername} = $session{form}{'authWebGUI.changeUsername'}; $properties->{changePassword} = $session{form}{'authWebGUI.changePassword'}; - $properties->{passwordTimeout} = WebGUI::DateTime::intervalToSeconds($session{form}{'authWebGUI.passwordTimeout_interval'},$session{form}{'authWebGUI.passwordTimeout_units'}); + $properties->{passwordTimeout} = WebGUI::FormProcessor::interval('authWebGUI.passwordTimeout'); $properties->{passwordLastUpdated} = time(); if($session{setting}{webguiExpirePasswordOnCreation}){ $properties->{passwordLastUpdated} = time() - $properties->{passwordTimeout}; @@ -289,7 +295,7 @@ sub editUserFormSave { $properties->{passwordLastUpdated} = time(); } } - $properties->{passwordTimeout} = WebGUI::DateTime::intervalToSeconds($session{form}{'authWebGUI.passwordTimeout_interval'},$session{form}{'authWebGUI.passwordTimeout_units'}); + $properties->{passwordTimeout} = WebGUI::FormProcessor::interval('authWebGUI.passwordTimeout'); $properties->{changeUsername} = $session{form}{'authWebGUI.changeUsername'}; $properties->{changePassword} = $session{form}{'authWebGUI.changePassword'}; @@ -314,7 +320,11 @@ sub editUserSettingsForm { -size=>5, -maxLength=>5, ); - $f->interval("webguiPasswordTimeout",WebGUI::International::get(16,'AuthWebGUI'),WebGUI::DateTime::secondsToInterval($session{setting}{webguiPasswordTimeout})); + $f->interval( + -name=>"webguiPasswordTimeout", + -label=>WebGUI::International::get(16,'AuthWebGUI'), + -value=>$session{setting}{webguiPasswordTimeout} + ); $f->yesNo( -name=>"webguiExpirePasswordOnCreation", -value=>$session{setting}{webguiExpirePasswordOnCreation},