* Fri Feb 07 2025 Brian Read <brianr@koozali.org> 11.0.0-49.sme
- Fix delete of ibay - typo in link - Move across toMB() sub from formmagick to quota.pm - Recast DB opening so it is specific to the route rather than global [SME: 12905]
This commit is contained in:
@@ -19,14 +19,15 @@ use Locale::gettext;
|
||||
use SrvMngr::I18N;
|
||||
use SrvMngr qw(theme_list init_session);
|
||||
|
||||
#our $db = esmith::ConfigDB->open || die "Couldn't open config db";
|
||||
our $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
|
||||
#our $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
|
||||
my $adb;
|
||||
|
||||
sub main {
|
||||
my $c = shift;
|
||||
$c->app->log->info($c->log_req);
|
||||
my %quo_datas = ();
|
||||
my $title = $c->l('quo_FORM_TITLE');
|
||||
$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
|
||||
$quo_datas{'trt'} = 'LIST';
|
||||
my @userAccounts;
|
||||
|
||||
@@ -45,6 +46,7 @@ sub do_display {
|
||||
$trt = 'UPD' if ($user);
|
||||
my %quo_datas = ();
|
||||
my $title = $c->l('quo_FORM_TITLE');
|
||||
$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
|
||||
$quo_datas{'trt'} = $trt;
|
||||
|
||||
if ($trt eq 'UPD') {
|
||||
@@ -73,6 +75,7 @@ sub do_update {
|
||||
$quo_datas{trt} = $trt;
|
||||
my $result = '';
|
||||
my $res;
|
||||
$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
|
||||
|
||||
if ($trt eq 'UPD') {
|
||||
$quo_datas{user} = ($c->param('user') || '');
|
||||
@@ -156,4 +159,10 @@ sub validate_quota {
|
||||
or die($c->l('quo_ERR_MODIFYING') . "\n");
|
||||
return 'OK';
|
||||
} ## end sub validate_quota
|
||||
|
||||
sub toMB
|
||||
{
|
||||
my ($self,$kb) = @_;
|
||||
return sprintf("%.2f", $kb / 1024);
|
||||
}
|
||||
1
|
||||
|
Reference in New Issue
Block a user