Compare commits

...

2 Commits

Author SHA1 Message Date
237f2f21ab * Wed Jul 16 2025 Brian Read <brianr@koozali.org> 11.0.0-109.sme
- A few more error message corrections [SME: 13078]
2025-07-16 15:46:49 +01:00
1708fbe3fa * Wed Jul 16 2025 Brian Read <brianr@koozali.org> 11.0.0-108.sme
- Password change panel - add extra descriptive text [SME: 13081]
2025-07-16 06:19:47 +01:00
5 changed files with 27 additions and 12 deletions

View File

@@ -361,7 +361,7 @@ sub lock_account {
$adb = esmith::AccountsDB::UTF8->open(); $adb = esmith::AccountsDB::UTF8->open();
return 'OK'; return 'OK';
} else { } else {
return $c->l('NO_SUCH_USER', $user); return $c->l('usr_NO_SUCH_USER', $user);
} }
} ## end sub lock_account } ## end sub lock_account
@@ -380,13 +380,13 @@ sub remove_account {
if (system("/sbin/e-smith/signal-event", "user-delete", $user)) { if (system("/sbin/e-smith/signal-event", "user-delete", $user)) {
$adb = esmith::AccountsDB::UTF8->open(); $adb = esmith::AccountsDB::UTF8->open();
return $c->l("ERR_OCCURRED_DELETING"); return $c->l("usr_ERR_OCCURRED_DELETING");
} }
$adb = esmith::AccountsDB::UTF8->open(); $adb = esmith::AccountsDB::UTF8->open();
$adb->get($user)->delete; $adb->get($user)->delete;
return 'OK'; return 'OK';
} else { } else {
return $c->l('NO_SUCH_USER', $user); return $c->l('usr_NO_SUCH_USER', $user);
} }
} ## end sub remove_account } ## end sub remove_account
@@ -413,7 +413,7 @@ sub reset_password {
$adb = esmith::AccountsDB::UTF8->open(); $adb = esmith::AccountsDB::UTF8->open();
return 'OK'; return 'OK';
} else { } else {
return $c->l('NO_SUCH_USER', $user); return $c->l('usr_NO_SUCH_USER', $user);
} }
} ## end sub reset_password } ## end sub reset_password
@@ -788,7 +788,7 @@ sub system_change_password {
if ($result == 0) { if ($result == 0) {
return 'OK'; return 'OK';
} else { } else {
return $c->l("Error occurred while modifying password for admin.", 'First'); return $c->l("Error occurred while modifying password for admin.");
} }
} ## end sub system_change_password } ## end sub system_change_password
1 1

View File

@@ -21,6 +21,7 @@ use SrvMngr qw( theme_list init_session validate_password );
sub main { sub main {
my $c = shift; my $c = shift;
my %pwd_datas = (); my %pwd_datas = ();
my $title = $c->l("pwd_ACCOUNT_PASSWORD_CHANGE");
if ($c->is_logged_in) { if ($c->is_logged_in) {
$pwd_datas{Account} = $c->session->{username}; $pwd_datas{Account} = $c->session->{username};
@@ -34,7 +35,7 @@ sub main {
# request already treated or outdated # request already treated or outdated
if ($c->pwdrst->{$name}{confirmed} != 1 or $c->pwdrst->{$name}{date} < time()) { if ($c->pwdrst->{$name}{confirmed} != 1 or $c->pwdrst->{$name}{date} < time()) {
$mess = $c->l('use_INVALID_REQUEST') . ' -step 1-'; $mess = $c->l('pwd_INVALID_REQUEST') . ' -step 1-';
} }
if ($mess) { if ($mess) {
@@ -47,7 +48,7 @@ sub main {
$pwd_datas{Account} = $name; $pwd_datas{Account} = $name;
$pwd_datas{trt} = 'RESET'; $pwd_datas{trt} = 'RESET';
$pwd_datas{jwt} = $jwt; $pwd_datas{jwt} = $jwt;
$c->flash(success => $c->l('use_OK_FOR_RESET')); $c->flash(success => $c->l('pwd_OK_FOR_RESET'));
} ## end else [ if ($c->is_logged_in) ] } ## end else [ if ($c->is_logged_in) ]
$c->stash(pwd_datas => \%pwd_datas); $c->stash(pwd_datas => \%pwd_datas);
$c->render('userpassword'); $c->render('userpassword');
@@ -74,7 +75,7 @@ sub change_password {
# request already treated or outdated # request already treated or outdated
if ($c->pwdrst->{$name}{confirmed} != 2 or $c->pwdrst->{$name}{date} < time()) { if ($c->pwdrst->{$name}{confirmed} != 2 or $c->pwdrst->{$name}{date} < time()) {
$mess = $c->l('use_INVALID_REQUEST') . ' -step 2-'; $mess = $c->l('pwd_INVALID_REQUEST') . ' -step 2-';
} }
if (!$name or $c->is_logged_in or $name ne $acctName) { if (!$name or $c->is_logged_in or $name ne $acctName) {
@@ -158,7 +159,7 @@ sub change_password {
sub reset_password { sub reset_password {
my ($c, $trt, $user, $password, $oldpassword) = @_; my ($c, $trt, $user, $password, $oldpassword) = @_;
my $ret; my $ret;
return $c->l('usr_TAINTED_USER') unless (($user) = ($user =~ /^(\w[\-\w_\.]*)$/)); return $c->l('pwd_TAINTED_USER') unless (($user) = ($user =~ /^(\w[\-\w_\.]*)$/));
$user = $1; $user = $1;
my $adb = esmith::AccountsDB::UTF8->open(); my $adb = esmith::AccountsDB::UTF8->open();
my $acct = $adb->get($user); my $acct = $adb->get($user);
@@ -171,7 +172,7 @@ sub reset_password {
if (system("/sbin/e-smith/signal-event", "password-modify", $user)) { if (system("/sbin/e-smith/signal-event", "password-modify", $user)) {
$adb = esmith::AccountsDB::UTF8->open(); $adb = esmith::AccountsDB::UTF8->open();
return $c->l("usr_ERR_OCCURRED_MODIFYING_PASSWORD"); return $c->l("pwd_ERR_OCCURRED_MODIFYING_PASSWORD");
} }
$adb = esmith::AccountsDB::UTF8->open(); $adb = esmith::AccountsDB::UTF8->open();
return 'OK'; return 'OK';

View File

@@ -19,3 +19,5 @@
'pwd_PASSWORD_CHANGE_SUCCESS' => 'Your password has been successfully changed.', 'pwd_PASSWORD_CHANGE_SUCCESS' => 'Your password has been successfully changed.',
'pwd_DESCRIPTION' => '<P>To change your account password, please fill out the following form. You will need to provide the name of your account, your old password, and your desired new password. (You must type the new password twice.)</P><P>If you cannot change your password because you have forgotten the old one, your local system administrator can reset your password using the <EM>server manager</EM>.</P>', 'pwd_DESCRIPTION' => '<P>To change your account password, please fill out the following form. You will need to provide the name of your account, your old password, and your desired new password. (You must type the new password twice.)</P><P>If you cannot change your password because you have forgotten the old one, your local system administrator can reset your password using the <EM>server manager</EM>.</P>',
'pwd_DESCRIPTION_RESET' => '<P>To reset your account password, please fill out the following form. You will need to provide your desired new password. (You must type it twice.)</P><P>In cas of problem, your local system administrator can reset your password using the <EM>server manager</EM>.</P>', 'pwd_DESCRIPTION_RESET' => '<P>To reset your account password, please fill out the following form. You will need to provide your desired new password. (You must type it twice.)</P><P>In cas of problem, your local system administrator can reset your password using the <EM>server manager</EM>.</P>',
'pwd_PASSWORD_DESCRIPTION' => 'The password must be composed of at least twelve characters with uppercase and lowercase letters, numbers and non-alphanumeric characters.',
'pwd_PASSWORD_WIKI' => "If you want to know more about passwords, then please refer to the <a href='https://wiki.koozali.org/Useful_Commands#Password_strength'>Wiki</a>",

View File

@@ -25,6 +25,12 @@
% my $btn = l('pwd_PASSWORD_CHANGE'); % my $btn = l('pwd_PASSWORD_CHANGE');
% my $url = '/userpassword'; % my $url = '/userpassword';
%= $c->render_to_string( inline => l('pwd_DESCRIPTION')); %= $c->render_to_string( inline => l('pwd_DESCRIPTION'));
<p>
<%= $c->render_to_string( inline => l('pwd_PASSWORD_DESCRIPTION')) %><br />
<%= $c->render_to_string( inline => l('pwd_PASSWORD_WIKI')) %>
</p>
% if ( $pwd_datas->{trt} eq 'RESET' ) { % if ( $pwd_datas->{trt} eq 'RESET' ) {
% $btn = l('pwd_PASSWORD_RESET'); % $btn = l('pwd_PASSWORD_RESET');
% $url = '/userpasswordr'; % $url = '/userpasswordr';

View File

@@ -2,7 +2,7 @@ Summary: Sme server navigation module : manager 2
%define name smeserver-manager %define name smeserver-manager
Name: %{name} Name: %{name}
%define version 11.0.0 %define version 11.0.0
%define release 107 %define release 109
Version: %{version} Version: %{version}
Release: %{release}%{?dist} Release: %{release}%{?dist}
License: GPL License: GPL
@@ -146,6 +146,12 @@ true
%defattr(-,root,root) %defattr(-,root,root)
%changelog %changelog
* Wed Jul 16 2025 Brian Read <brianr@koozali.org> 11.0.0-109.sme
- A few more error message corrections [SME: 13078]
* Wed Jul 16 2025 Brian Read <brianr@koozali.org> 11.0.0-108.sme
- Password change panel - add extra descriptive text [SME: 13081]
* Tue Jul 15 2025 Brian Read <brianr@koozali.org> 11.0.0-107.sme * Tue Jul 15 2025 Brian Read <brianr@koozali.org> 11.0.0-107.sme
- Email Settings panel: Fix lex strings with long names and no prefix [SME: 13080] - Email Settings panel: Fix lex strings with long names and no prefix [SME: 13080]