mojo update, version in footer, password setting in useraccounts

This commit is contained in:
Brian Read 2025-01-23 15:03:28 +00:00
parent 4797a1b189
commit 835d439e42
2 changed files with 9 additions and 5 deletions

View File

@ -34,6 +34,7 @@ our $cdb = esmith::ConfigDB->open() || die "Couldn't open config db";
sub main { sub main {
my $c = shift; my $c = shift;
$c->app->log->info($c->log_req); $c->app->log->info($c->log_req);
my $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
my $notif = ''; my $notif = '';
my %usr_datas = (); my %usr_datas = ();
my $title = $c->l('usr_FORM_TITLE'); my $title = $c->l('usr_FORM_TITLE');
@ -394,10 +395,12 @@ sub remove_account {
sub reset_password { sub reset_password {
my ($c, $user, $passw1) = @_; my ($c, $user, $passw1) = @_;
unless (($user) = ($user =~ /^(\w[\-\w_\.]*)$/)) { unless (($user) = ($user =~ /^(\w[\-\w_\.]*)$/)) {
return $c->l('usr_TAINTED_USER'); return $c->l('usr_TAINTED_USER');
} }
$user = $1; $user = $1;
my $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
my $acct = $adb->get($user); my $acct = $adb->get($user);
if ($acct->prop('type') eq "user") { if ($acct->prop('type') eq "user") {
@ -445,10 +448,9 @@ sub validate_password {
} }
$reason ||= "Software error: password check failed"; $reason ||= "Software error: password check failed";
return "OK" if ($reason eq "ok"); return "OK" if ($reason eq "ok");
return return $c->l("Bad Password Choice") . ": "
$c->l("Bad Password Choice") . ": "
. $c->l("The password you have chosen is not a good choice, because") . " " . $c->l("The password you have chosen is not a good choice, because") . " "
. $c->($reason) . "."; . $c->l($reason) . ".";
} ## end sub validate_password } ## end sub validate_password
sub emailForward_list { sub emailForward_list {
@ -817,4 +819,4 @@ sub system_change_password {
return $c->l("Error occurred while modifying password for admin.", 'First'); return $c->l("Error occurred while modifying password for admin.", 'First');
} }
} ## end sub system_change_password } ## end sub system_change_password
1 1

View File

@ -116,7 +116,9 @@ true
%changelog %changelog
* Thu Jan 23 2025 Brian Read <brianr@koozali.org> 11.0.0-43.sme * Thu Jan 23 2025 Brian Read <brianr@koozali.org> 11.0.0-43.sme
- fix ccess to config file though config plugin for mojo 9.39 [SME: 12885] - fix access to config file though config plugin for mojo 9.39 [SME: 12885]
- Fix password setting for useraccounts and also adjust DB opens
- Add mojo version to footer for logged in.
* Fri Jan 17 2025 Brian Read <brianr@koozali.org> 11.0.0-42.sme * Fri Jan 17 2025 Brian Read <brianr@koozali.org> 11.0.0-42.sme
- Implement password visibility icon - [SME: 12803] - Implement password visibility icon - [SME: 12803]