diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index be538437f..f8a5fa7c8 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -86,6 +86,8 @@ - RFE [ 960747 ] Make the attachment box templated. Thanks to Flavio Curti. - Snippets can now take up to 9 optional parameters as replacements similar to the SQL macro. Thanks to Andreas Ljunggren. + - bugfix [ 990710 ] Users can't change own passwords + 6.0.3 diff --git a/lib/WebGUI/Auth/WebGUI.pm b/lib/WebGUI/Auth/WebGUI.pm index 149158a39..264d2552d 100644 --- a/lib/WebGUI/Auth/WebGUI.pm +++ b/lib/WebGUI/Auth/WebGUI.pm @@ -191,6 +191,8 @@ sub createAccountSave { } my $properties; + $properties->{changeUsername} = $session{setting}{webguiChangeUsername}; + $properties->{changePassword} = $session{setting}{webguiChangePassword}; $properties->{identifier} = Digest::MD5::md5_base64($password); $properties->{passwordLastUpdated} = time(); $properties->{passwordTimeout} = $session{setting}{webguiPasswordTimeout}; @@ -219,18 +221,18 @@ sub displayAccount { return $self->displayLogin($_[0]) if ($self->userId == 1); my $userData = $self->getParams; $vars->{'account.message'} = $_[0] if ($_[0]); - if($userData->{changeUsername}){ + $vars->{'account.noform'} = 1; + if($userData->{changeUsername} || (!defined $userData->{changeUsername} && $session{setting}{webguiChangeUsername})){ $vars->{'account.form.username'} = WebGUI::Form::text({"name"=>"authWebGUI.username","value"=>$self->username}); $vars->{'account.form.username.label'} = WebGUI::International::get(50); + $vars->{'account.noform'} = 0; } - if($userData->{changePassword}){ + if($userData->{changePassword} || (!defined $userData->{changePassword} && $session{setting}{webguiChangePassword})){ $vars->{'account.form.password'} = WebGUI::Form::password({"name"=>"authWebGUI.identifier","value"=>"password"}); $vars->{'account.form.password.label'} = WebGUI::International::get(51); $vars->{'account.form.passwordConfirm'} = WebGUI::Form::password({"name"=>"authWebGUI.identifierConfirm","value"=>"password"}); $vars->{'account.form.passwordConfirm.label'} = WebGUI::International::get(2,'AuthWebGUI'); - } - if(!$userData->{changeUsername} && !$userData->{changePassword}){ - $vars->{'account.noform'} = "true"; + $vars->{'account.noform'} = 0; } $vars->{'account.nofields'} = WebGUI::International::get(22,'AuthWebGUI'); return $self->SUPER::displayAccount("updateAccount",$vars); diff --git a/lib/WebGUI/Operation/Settings.pm b/lib/WebGUI/Operation/Settings.pm index f51fb3500..98285bf9b 100644 --- a/lib/WebGUI/Operation/Settings.pm +++ b/lib/WebGUI/Operation/Settings.pm @@ -20,6 +20,7 @@ use WebGUI::International; use WebGUI::Operation::Shared; use WebGUI::Privilege; use WebGUI::Session; +use WebGUI::Style; use WebGUI::SQL; use WebGUI::URL; @@ -149,7 +150,7 @@ sub www_editUserSettings { my ($output, $f, $cmd, $html); $output .= helpIcon("user settings edit"); $output .= '