From 835d439e42b8877425f5685dc2a71a18d1b5da98 Mon Sep 17 00:00:00 2001 From: Brian Read Date: Thu, 23 Jan 2025 15:03:28 +0000 Subject: [PATCH] mojo update, version in footer, password setting in useraccounts --- .../smanager/lib/SrvMngr/Controller/Useraccounts.pm | 10 ++++++---- smeserver-manager.spec | 4 +++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/root/usr/share/smanager/lib/SrvMngr/Controller/Useraccounts.pm b/root/usr/share/smanager/lib/SrvMngr/Controller/Useraccounts.pm index 968c335..c4e9b46 100644 --- a/root/usr/share/smanager/lib/SrvMngr/Controller/Useraccounts.pm +++ b/root/usr/share/smanager/lib/SrvMngr/Controller/Useraccounts.pm @@ -34,6 +34,7 @@ our $cdb = esmith::ConfigDB->open() || die "Couldn't open config db"; sub main { my $c = shift; $c->app->log->info($c->log_req); + my $adb = esmith::AccountsDB->open || die "Couldn't open accounts db"; my $notif = ''; my %usr_datas = (); my $title = $c->l('usr_FORM_TITLE'); @@ -394,10 +395,12 @@ sub remove_account { sub reset_password { my ($c, $user, $passw1) = @_; + unless (($user) = ($user =~ /^(\w[\-\w_\.]*)$/)) { return $c->l('usr_TAINTED_USER'); } $user = $1; + my $adb = esmith::AccountsDB->open || die "Couldn't open accounts db"; my $acct = $adb->get($user); if ($acct->prop('type') eq "user") { @@ -445,10 +448,9 @@ sub validate_password { } $reason ||= "Software error: password check failed"; return "OK" if ($reason eq "ok"); - return - $c->l("Bad Password Choice") . ": " + return $c->l("Bad Password Choice") . ": " . $c->l("The password you have chosen is not a good choice, because") . " " - . $c->($reason) . "."; + . $c->l($reason) . "."; } ## end sub validate_password sub emailForward_list { @@ -817,4 +819,4 @@ sub system_change_password { return $c->l("Error occurred while modifying password for admin.", 'First'); } } ## end sub system_change_password -1 +1 \ No newline at end of file diff --git a/smeserver-manager.spec b/smeserver-manager.spec index 24caf29..c87a4ff 100644 --- a/smeserver-manager.spec +++ b/smeserver-manager.spec @@ -116,7 +116,9 @@ true %changelog * Thu Jan 23 2025 Brian Read 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 11.0.0-42.sme - Implement password visibility icon - [SME: 12803]