Compare commits
19 Commits
11_0_0-90_
...
master
Author | SHA1 | Date | |
---|---|---|---|
237f2f21ab | |||
1708fbe3fa | |||
9f6e45d98c | |||
5ba77e4526 | |||
1d00f2aeb2 | |||
b0c6bea0a2 | |||
5a57ffaa34 | |||
717d34a53d | |||
bec39af49c | |||
ff9c2fee8c | |||
21255abf46 | |||
8ada3f36e0 | |||
ab42f986e8 | |||
803bfd1cec | |||
0f2e2b82aa | |||
0341d02608 | |||
c208419704 | |||
d1f2013375 | |||
0733537064 |
@@ -37,7 +37,7 @@ use esmith::NavigationDB; # no UTF8 raw is ok for ASCII only flat file
|
||||
use SrvMngr_Auth qw(check_admin_access);
|
||||
|
||||
#this is overwrittrn with the "release" by the spec file - release can be "99.el8.sme"
|
||||
our $VERSION = '78.el8.sme';
|
||||
our $VERSION = '94.el8.sme';
|
||||
#Extract the release value
|
||||
if ($VERSION =~ /^(\d+)/) {
|
||||
$VERSION = $1; # $1 contains the matched numeric digits
|
||||
@@ -326,7 +326,10 @@ sub setup_routing {
|
||||
$if_admin->post('/clamav')->to('clamav#do_update')->name('clamav2');
|
||||
|
||||
$if_admin->get('/datetime')->to('datetime#main')->name('datetime');
|
||||
$if_admin->post('/datetime')->to('datetime#do_update')->name('datetime2');
|
||||
$if_admin->post('/datetimeu')->to('datetime#do_update')->name('datetimeu');
|
||||
$if_admin->get('/datetimed')->to('datetime#do_display')->name('datetimed');
|
||||
$if_admin->post('/datetimet')->to('datetime#do_testntp')->name('datetimet');
|
||||
|
||||
|
||||
$if_admin->get('/directory')->to('directory#main')->name('directory');
|
||||
$if_admin->post('/directory')->to('directory#do_update')->name('directory2');
|
||||
@@ -421,28 +424,59 @@ sub setup_routing {
|
||||
# additional routes (for contribs) got from 'routes' db
|
||||
#my @routes = @{SrvMngr::get_routes_list()};
|
||||
|
||||
foreach (@{SrvMngr::get_routes_list()}) {
|
||||
|
||||
if ( defined $_->{method} and defined $_->{url} and defined $_->{ctlact} and defined $_->{name} ) {
|
||||
my $menu = defined $_->{menu} ? $_->{menu} : 'A';
|
||||
if ( $menu eq 'N' ) {
|
||||
$r->get($_->{url})->to($_->{ctlact})->name($_->{name})
|
||||
if ( $_->{method} eq 'get');
|
||||
$r->post($_->{url})->to($_->{ctlact})->name($_->{name})
|
||||
if ( $_->{method} eq 'post');
|
||||
} elsif ( $menu eq 'U' ) {
|
||||
$if_logged_in->get($_->{url})->to($_->{ctlact})->name($_->{name})
|
||||
if ( $_->{method} eq 'get');
|
||||
$if_logged_in->post($_->{url})->to($_->{ctlact})->name($_->{name})
|
||||
if ( $_->{method} eq 'post');
|
||||
} else {
|
||||
$if_admin->get($_->{url})->to($_->{ctlact})->name($_->{name})
|
||||
if ( $_->{method} eq 'get');
|
||||
$if_admin->post($_->{url})->to($_->{ctlact})->name($_->{name})
|
||||
if ( $_->{method} eq 'post');
|
||||
}
|
||||
#foreach (@{SrvMngr::get_routes_list()}) {
|
||||
#if ( defined $_->{method} and defined $_->{url} and defined $_->{ctlact} and defined $_->{name} ) {
|
||||
#my $menu = defined $_->{menu} ? $_->{menu} : 'A';
|
||||
#if ( $menu eq 'N' ) {
|
||||
#$r->get($_->{url})->to($_->{ctlact})->name($_->{name})
|
||||
#if ( $_->{method} eq 'get');
|
||||
#$r->post($_->{url})->to($_->{ctlact})->name($_->{name})
|
||||
#if ( $_->{method} eq 'post');
|
||||
#} elsif ( $menu eq 'U' ) {
|
||||
#$if_logged_in->get($_->{url})->to($_->{ctlact})->name($_->{name})
|
||||
#if ( $_->{method} eq 'get');
|
||||
#$if_logged_in->post($_->{url})->to($_->{ctlact})->name($_->{name})
|
||||
#if ( $_->{method} eq 'post');
|
||||
#} else {
|
||||
#$if_admin->get($_->{url})->to($_->{ctlact})->name($_->{name})
|
||||
#if ( $_->{method} eq 'get');
|
||||
#$if_admin->post($_->{url})->to($_->{ctlact})->name($_->{name})
|
||||
#if ( $_->{method} eq 'post');
|
||||
#}
|
||||
#}
|
||||
#}
|
||||
|
||||
foreach my $route (@{SrvMngr::get_routes_list()}) {
|
||||
if (defined $route->{method} && defined $route->{url} && defined $route->{ctlact} && defined $route->{name}) {
|
||||
my $menu = defined $route->{menu} ? $route->{menu} : 'A';
|
||||
|
||||
# Fix controller case: convert "ControllerName" to "controllername" in "ControllerName#action"
|
||||
# this is so that AdminLTE breadcrumb works - it appears that perl Packages names are NOT case sensitive
|
||||
# and that the breadcrumb package assumes that the package name is the same as the main route.
|
||||
my ($controller, $action) = split /#/, $route->{ctlact}, 2;
|
||||
my $fixed_ctlact = lc($controller) . '#' . $action;
|
||||
|
||||
if ($menu eq 'N') {
|
||||
$r->get($route->{url})->to($fixed_ctlact)->name($route->{name})
|
||||
if $route->{method} eq 'get';
|
||||
$r->post($route->{url})->to($fixed_ctlact)->name($route->{name})
|
||||
if $route->{method} eq 'post';
|
||||
}
|
||||
elsif ($menu eq 'U') {
|
||||
$if_logged_in->get($route->{url})->to($fixed_ctlact)->name($route->{name})
|
||||
if $route->{method} eq 'get';
|
||||
$if_logged_in->post($route->{url})->to($fixed_ctlact)->name($route->{name})
|
||||
if $route->{method} eq 'post';
|
||||
}
|
||||
else { # Default: menu 'A'
|
||||
$if_admin->get($route->{url})->to($fixed_ctlact)->name($route->{name})
|
||||
if $route->{method} eq 'get';
|
||||
$if_admin->post($route->{url})->to($fixed_ctlact)->name($route->{name})
|
||||
if $route->{method} eq 'post';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$if_admin->get('/config/:key' => {key => qr/[a-z0-9]{2,32}/})->to('request#getconfig')->name('getconfig');
|
||||
$if_admin->get('/account/:key' => {key => qr/[a-z0-9]{2,32}/})->to('request#getaccount')->name('getaccount');
|
||||
@@ -989,4 +1023,4 @@ sub get_reg_mask {
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
1;
|
@@ -0,0 +1,359 @@
|
||||
#
|
||||
# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-15 12:45:47
|
||||
#
|
||||
#
|
||||
# Routines to be edited by the developer to provide content and validation for parameters
|
||||
# and provison of the control data for table(s)
|
||||
#
|
||||
use esmith::util;
|
||||
use esmith::util::network;
|
||||
use esmith::ConfigDB::UTF8;
|
||||
use esmith::AccountsDB;
|
||||
use esmith::NetworksDB::UTF8;
|
||||
use esmith::HostsDB;
|
||||
use esmith::DomainsDB::UTF8;
|
||||
|
||||
use DateTime;
|
||||
|
||||
use constant FALSE => 0;
|
||||
use constant TRUE => 1;
|
||||
|
||||
|
||||
#The most common ones - open DB when required.
|
||||
my $cdb;
|
||||
my $adb;
|
||||
my $ndb;
|
||||
my $hdb;
|
||||
my $ddb;
|
||||
|
||||
#The most common ones - you might want to use these if you need to make sure that the DB is refreshed.
|
||||
#$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
|
||||
#$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
|
||||
#$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
|
||||
#$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
|
||||
#$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
|
||||
|
||||
|
||||
# Validation routines - parameters for each panel
|
||||
|
||||
sub validate_PARAMS {
|
||||
my $c = shift;
|
||||
my $dat_data = shift; #Data hash as parameter
|
||||
# Validation for each field
|
||||
my $ret = '';
|
||||
|
||||
if (! TRUE) #validate $c->param('time_mode')
|
||||
{$ret .= 'Validation for time_mode failed';}
|
||||
if (! TRUE) #validate $c->param('ntpserver')
|
||||
{$ret .= 'Validation for ntpserver failed';}
|
||||
if (! TRUE) #validate $c->param('year')
|
||||
{$ret .= 'Validation for year failed';}
|
||||
if (! TRUE) #validate $c->param('month')
|
||||
{$ret .= 'Validation for month failed';}
|
||||
if (! TRUE) #validate $c->param('day')
|
||||
{$ret .= 'Validation for day failed';}
|
||||
if (! TRUE) #validate $c->param('hour')
|
||||
{$ret .= 'Validation for hour failed';}
|
||||
if (! TRUE) #validate $c->param('minute')
|
||||
{$ret .= 'Validation for minute failed';}
|
||||
if (! TRUE) #validate $c->param('second')
|
||||
{$ret .= 'Validation for second failed';}
|
||||
if ($ret eq '') {$ret = 'ok';}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
# Get singleton data for each panel
|
||||
|
||||
sub get_data_for_panel_PARAMS {
|
||||
# Return a hash with the fields required which will be loaded into the shared data
|
||||
my $c = shift;
|
||||
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
|
||||
# --- Setup options ---
|
||||
# Get today's date and time
|
||||
my ($today_sec, $today_min, $today_hour, $today_mday, $today_mon, $today_year) = localtime;
|
||||
$today_year += 1900;
|
||||
$today_mon += 1;
|
||||
my $today_mon = sprintf('%02d', $today_mon);
|
||||
my $today_mday = sprintf('%02d', $today_mday);
|
||||
my $now_hour = sprintf('%02d', $today_hour);
|
||||
my $now_min = sprintf('%02d', $today_min);
|
||||
my $now_sec = sprintf('%02d', $today_sec);
|
||||
my $current_year = $today_year;
|
||||
my $ntpserverurl = $cdb->get_prop('ntpd','NTPServer');
|
||||
my $now = DateTime->now( time_zone => 'local' );
|
||||
my %ret = (
|
||||
# fields from Inputs
|
||||
'time_mode'=>($ntpserverurl eq '' ? 'dat_manually_set' : 'dat_ntp_server'),
|
||||
'ntpserver'=>"$ntpserverurl",
|
||||
'year'=>"$today_year",
|
||||
'month'=>"$today_mon",
|
||||
'day'=>"$today_mday",,
|
||||
'hour'=>"$now_hour",
|
||||
'minute'=>"$now_min",
|
||||
'second'=>"$now_sec",
|
||||
'ntpstatus' => $cdb->get_prop('ntpd','status') || 'disabled',
|
||||
# and the current time as a full format
|
||||
'currentdatetime' => $now->strftime('%Y-%m-%dT%H:%M:%S')
|
||||
|
||||
);
|
||||
return %ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Get control data for table(s)
|
||||
|
||||
|
||||
|
||||
# Return hash with values from row in which link clicked on table
|
||||
|
||||
sub get_selected_PARAMS {
|
||||
my $c = shift;
|
||||
my $selected = shift; #Parameter is name of selected row.
|
||||
my $is_new_record = shift; #Indicates new record required (defaults)
|
||||
my %ret = ();
|
||||
#gather the values here
|
||||
return %ret;
|
||||
}
|
||||
|
||||
|
||||
#after sucessful modify or create or whatever and submit then perfom (if the params validate)
|
||||
|
||||
sub perform_PARAMS {
|
||||
my $c = shift;
|
||||
my $dat_data = shift; #Data hash as parameter
|
||||
my $ret = '';
|
||||
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
|
||||
my $db = $cdb; #maybe one of the others
|
||||
my $dbkey = 'ntpd';
|
||||
# To make it write to DB as comment, delete this (regex) string in each if statement "TRUE\) \#copy or perform with value: .* e.g."
|
||||
#$ntpserverurl = ( $c->param('time_mode') eq 'dat_manually_set' ? '' : $c->param('ntpserver'));
|
||||
#if (!$db->set_prop($dbkey,'NTPServer',$ntpserverurl,type=>'service'))
|
||||
#{$ret .= 'Perform/save failed for NTPServer';}
|
||||
#if (! TRUE) #copy or perform with value: year e.g. $db->set_prop($dbkey,'year',$c->param('year'),type=>'service'))
|
||||
#{$ret .= 'Perform/save failed for year';}
|
||||
#if (! TRUE) #copy or perform with value: month e.g. $db->set_prop($dbkey,'month',$c->param('month'),type=>'service'))
|
||||
#{$ret .= 'Perform/save failed for month';}
|
||||
#if (! TRUE) #copy or perform with value: day e.g. $db->set_prop($dbkey,'day',$c->param('day'),type=>'service'))
|
||||
#{$ret .= 'Perform/save failed for day';}
|
||||
#if (! TRUE) #copy or perform with value: hour e.g. $db->set_prop($dbkey,'hour',$c->param('hour'),type=>'service'))
|
||||
#{$ret .= 'Perform/save failed for hour';}
|
||||
#if (! TRUE) #copy or perform with value: minute e.g. $db->set_prop($dbkey,'minute',$c->param('minute'),type=>'service'))
|
||||
#{$ret .= 'Perform/save failed for minute';}
|
||||
#if (! TRUE) #copy or perform with value: second e.g. $db->set_prop($dbkey,'second',$c->param('second'),type=>'service'))
|
||||
#{$ret .= 'Perform/save failed for second';}
|
||||
if ($c->param('time_mode') eq 'dat_manually_set'){
|
||||
# Time and date set manually
|
||||
$ret .= $c->disable_ntp();
|
||||
$ret .= $c->validate_change_datetime()
|
||||
} else {
|
||||
# Time set by ntp server - set up parameters to it
|
||||
$ret = $c->update_ntpserver($c->param('ntpserver'))
|
||||
}
|
||||
if ($ret eq '') {$ret = 'ok';}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
sub create_link{
|
||||
# WIP
|
||||
my ($c,$route, $panel, $index) = @_;
|
||||
my $link = "$route?trt=$panel&Selected=$index";
|
||||
return $link;
|
||||
}
|
||||
|
||||
sub getZone_list {
|
||||
my $c = shift;
|
||||
|
||||
#--------------------------------------------------
|
||||
# Get a sorted list of time zones
|
||||
#--------------------------------------------------
|
||||
$ENV{BASH_ENV} = '';
|
||||
|
||||
if (!open(ZONES, "cd /usr/share/zoneinfo; /usr/bin/find . -type f -or -type l | /bin/grep '^./[A-Z]' |")) {
|
||||
warn($c->l('COULD_NOT_OPEN_TZ_FILE') . $! . '.');
|
||||
return undef;
|
||||
}
|
||||
my $zone;
|
||||
my @zones = ();
|
||||
|
||||
while (defined($zone = <ZONES>)) {
|
||||
chop($zone);
|
||||
$zone =~ s/^.\///;
|
||||
push @zones, $zone;
|
||||
} ## end while (defined($zone = <ZONES>...))
|
||||
close ZONES;
|
||||
my @zt = sort @zones;
|
||||
return \@zt;
|
||||
} ## end sub getZone_list
|
||||
|
||||
sub getTimezone {
|
||||
|
||||
#--------------------------------------------------
|
||||
# Figure out time zone by looking first looking at
|
||||
# the configuration database value of TimeZone.
|
||||
# If that is not defined, try and get it from /etc/localtime.
|
||||
# If that doesn't work, default to US/Eastern.
|
||||
#--------------------------------------------------
|
||||
my $localtime;
|
||||
my $timezonedefault = "US/Eastern";
|
||||
|
||||
if (defined $cdb->get('TimeZone')) {
|
||||
$timezonedefault = $cdb->get('TimeZone')->value;
|
||||
} else {
|
||||
|
||||
if (defined($localtime = readlink '/etc/localtime')) {
|
||||
my $pos = index $localtime, 'zoneinfo/';
|
||||
|
||||
if ($pos > -1) {
|
||||
$timezonedefault = substr $localtime, ($pos + 9);
|
||||
}
|
||||
} ## end if (defined($localtime...))
|
||||
} ## end else [ if (defined $cdb->get(...))]
|
||||
return $timezonedefault;
|
||||
} ## end sub getTimezone
|
||||
|
||||
sub validate_change_datetime {
|
||||
my $c = shift;
|
||||
$cdb = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
|
||||
|
||||
#--------------------------------------------------
|
||||
# Untaint parameters and check for validity
|
||||
#--------------------------------------------------
|
||||
my $timezone = $c->param('Timezone');
|
||||
|
||||
if ($timezone =~ /^([\w\-]+\/?[\w\-+]*)$/) {
|
||||
$timezone = $1;
|
||||
} else {
|
||||
$timezone = "US/Eastern";
|
||||
}
|
||||
my $month = $c->param('month');
|
||||
my $day = $c->param('day');
|
||||
my $year = $c->param('year');
|
||||
if (!is_valid_date($year, $month, $day)){
|
||||
return $c->l('dat_Invalid_date')
|
||||
}
|
||||
|
||||
my $hour = $c->param('hour');
|
||||
|
||||
if ($hour =~ /^(\d{1,2})$/) {
|
||||
$hour = $1;
|
||||
} else {
|
||||
$hour = "12";
|
||||
}
|
||||
|
||||
if (($hour < 1) || ($hour > 23)) {
|
||||
return $c->l('dat_INVALID_HOUR') . " $hour. " . $c->l('dat_BETWEEN_0_AND_23');
|
||||
}
|
||||
my $minute = $c->param('minute');
|
||||
|
||||
if ($minute =~ /^(\d{1,2})$/) {
|
||||
$minute = $1;
|
||||
} else {
|
||||
$minute = "0";
|
||||
}
|
||||
|
||||
if (($minute < 0) || ($minute > 59)) {
|
||||
return $c->l('dat_INVALID_MINUTE') . " $minute. " . $c->l('dat_BETWEEN_0_AND_59');
|
||||
}
|
||||
my $second = $c->param('second');
|
||||
|
||||
if ($second =~ /^(\d{1,2})$/) {
|
||||
$second = $1;
|
||||
} else {
|
||||
$second = "0";
|
||||
}
|
||||
|
||||
if (($second < 0) || ($second > 59)) {
|
||||
return $c->l('dat_INVALID_SECOND') . " $second. " . $c->l('dat_BETWEEN_0_AND_59');
|
||||
}
|
||||
|
||||
#--------------------------------------------------
|
||||
# Store time zone in configuration database
|
||||
#--------------------------------------------------
|
||||
my $old = $cdb->get('UnsavedChanges')->value;
|
||||
my $rec = $cdb->get('TimeZone');
|
||||
|
||||
unless ($rec) {
|
||||
$rec = $cdb->new_record('TimeZone', undef);
|
||||
}
|
||||
$rec->set_value($timezone);
|
||||
$cdb->get('UnsavedChanges')->set_value($old);
|
||||
|
||||
#--------------------------------------------------
|
||||
# Signal event to change time zone, system time
|
||||
# and hardware clock
|
||||
#--------------------------------------------------
|
||||
my $newdate = sprintf "%02d%02d%02d%02d%04d.%02d", $month, $day, $hour, $minute, $year, $second;
|
||||
$c->app->log->info("Changing date manually to $newdate");
|
||||
esmith::util::backgroundCommand(2, "/sbin/e-smith/signal-event", "timezone-update", $newdate); #TEMP!!!
|
||||
return '';
|
||||
} ## end sub validate_change_datetime
|
||||
|
||||
sub is_valid_date {
|
||||
my ($year, $month, $day) = @_;
|
||||
|
||||
# Check if all parts are defined and integers
|
||||
return 0 unless defined $year && defined $month && defined $day;
|
||||
return 0 unless $year =~ /^\d+$/ && $month =~ /^\d+$/ && $day =~ /^\d+$/;
|
||||
|
||||
# Try to construct a DateTime object
|
||||
eval {
|
||||
DateTime->new(year => $year, month => $month, day => $day);
|
||||
1;
|
||||
} or return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
sub update_ntpserver {
|
||||
my $c = shift;
|
||||
my $ntpserver = shift;
|
||||
my $msg = '';
|
||||
$cdb = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
|
||||
|
||||
#------------------------------------------------------------
|
||||
# Looks good; go ahead and change the parameters.
|
||||
#------------------------------------------------------------
|
||||
my $old = $cdb->get('UnsavedChanges')->value;
|
||||
my $rec = $cdb->get('ntpd');
|
||||
|
||||
if ($rec) {
|
||||
$rec->set_prop('status', 'enabled');
|
||||
$rec->set_prop('NTPServer', $ntpserver);
|
||||
} else {
|
||||
$rec = $cdb->new_record('ntpd',
|
||||
{ type => 'service', status => 'enabled', SyncToHWClockSupported => 'yes', NTPServer => $ntpserver });
|
||||
}
|
||||
$cdb->get('UnsavedChanges')->set_value($old);
|
||||
$msg = ''; #$c->l('dat_SETTINGS_CHANGED');
|
||||
|
||||
if ($ntpserver =~ /^\s*$/) {
|
||||
$rec->set_prop('status', ($rec->prop('SyncToHWClockSupported') || 'yes') eq 'yes' ? 'enabled' : 'disabled');
|
||||
$rec->set_prop('NTPServer', '');
|
||||
$msg = $c->l('dat_INVALID_NTP_SERVER') if ($rec->prop('SyncToHWClockSupported') || 'yes') ne 'yes';
|
||||
} ## end if ($ntpserver =~ /^\s*$/)
|
||||
esmith::util::backgroundCommand(2, "/sbin/e-smith/signal-event", "timeserver-update");
|
||||
return $msg;
|
||||
} ## end sub update_ntpserver
|
||||
|
||||
sub disable_ntp {
|
||||
|
||||
# make sure that the parameters are set for disabled
|
||||
my $old = $cdb->get('UnsavedChanges')->value;
|
||||
$cdb = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
|
||||
my $rec = $cdb->get('ntpd');
|
||||
|
||||
if ($rec) {
|
||||
$rec->set_prop('status', ($rec->prop('SyncToHWClockSupported') || 'yes') eq 'yes' ? 'enabled' : 'disabled');
|
||||
$rec->set_prop('NTPServer', '');
|
||||
} else {
|
||||
$rec = $cdb->new_record('ntpd',
|
||||
{ type => 'service', status => 'enabled', SyncToHWClockSupported => 'yes', NTPServer => '' });
|
||||
}
|
||||
$cdb->get('UnsavedChanges')->set_value($old);
|
||||
return '';
|
||||
} ## end sub disable_ntp
|
||||
|
||||
1;
|
@@ -1,375 +1,333 @@
|
||||
package SrvMngr::Controller::Datetime;
|
||||
|
||||
#
|
||||
# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-15 12:45:47
|
||||
# Remember that each route must be unique (else they just overwrite each other).
|
||||
# you cannot have get and post on the same name and url.
|
||||
#
|
||||
#----------------------------------------------------------------------
|
||||
# heading : System
|
||||
# description : Date and time
|
||||
# navigation : 4000 300
|
||||
#
|
||||
# ######name : datetimet, method : post, url : /datetimet, ctlact : datetime#testntp
|
||||
#
|
||||
# routes : end
|
||||
#------------------------------
|
||||
#
|
||||
# Documentation: https://wiki.contribs.org/Datetime
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
#
|
||||
# Scheme of things:
|
||||
#
|
||||
# TBA!!
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Mojo::Base 'Mojolicious::Controller';
|
||||
|
||||
use constant FALSE => 0;
|
||||
use constant TRUE => 1;
|
||||
|
||||
use Locale::gettext;
|
||||
use SrvMngr::I18N;
|
||||
use SrvMngr qw(theme_list init_session);
|
||||
|
||||
use Data::Dumper;
|
||||
|
||||
use esmith::util;
|
||||
use SrvMngr qw( gen_locale_date_string );
|
||||
use esmith::util::network;
|
||||
use esmith::ConfigDB::UTF8;
|
||||
our $cdb ;
|
||||
use esmith::AccountsDB;
|
||||
use esmith::NetworksDB;
|
||||
use esmith::HostsDB::UTF8;
|
||||
use esmith::DomainsDB::UTF8;
|
||||
|
||||
my $cdb;
|
||||
my $adb;
|
||||
my $ndb;
|
||||
my $hdb;
|
||||
my $ddb;
|
||||
|
||||
my %dat_data;
|
||||
|
||||
require '/usr/share/smanager/lib/SrvMngr/Controller/Datetime-Custom.pm'; #The code that is to be added by the developer
|
||||
|
||||
sub main {
|
||||
#
|
||||
# Initial entry - route is "/<whatever>"
|
||||
#
|
||||
#set initial panel
|
||||
#for initial panel:
|
||||
#Specifiy panel to enter
|
||||
#load up _data hash with DB fields
|
||||
#load up stash with pointer(s) to control fields hash(= get-))
|
||||
#and a pointer to the prefix_data hash
|
||||
#render initial panel
|
||||
|
||||
my $c = shift;
|
||||
$c->app->log->info( $c->log_req );
|
||||
|
||||
#The most common ones - you might want to delete some of these if they are not used.
|
||||
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
|
||||
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
|
||||
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
|
||||
$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
|
||||
$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
|
||||
|
||||
%dat_data = ();
|
||||
my $title = $c->l('dat_FORM_TITLE');
|
||||
my $modul = $c->l('dat_INITIAL_DESC');
|
||||
|
||||
$dat_data{'trt'} = 'PARAMS';
|
||||
|
||||
#Load any DB entries into the <prefix>_data area so as they are preset in the form
|
||||
# which DB - this only really works if the initial panel is a PARAMS type panel and not a TABLE
|
||||
my $db = $cdb; #pickup local or global db or Default to config
|
||||
|
||||
|
||||
$c->do_display($dat_data{'trt'});
|
||||
|
||||
}
|
||||
|
||||
# Post request with params - submit from the form
|
||||
sub do_update {
|
||||
#
|
||||
# Return after submit pushed on panel (this is a post) - route is "/<whatever>u"
|
||||
# parameters in the params hash.
|
||||
#
|
||||
#load up all params into prefix_data hash:
|
||||
#By panel (series of if statements - only one executed):
|
||||
#call validate-PANEL() - return ret = ok or error message
|
||||
|
||||
#if validation not ok:
|
||||
#render back to current panel with error message in stash
|
||||
#otherwise:
|
||||
#By panel (series of if statements - only one executed):
|
||||
#do whatever is required: call perform-PANEL() - return 'ok' or Error Message
|
||||
#call signal-event for any global actions specified (check it exists - error and continue?)
|
||||
#if action smeserver-<whatever>-update exists
|
||||
#signal_event smeserver-<whatever>-update
|
||||
#call signal-event for any specific actions for thids panel (check it exists first - error and continue)
|
||||
#set success in stash
|
||||
#if no "nextpanel" entry:
|
||||
#set firstpanel
|
||||
#else
|
||||
#set nextpanel
|
||||
#call render
|
||||
|
||||
my $c = shift;
|
||||
$c->app->log->info($c->log_req);
|
||||
my %dat_datas = ();
|
||||
|
||||
#$c->app->log->info($c->param('month'));
|
||||
|
||||
|
||||
#The most common ones - you might want to delete some of these if they are not used.
|
||||
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
|
||||
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
|
||||
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
|
||||
$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
|
||||
$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
|
||||
|
||||
my $title = $c->l('dat_FORM_TITLE');
|
||||
my $modul = $c->l('dat_INITIAL_DESC');
|
||||
$dat_datas{ntpstatus} = 'disabled';
|
||||
$cdb = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
|
||||
my $rec = $cdb->get('ntpd');
|
||||
|
||||
if ($rec) {
|
||||
$dat_datas{'ntpserver'} = $rec->prop('NTPServer') || '';
|
||||
# Accessing all POST/GET parameters
|
||||
#my $params = $c->req->params->to_hash;
|
||||
|
||||
if ($rec->prop('status') eq 'enabled') {
|
||||
$dat_datas{ntpstatus} = 'enabled'
|
||||
unless ($rec->prop('SyncToHWClockSupported') || 'yes') eq 'yes' and $dat_datas{ntpserver} =~ m#^\s*$#;
|
||||
}
|
||||
} ## end if ($rec)
|
||||
( $dat_datas{weekday}, $dat_datas{monthname}, $dat_datas{month}, $dat_datas{day}, $dat_datas{year},
|
||||
$dat_datas{hour}, $dat_datas{minute}, $dat_datas{second}, $dat_datas{ampm}
|
||||
)
|
||||
= split /\|/,
|
||||
`/bin/date '+%A|%B|%-m|%-d|%Y|%-I|%M|%S|%p'`;
|
||||
# Get number of POST parameters
|
||||
#my $num_params = keys scaler %$params;
|
||||
|
||||
#Params are available in the hash "params" - copy to the prefix_data hash
|
||||
#while (my ($key, $value) = each %{$c->req->params->to_hash}) {
|
||||
# $dat_data{$key} = $value;
|
||||
#}
|
||||
|
||||
# get rid of trailing carriage return on last field
|
||||
chop($dat_datas{ampm});
|
||||
$dat_datas{'now_string'} = gen_locale_date_string;
|
||||
$c->stash(title => $title, modul => $modul, dat_datas => \%dat_datas);
|
||||
$c->render('datetime');
|
||||
} ## end sub main
|
||||
# the value of trt will tell you which panel has returned
|
||||
my $trt = $c->param('trt') || 'PARAMS'; #hidden control on every form.
|
||||
my $ret = 'ok';
|
||||
|
||||
sub do_update {
|
||||
my $c = shift;
|
||||
my %dat_datas = ();
|
||||
#Validate the parameters in a custom sub one for each panel (although only one of these will be executed)
|
||||
my $thispanel;
|
||||
|
||||
if ($trt eq 'PARAMS'){
|
||||
#Validate form parameters for panel PARAMS
|
||||
$ret = $c->validate_PARAMS(\%dat_data);
|
||||
$thispanel = 'PARAMS';
|
||||
}
|
||||
|
||||
if ($ret ne 'ok'){
|
||||
$c->stash(error => $c->l($ret));
|
||||
$c->do_display($thispanel);
|
||||
} else {
|
||||
#Do whatever is needed, including writing values to the DB
|
||||
|
||||
|
||||
if ($trt eq 'PARAMS'){
|
||||
#do whatever is required ...
|
||||
$ret = $c->perform_PARAMS(\%dat_data);
|
||||
if ($ret ne 'ok') {
|
||||
# return to the panel with error message
|
||||
$c->stash(error => $c->l($ret));
|
||||
$c->stash(
|
||||
title => $title,
|
||||
modul => $modul,
|
||||
dat_data => \%dat_data
|
||||
);
|
||||
$c->render(template => "datetime");
|
||||
return
|
||||
} else {
|
||||
if ($c->param('time_mode') eq 'dat_manually_set') {
|
||||
$c->stash( success => $c->l('dat_UPDATING_CLOCK'));
|
||||
} else {
|
||||
$c->stash( success => $c->l('dat_SETTINGS_CHANGED'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# and call any signal-events needed
|
||||
#TBD
|
||||
# Setup shared data and call panel
|
||||
if ('none' eq 'none') {
|
||||
$dat_data{'trt'} = 'PARAMS';
|
||||
} else {
|
||||
$dat_data{'trt'} = 'none';
|
||||
}
|
||||
$c->do_display($dat_data{'trt'});
|
||||
}
|
||||
}
|
||||
|
||||
sub do_display {
|
||||
#
|
||||
# Return after link clicked in table (this is a get) - route is "/<whatever>d"
|
||||
# Expects ?trt=PANEL&selected="TableRowName" plus any other required
|
||||
#
|
||||
# OR it maybe a post from the main panel to add a new record
|
||||
#
|
||||
#load up all supplied params into prefix_data hash
|
||||
#call get-selected-PANEL() - returns hash of all relevent parameters
|
||||
#load up returned hash into prefix_data
|
||||
#render - to called panel
|
||||
|
||||
my ($c,$trt) = @_;
|
||||
$c->app->log->info($c->log_req);
|
||||
|
||||
#The most common ones - you might want to delete some of these if they are not used.
|
||||
$cdb = esmith::ConfigDB::UTF8->open() || die("Couldn't open config db");
|
||||
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
|
||||
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
|
||||
$hdb = esmith::HostsDB::UTF8->open() || die("Couldn't open Hosts db");
|
||||
$ddb = esmith::DomainsDB::UTF8->open() || die("Couldn't open Domains db");
|
||||
|
||||
my $title = $c->l('dat_FORM_TITLE');
|
||||
my $modul = $c->l('dat_INITIAL_DESC');
|
||||
my $result;
|
||||
my $success;
|
||||
my $old_ntpstatus = $c->param('Old_ntpstatus');
|
||||
$cdb = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
|
||||
$dat_datas{ntpstatus} = $c->param('Ntpstatus');
|
||||
|
||||
if ($dat_datas{ntpstatus} ne $old_ntpstatus) {
|
||||
if ($dat_datas{ntpstatus} eq 'disabled') {
|
||||
( $dat_datas{weekday}, $dat_datas{monthname}, $dat_datas{month},
|
||||
$dat_datas{day}, $dat_datas{year}, $dat_datas{hour},
|
||||
$dat_datas{minute}, $dat_datas{second}, $dat_datas{ampm}
|
||||
)
|
||||
= split /\|/,
|
||||
`/bin/date '+%A|%B|%-m|%-d|%Y|%-I|%M|%S|%p'`;
|
||||
# Accessing all parameters
|
||||
#my $params = $c->req->params->to_hash;
|
||||
|
||||
# get rid of trailing carriage return on last field
|
||||
chop($dat_datas{ampm});
|
||||
} else {
|
||||
$dat_datas{ntpserver} = ($cdb->get_prop('ntpd', 'NTPServer')) || '';
|
||||
}
|
||||
$dat_datas{now_string} = gen_locale_date_string();
|
||||
$c->stash(title => $title, modul => $modul, dat_datas => \%dat_datas);
|
||||
return $c->render('datetime');
|
||||
} ## end if ($dat_datas{ntpstatus...})
|
||||
# Get number of parameters
|
||||
#my $num_params = keys %$params;
|
||||
|
||||
#Tag as Post or Get (ie. create new entry or edit existing one
|
||||
my $is_new_record = ($c->req->method() eq 'POST');
|
||||
|
||||
#Params are available in the hash "params" - copy to the prefix_data hash
|
||||
#while (my ($key, $value) = each %{$c->req->params->to_hash}) {
|
||||
# $dat_data{$key} = $value;
|
||||
#}
|
||||
|
||||
if ($dat_datas{ntpstatus} eq 'enabled') {
|
||||
# the value of trt will tell you which panel has returned
|
||||
if (! $trt){
|
||||
$trt = $c->param('trt') || 'PARAMS'; #Indicates where to go now
|
||||
}
|
||||
|
||||
# Now add in the params from the selected row from the table
|
||||
|
||||
my %selectedrow;
|
||||
|
||||
if ($trt eq 'PARAMS'){
|
||||
#Validate Get selected row (if applicable) PARAMS
|
||||
%selectedrow = $c->get_selected_PARAMS($dat_data{'Selected'},$is_new_record);
|
||||
}
|
||||
|
||||
|
||||
#Copy in the selected row params to the prefix_data hash to pass to the panel
|
||||
while (my ($key, $value) = each %selectedrow){
|
||||
$dat_data{$key} = $value;
|
||||
}
|
||||
# Where to go now
|
||||
$dat_data{'trt'} = $trt;
|
||||
|
||||
# Set up other shared data according to the panel to go to
|
||||
|
||||
if ($trt eq 'PARAMS'){
|
||||
# pickup any other contents needed and load them into hash shared with panel
|
||||
my %returned_hash;
|
||||
# subroutine returns a hash directly
|
||||
%returned_hash = $c->get_data_for_panel_PARAMS();
|
||||
# Copy each key-value pair from the returned hash to the prefix data hash
|
||||
while (my ($key, $value) = each %returned_hash) {
|
||||
$dat_data{$key} = $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# and table control fields
|
||||
|
||||
|
||||
# Data for panel
|
||||
$c->stash(
|
||||
title => $title,
|
||||
modul => $modul,
|
||||
dat_data => \%dat_data
|
||||
);
|
||||
$c->render(template => "datetime");
|
||||
}
|
||||
|
||||
# update ntpserver
|
||||
$dat_datas{ntpserver} = $c->param('Ntpserver') || '';
|
||||
|
||||
if ($dat_datas{ntpserver} eq "pool.ntp.org") {
|
||||
$result .= $c->l('dat_INVALID_NTP_ADDR');
|
||||
} elsif ($dat_datas{ntpserver} =~ /^([a-zA-Z0-9\.\-]+)$/) {
|
||||
$dat_datas{ntpserver} = $1;
|
||||
|
||||
# } elsif ( $dat_datas{ntpserver} =~ /^\s*$/ ) {
|
||||
# $dat_datas{ntpserver} = "";
|
||||
} else {
|
||||
$result .= $c->l('dat_INVALID_NTP_ADDR');
|
||||
}
|
||||
|
||||
if (!$result) {
|
||||
$success = update_ntpserver($c, $dat_datas{ntpserver});
|
||||
}
|
||||
} else {
|
||||
|
||||
# set Locale time & clean ntpserver
|
||||
#my $servername = ($c->param('ServerName') || 'WS');
|
||||
if (!$result) {
|
||||
$result = validate_change_datetime($c);
|
||||
|
||||
if ($result eq 'OK') {
|
||||
$success = $c->l('dat_UPDATING_CLOCK');
|
||||
$result = '';
|
||||
disable_ntp();
|
||||
$success .= '<br>' . $c->l('dat_SERVER_DISABLED_DESC');
|
||||
} ## end if ($result eq 'OK')
|
||||
} ## end if (!$result)
|
||||
} ## end else [ if ($dat_datas{ntpstatus...})]
|
||||
|
||||
if ($result) {
|
||||
$c->stash(error => $result);
|
||||
$c->stash(title => $title, modul => $modul, dat_datas => \%dat_datas);
|
||||
return $c->render('datetime');
|
||||
} ## end if ($result)
|
||||
|
||||
#$result = $c->l('dat_SUCCESS');
|
||||
my $message = "'Datetime' update DONE";
|
||||
$c->app->log->info($message);
|
||||
$c->flash(success => $success);
|
||||
$c->redirect_to('/datetime');
|
||||
} ## end sub do_update
|
||||
|
||||
sub validate_change_datetime {
|
||||
sub do_testntp {
|
||||
my $c = shift;
|
||||
$cdb = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
|
||||
my $server = $c->req->json->{ntpserver} // '';
|
||||
|
||||
#--------------------------------------------------
|
||||
# Untaint parameters and check for validity
|
||||
#--------------------------------------------------
|
||||
my $timezone = $c->param('Timezone');
|
||||
|
||||
if ($timezone =~ /^([\w\-]+\/?[\w\-+]*)$/) {
|
||||
$timezone = $1;
|
||||
} else {
|
||||
$timezone = "US/Eastern";
|
||||
}
|
||||
my $month = $c->param('Month');
|
||||
|
||||
if ($month =~ /^(\d{1,2})$/) {
|
||||
$month = $1;
|
||||
} else {
|
||||
$month = "1";
|
||||
# Strict validation: hostname or IPv4
|
||||
unless ($server =~ /^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9\-]{0,61}[a-zA-Z0-9])?)*|\d{1,3}(?:\.\d{1,3}){3})$/) {
|
||||
return $c->render(json => { success => 0, error => 'Invalid server name or IP' });
|
||||
}
|
||||
|
||||
if (($month < 1) || ($month > 12)) {
|
||||
return $c->l('dat_INVALID_MONTH') . " $month. " . $c->l('dat_MONTH_BETWEEN_1_AND_12');
|
||||
}
|
||||
my $day = $c->param('Day');
|
||||
my $timeout = 5;
|
||||
my @cmd = ('timeout', $timeout, 'ntpdate', '-q', $server);
|
||||
|
||||
if ($day =~ /^(\d{1,2})$/) {
|
||||
$day = $1;
|
||||
} else {
|
||||
$day = "1";
|
||||
# Run ntpdate and capture output
|
||||
my $output = qx{@cmd 2>&1};
|
||||
$c->app->log->info($output);
|
||||
my $exit_code = $? >> 8;
|
||||
|
||||
# Parse for known errors
|
||||
if ($exit_code == 124) {
|
||||
return $c->render(json => { success => 0, error => "Timeout: NTP server did not respond within $timeout seconds" });
|
||||
}
|
||||
if ($output =~ /no server suitable for synchronization found/i) {
|
||||
return $c->render(json => { success => 0, error => "No suitable NTP server found or server unreachable" });
|
||||
}
|
||||
if ($output =~ /Name or service not known|Temporary failure in name resolution/i) {
|
||||
return $c->render(json => { success => 0, error => "DNS resolution failed for $server" });
|
||||
}
|
||||
if ($output =~ /ntpdig: no eligible servers/i) {
|
||||
return $c->render(json => { success => 0, error => "Not a an NTP server" });
|
||||
}
|
||||
if ($output =~ /permission denied/i) {
|
||||
return $c->render(json => { success => 0, error => "Permission denied running ntpdate" });
|
||||
}
|
||||
if ($exit_code != 0) {
|
||||
return $c->render(json => { success => 0, error => "ntpdate failed (exit code $exit_code): $output" });
|
||||
}
|
||||
|
||||
if (($day < 1) || ($day > 31)) {
|
||||
return $c->l('dat_INVALID_DAY') . " $day. " . $c->l('dat_BETWEEN_1_AND_31');
|
||||
}
|
||||
my $year = $c->param('Year');
|
||||
# Extract date and time down to seconds from adjust line
|
||||
my ($datetime) = $output =~ /^(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})/m;
|
||||
|
||||
if ($year =~ /^(\d{4})$/) {
|
||||
$year = $1;
|
||||
} else {
|
||||
$year = "2000";
|
||||
}
|
||||
if ($datetime) {
|
||||
return $c->render(json => { success => 1, time => $datetime });
|
||||
} else {
|
||||
return $c->render(json => { success => 0, error => "Could not parse date/time from NTP server response." });}
|
||||
}
|
||||
|
||||
if (($year < 1900) || ($year > 2200)) {
|
||||
return $c->l('dat_INVALID_YEAR') . " $year. " . $c->l('dat_FOUR_DIGIT_YEAR');
|
||||
}
|
||||
my $hour = $c->param('Hour');
|
||||
|
||||
if ($hour =~ /^(\d{1,2})$/) {
|
||||
$hour = $1;
|
||||
} else {
|
||||
$hour = "12";
|
||||
}
|
||||
|
||||
if (($hour < 1) || ($hour > 12)) {
|
||||
return $c->l('dat_INVALID_HOUR') . " $hour. " . $c->l('dat_BETWEEN_1_AND_12');
|
||||
}
|
||||
my $minute = $c->param('Minute');
|
||||
|
||||
if ($minute =~ /^(\d{1,2})$/) {
|
||||
$minute = $1;
|
||||
} else {
|
||||
$minute = "0";
|
||||
}
|
||||
|
||||
if (($minute < 0) || ($minute > 59)) {
|
||||
return $c->l('datINVALID_MINUTE') . " $minute. " . $c->l('dat_BETWEEN_0_AND_59');
|
||||
}
|
||||
my $second = $c->param('Second');
|
||||
|
||||
if ($second =~ /^(\d{1,2})$/) {
|
||||
$second = $1;
|
||||
} else {
|
||||
$second = "0";
|
||||
}
|
||||
|
||||
if (($second < 0) || ($second > 59)) {
|
||||
return $c->l('dat_INVALID_SECOND') . " $second. " . $c->l('dat_BETWEEN_0_AND_59');
|
||||
}
|
||||
my $ampm = $c->param('Ampm');
|
||||
|
||||
if ($ampm =~ /^(AM|PM)$/) {
|
||||
$ampm = $1;
|
||||
} else {
|
||||
$ampm = "AM";
|
||||
}
|
||||
|
||||
# convert to 24 hour time
|
||||
$hour = $hour % 12;
|
||||
|
||||
if ($ampm eq "PM") {
|
||||
$hour = $hour + 12;
|
||||
}
|
||||
|
||||
#--------------------------------------------------
|
||||
# Store time zone in configuration database
|
||||
#--------------------------------------------------
|
||||
my $old = $cdb->get('UnsavedChanges')->value;
|
||||
my $rec = $cdb->get('TimeZone');
|
||||
|
||||
unless ($rec) {
|
||||
$rec = $cdb->new_record('TimeZone', undef);
|
||||
}
|
||||
$rec->set_value($timezone);
|
||||
$cdb->get('UnsavedChanges')->set_value($old);
|
||||
|
||||
#--------------------------------------------------
|
||||
# Signal event to change time zone, system time
|
||||
# and hardware clock
|
||||
#--------------------------------------------------
|
||||
my $newdate = sprintf "%02d%02d%02d%02d%04d.%02d", $month, $day, $hour, $minute, $year, $second;
|
||||
esmith::util::backgroundCommand(2, "/sbin/e-smith/signal-event", "timezone-update", $newdate);
|
||||
return 'OK';
|
||||
} ## end sub validate_change_datetime
|
||||
|
||||
sub update_ntpserver {
|
||||
my $c = shift;
|
||||
my $ntpserver = shift;
|
||||
my $msg;
|
||||
|
||||
#------------------------------------------------------------
|
||||
# Looks good; go ahead and change the parameters.
|
||||
#------------------------------------------------------------
|
||||
my $old = $cdb->get('UnsavedChanges')->value;
|
||||
my $rec = $cdb->get('ntpd');
|
||||
|
||||
if ($rec) {
|
||||
$rec->set_prop('status', 'enabled');
|
||||
$rec->set_prop('NTPServer', $ntpserver);
|
||||
} else {
|
||||
$rec = $cdb->new_record('ntpd',
|
||||
{ type => 'service', status => 'enabled', SyncToHWClockSupported => 'yes', NTPServer => $ntpserver });
|
||||
}
|
||||
$cdb->get('UnsavedChanges')->set_value($old);
|
||||
$msg = $c->l('dat_SETTINGS_CHANGED');
|
||||
|
||||
if ($ntpserver =~ /^\s*$/) {
|
||||
$rec->set_prop('status', ($rec->prop('SyncToHWClockSupported') || 'yes') eq 'yes' ? 'enabled' : 'disabled');
|
||||
$rec->set_prop('NTPServer', '');
|
||||
$msg = $c->l('dat_INVALID_NTP_SERVER') if ($rec->prop('SyncToHWClockSupported') || 'yes') ne 'yes';
|
||||
} ## end if ($ntpserver =~ /^\s*$/)
|
||||
esmith::util::backgroundCommand(2, "/sbin/e-smith/signal-event", "timeserver-update");
|
||||
return $msg;
|
||||
} ## end sub update_ntpserver
|
||||
|
||||
sub disable_ntp {
|
||||
|
||||
# make sure that the parameters are set for disabled
|
||||
my $old = $cdb->get('UnsavedChanges')->value;
|
||||
my $rec = $cdb->get('ntpd');
|
||||
|
||||
if ($rec) {
|
||||
$rec->set_prop('status', ($rec->prop('SyncToHWClockSupported') || 'yes') eq 'yes' ? 'enabled' : 'disabled');
|
||||
$rec->set_prop('NTPServer', '');
|
||||
} else {
|
||||
$rec = $cdb->new_record('ntpd',
|
||||
{ type => 'service', status => 'enabled', SyncToHWClockSupported => 'yes', NTPServer => '' });
|
||||
}
|
||||
$cdb->get('UnsavedChanges')->set_value($old);
|
||||
} ## end sub disable_ntp
|
||||
|
||||
sub getTimezone {
|
||||
|
||||
#--------------------------------------------------
|
||||
# Figure out time zone by looking first looking at
|
||||
# the configuration database value of TimeZone.
|
||||
# If that is not defined, try and get it from /etc/localtime.
|
||||
# If that doesn't work, default to US/Eastern.
|
||||
#--------------------------------------------------
|
||||
my $localtime;
|
||||
my $timezonedefault = "US/Eastern";
|
||||
|
||||
if (defined $cdb->get('TimeZone')) {
|
||||
$timezonedefault = $cdb->get('TimeZone')->value;
|
||||
} else {
|
||||
|
||||
if (defined($localtime = readlink '/etc/localtime')) {
|
||||
my $pos = index $localtime, 'zoneinfo/';
|
||||
|
||||
if ($pos > -1) {
|
||||
$timezonedefault = substr $localtime, ($pos + 9);
|
||||
}
|
||||
} ## end if (defined($localtime...))
|
||||
} ## end else [ if (defined $cdb->get(...))]
|
||||
return $timezonedefault;
|
||||
} ## end sub getTimezone
|
||||
|
||||
sub getZone_list {
|
||||
my $c = shift;
|
||||
|
||||
#--------------------------------------------------
|
||||
# Get a sorted list of time zones
|
||||
#--------------------------------------------------
|
||||
$ENV{BASH_ENV} = '';
|
||||
|
||||
if (!open(ZONES, "cd /usr/share/zoneinfo; /usr/bin/find . -type f -or -type l | /bin/grep '^./[A-Z]' |")) {
|
||||
warn($c->l('COULD_NOT_OPEN_TZ_FILE') . $! . '.');
|
||||
return undef;
|
||||
}
|
||||
my $zone;
|
||||
my @zones = ();
|
||||
|
||||
while (defined($zone = <ZONES>)) {
|
||||
chop($zone);
|
||||
$zone =~ s/^.\///;
|
||||
push @zones, $zone;
|
||||
} ## end while (defined($zone = <ZONES>...))
|
||||
close ZONES;
|
||||
my @zt = sort @zones;
|
||||
return \@zt;
|
||||
} ## end sub getZone_list
|
||||
|
||||
sub getMonth_list {
|
||||
my $c = shift;
|
||||
return [
|
||||
[ $c->l('dat_JANUARY') => '1' ],
|
||||
[ $c->l('dat_FEBRUARY') => '2' ],
|
||||
[ $c->l('dat_MARCH') => '3' ],
|
||||
[ $c->l('dat_APRIL') => '4' ],
|
||||
[ $c->l('dat_MAY') => '5' ],
|
||||
[ $c->l('dat_JUNE') => '6' ],
|
||||
[ $c->l('dat_JULY') => '7' ],
|
||||
[ $c->l('dat_AUGUST') => '8' ],
|
||||
[ $c->l('dat_SEPTEMBER') => '9' ],
|
||||
[ $c->l('dat_OCTOBER') => '10' ],
|
||||
[ $c->l('dat_NOVEMBER') => '11' ],
|
||||
[ $c->l('dat_DECEMBER') => '12' ]
|
||||
];
|
||||
} ## end sub getMonth_list
|
||||
|
||||
sub getYear_list {
|
||||
my $c= shift;
|
||||
my @yearArray;
|
||||
# could use also `/bin/date '+%Y'`
|
||||
my $start=2025-40; my $max=2025+40;
|
||||
for ( my $i = $start; $i <= $max; $i++ ) {
|
||||
|
||||
push @yearArray,$i;
|
||||
}
|
||||
|
||||
my @yearList = sort @yearArray;
|
||||
return \@yearList;
|
||||
|
||||
} ## end sub getYear_list
|
||||
|
||||
1;
|
||||
1;
|
@@ -39,6 +39,7 @@ sub main {
|
||||
sub do_update {
|
||||
my $c = shift;
|
||||
$c->app->log->info($c->log_req);
|
||||
$db = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
|
||||
my $access = $c->param('access');
|
||||
my $department = $c->param('department');
|
||||
my $company = $c->param('company');
|
||||
@@ -84,7 +85,7 @@ sub get_ldap_base {
|
||||
sub get_value {
|
||||
my $fm = shift;
|
||||
my $item = shift;
|
||||
|
||||
$db = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
|
||||
my $record = $db->get($item);
|
||||
if ($record) {
|
||||
return $record->value();
|
||||
@@ -93,4 +94,4 @@ sub get_value {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
1;
|
||||
1;
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -132,7 +132,7 @@ sub do_update {
|
||||
# Untaint groupName before use in system()
|
||||
($groupName) = ($groupName =~ /^([a-z][\-\_\.a-z0-9]*)$/);
|
||||
system("/sbin/e-smith/signal-event", "group-create", "$groupName") == 0
|
||||
or $result .= $c->l('qgp_CREATE_ERROR') . "\n";
|
||||
or $result .= $c->l('grp_CREATE_ERROR') . "\n";
|
||||
} ## end if (!$result)
|
||||
|
||||
if (!$result) {
|
||||
@@ -161,7 +161,7 @@ sub do_update {
|
||||
# Untaint groupName before use in system()
|
||||
($groupName) = ($groupName =~ /^([a-z][\-\_\.a-z0-9]*)$/);
|
||||
system("/sbin/e-smith/signal-event", "group-modify", "$groupName") == 0
|
||||
or $result .= $c->l('qgp_MODIFY_ERROR') . "\n";
|
||||
or $result .= $c->l('grp_MODIFY_ERROR') . "\n";
|
||||
} ## end if (!$result)
|
||||
|
||||
if (!$result) {
|
||||
@@ -414,4 +414,4 @@ sub validate_description {
|
||||
return ($c->l('FM_ERR_UNEXPECTED_DESC'));
|
||||
}
|
||||
} ## end sub validate_description
|
||||
1
|
||||
1
|
@@ -5,6 +5,12 @@ package SrvMngr::Controller::Localnetworks;
|
||||
# description : Local networks
|
||||
# navigation : 6000 500
|
||||
#
|
||||
#$if_admin->get('/localnetworks')->to('localnetworks#main')->name('localnetworks');
|
||||
#$if_admin->post('/localnetworks')->to('localnetworks#do_display')->name('localnetworks');
|
||||
#$if_admin->post('/localnetworksa')->to('localnetworks#do_display')->name('localnetworksadd');
|
||||
#$if_admin->post('/localnetworksb')->to('localnetworks#do_display')->name('localnetworksadd1');
|
||||
#$if_admin->get('/localnetworksd')->to('localnetworks#do_display')->name('localnetworksdel');
|
||||
#$if_admin->post('/localnetworkse')->to('localnetworks#do_display')->name('localnetworksdel1');
|
||||
# routes : end
|
||||
#----------------------------------------------------------------------
|
||||
use strict;
|
||||
@@ -53,6 +59,7 @@ sub do_display {
|
||||
$trt = 'ADD' if ($rt eq 'localnetworksadd');
|
||||
$trt = 'ADD1' if ($rt eq 'localnetworksadd1');
|
||||
$trt = 'DEL1' if ($rt eq 'localnetworksdel1');
|
||||
$c->app->log->info("Localnetworks:trt:$trt");
|
||||
my %ln_datas = ();
|
||||
my $title = $c->l('ln_LOCAL NETWORKS');
|
||||
my $modul = '';
|
||||
@@ -73,7 +80,6 @@ sub do_display {
|
||||
if ((index($ret{ret}, "SUCCESS") != -1)) {
|
||||
$trt = "LIST";
|
||||
} else {
|
||||
|
||||
#Error - return to Add page
|
||||
$trt = "ADD";
|
||||
}
|
||||
@@ -84,16 +90,21 @@ sub do_display {
|
||||
if ($trt eq 'DEL1') {
|
||||
|
||||
#After Remove clicked on Delete network panel
|
||||
#$network_db = esmith::NetworksDB::UTF8->open() || die("Failed to open Networkdb-1");
|
||||
#$network_db = esmith::NetworksDB::UTF8->open() || die("Failed to open Networkdb-1");
|
||||
my $localnetwork = $c->param("localnetwork");
|
||||
my $delete_hosts = $c->param("deletehost") || "1"; #default to deleting them.
|
||||
my $rec = $network_db->get($localnetwork) || die("Failed to find network on db:$localnetwork");
|
||||
|
||||
if ($rec and $rec->prop('type') eq 'localnetwork') {
|
||||
$ln_datas{localnetwork} = $localnetwork;
|
||||
}
|
||||
my %ret = remove_network($localnetwork, $delete_hosts);
|
||||
#$network_db = esmith::NetworksDB::UTF8->open() || die("Failed to open Networkdb-2"); #Refresh the network DB
|
||||
my $delete_hosts = $c->param("deletehost") || "1"; #default to deleting them.
|
||||
$c->app->log->info("Localnetworks:deleting $localnetwork");
|
||||
my ($rec,%ret);
|
||||
if ($rec = $network_db->get($localnetwork)){ #|| die("Failed to find network on db:$localnetwork");
|
||||
if ($rec and $rec->prop('type') eq 'localnetwork') {
|
||||
$ln_datas{localnetwork} = $localnetwork;
|
||||
}
|
||||
%ret = $c->remove_network($localnetwork, $delete_hosts);
|
||||
} else {
|
||||
$c->app->log->info("Local network: delete failed to find network in db: $localnetwork");
|
||||
%ret = (ret => "");
|
||||
}
|
||||
#$network_db = esmith::NetworksDB::UTF8->open() || die("Failed to open Networkdb-2"); #Refresh the network DB
|
||||
my @localnetworks;
|
||||
|
||||
if ($network_db) {
|
||||
@@ -101,8 +112,10 @@ sub do_display {
|
||||
}
|
||||
|
||||
# Load up ln_datas with values need by template
|
||||
$ln_datas{subnet} = $rec->prop('Mask');
|
||||
$ln_datas{router} = $rec->prop('Router');
|
||||
if ($rec){
|
||||
$ln_datas{subnet} = $rec->prop('Mask');
|
||||
$ln_datas{router} = $rec->prop('Router');
|
||||
}
|
||||
$c->stash(ln_datas => \%ln_datas, localnetworks => \@localnetworks, ret => \%ret);
|
||||
} ## end if ($trt eq 'DEL1')
|
||||
|
||||
@@ -110,14 +123,20 @@ sub do_display {
|
||||
|
||||
#Initial delete panel requiring confirmation
|
||||
my $localnetwork = $c->param("localnetwork") || '';
|
||||
my ($rec,%ret);
|
||||
$c->stash(localnetwork => $localnetwork);
|
||||
my $rec = $network_db->get($localnetwork) || die("Failed to get local network in db::$localnetwork");
|
||||
my $subnet = $rec->prop('Mask');
|
||||
$ln_datas{subnet} = $subnet;
|
||||
$ln_datas{router} = $rec->prop('Router');
|
||||
my $numhosts = hosts_on_network($localnetwork, $subnet);
|
||||
$ln_datas{localnetwork} = $localnetwork;
|
||||
$ln_datas{deletehosts} = $numhosts > 0 ? 1 : 0;
|
||||
if ($rec = $network_db->get($localnetwork)){
|
||||
my $subnet = $rec->prop('Mask');
|
||||
$ln_datas{subnet} = $subnet;
|
||||
$ln_datas{router} = $rec->prop('Router');
|
||||
my $numhosts =$c->hosts_on_network($localnetwork, $subnet);
|
||||
$ln_datas{localnetwork} = $localnetwork;
|
||||
$ln_datas{deletehosts} = $numhosts > 0 ? 1 : 0;
|
||||
} else {
|
||||
$c->app->log->info("Local network:Initial Failed to find network in Db: $localnetwork");
|
||||
$c->flash('error',$c->l('ln_Failed to find network in Db'));
|
||||
$trt = 'LIST';
|
||||
}
|
||||
} ## end if ($trt eq 'DEL')
|
||||
|
||||
if ($trt eq 'LIST') {
|
||||
@@ -137,6 +156,7 @@ sub do_display {
|
||||
} ## end sub do_display
|
||||
|
||||
sub remove_network {
|
||||
my $c = shift;
|
||||
my $network = shift;
|
||||
$network_db = esmith::NetworksDB::UTF8->open();
|
||||
my $record = $network_db->get($network);
|
||||
@@ -153,7 +173,7 @@ sub remove_network {
|
||||
|
||||
if (system("/sbin/e-smith/signal-event", "network-delete", $network) == 0) {
|
||||
if ($delete_hosts) {
|
||||
my @hosts_to_delete = hosts_on_network($network, $subnet);
|
||||
my @hosts_to_delete = $c->hosts_on_network($network, $subnet);
|
||||
|
||||
foreach my $host (@hosts_to_delete) {
|
||||
$host->delete;
|
||||
@@ -170,6 +190,7 @@ sub remove_network {
|
||||
} ## end sub remove_network
|
||||
|
||||
sub hosts_on_network {
|
||||
my $c = shift;
|
||||
my $network = shift;
|
||||
my $netmask = shift;
|
||||
die if not $network and $netmask;
|
||||
@@ -192,17 +213,20 @@ sub hosts_on_network {
|
||||
} ## end sub hosts_on_network
|
||||
|
||||
sub add_network {
|
||||
my ($fm) = @_;
|
||||
my $networkAddress = $fm->param('networkAddress');
|
||||
my $networkMask = $fm->param('networkMask');
|
||||
my $networkRouter = $fm->param('networkRouter');
|
||||
my ($c) = @_;
|
||||
my $networkAddress = $c->param('networkAddress');
|
||||
my $networkMask = $c->param('networkMask');
|
||||
my $networkRouter = $c->param('networkRouter');
|
||||
|
||||
#Start by checking that the network does not already exist
|
||||
|
||||
|
||||
#Validate Ips and subnet mask
|
||||
my $res = ip_number($fm, $networkAddress);
|
||||
my $res = ip_number($c, $networkAddress);
|
||||
return (ret => 'ln_INVALID_IP_ADDRESS', vars => "Network Address $res") unless $res eq 'OK';
|
||||
$res = subnet_mask($networkMask);
|
||||
return (ret => 'ln_INVALID_SUBNET_MASK', vars => "$networkMask") unless $res eq 'OK';
|
||||
$res = ip_number($fm, $networkRouter);
|
||||
$res = ip_number($c, $networkRouter);
|
||||
return (ret => 'ln_INVALID_IP_ADDRESS', vars => "Routeur Address $res") unless $res eq 'OK';
|
||||
|
||||
# we transform bit mask to regular mask
|
||||
@@ -222,31 +246,38 @@ sub add_network {
|
||||
# in the form itself, but it just seemed too fiddly to do that
|
||||
# at the moment. -- Skud 2002-04-11
|
||||
# I agree --bjr 2020-04-18
|
||||
if ($routerNetwork ne $localNetwork) {
|
||||
return (ret => 'ln_NOT_ACCESSIBLE_FROM_LOCAL_NETWORK');
|
||||
}
|
||||
my ($network, $broadcast) = esmith::util::computeNetworkAndBroadcast($networkAddress, $networkMask);
|
||||
|
||||
if ($routerNetwork ne $localNetwork) {
|
||||
return (ret => 'ln_NOT_ACCESSIBLE_FROM_LOCAL_NETWORK', vars => "$network,$networkMask,$networkRouter");
|
||||
}
|
||||
|
||||
if ($network eq $localNetwork) {
|
||||
return (ret => 'ln_NETWORK_ALREADY_LOCAL');
|
||||
return (ret => 'ln_NETWORK_ALREADY_LOCAL', vars => "$network,$networkMask,$networkRouter");
|
||||
}
|
||||
|
||||
if ($network_db->get($network)) {
|
||||
return (ret => 'ln_NETWORK_ALREADY_ADDED');
|
||||
return (ret => 'ln_NETWORK_ALREADY_ADDED', vars => "$network,$networkMask,$networkRouter");
|
||||
}
|
||||
$network_db->new_record(
|
||||
$res = $network_db->new_record(
|
||||
$network,
|
||||
{ Mask => $networkMask,
|
||||
Router => $networkRouter,
|
||||
type => 'network',
|
||||
}
|
||||
);
|
||||
|
||||
# Untaint $network before use in system()
|
||||
$network =~ /(.+)/;
|
||||
$network = $1;
|
||||
system("/sbin/e-smith/signal-event", "network-create", $network) == 0
|
||||
or (return (ret => 'ln_ERROR_CREATING_NETWORK'));
|
||||
if (! $res) {
|
||||
#Record already existed
|
||||
$c->app->log->info("Local Network:Network already exists:$network");
|
||||
#return success message
|
||||
} else {
|
||||
#Only call underlying batch if new record created
|
||||
# Untaint $network before use in system()
|
||||
$network =~ /(.+)/;
|
||||
$network = $1;
|
||||
system("/sbin/e-smith/signal-event", "network-create", $network) == 0
|
||||
or (return (ret => 'ln_ERROR_CREATING_NETWORK', vars => "$network,$networkMask,$networkRouter"));
|
||||
}
|
||||
my ($totalHosts, $firstAddr, $lastAddr) = esmith::util::computeHostRange($network, $networkMask);
|
||||
my $msg;
|
||||
|
||||
|
@@ -43,6 +43,7 @@ sub do_update {
|
||||
my $http_proxy_status = $c->param('http_proxy_status') || 'disabled';
|
||||
my $smtp_proxy_status = $c->param('smtp_proxy_status') || '';
|
||||
my $result = "";
|
||||
$db = esmith::ConfigDB::UTF8->open || die "Couldn't open config db";
|
||||
my $squid = $db->get('squid') or $result = $c->l('prx_ERR_NO_SQUID_REC');
|
||||
|
||||
# smtpd is allowed to not exist, as the relevant packages may not be
|
||||
@@ -54,10 +55,10 @@ sub do_update {
|
||||
# Update the system
|
||||
#
|
||||
system("/sbin/e-smith/signal-event proxy-update") == 0
|
||||
or $result = $c->l('prx_ERR_PROXY_UPDATE_FAILED');
|
||||
or $result = $c->l('prx_ERR_PROXY_UPDATE_FAILED');
|
||||
my $title = $c->l('prx_TITLE');
|
||||
if ($result eq '') { $result = $c->l('prx_SUCCESS'); }
|
||||
$c->stash(title => $title, modul => $result);
|
||||
$c->render(template => 'module');
|
||||
} ## end sub do_update
|
||||
1;
|
||||
1;
|
@@ -176,7 +176,7 @@ sub do_update {
|
||||
$result .= $res unless $res eq 'OK';
|
||||
|
||||
if (!$result) {
|
||||
$result = $c->l('usrUSER_CREATED') . ' ' . $user;
|
||||
$result = $c->l('usr_USER_CREATED') . ' ' . $user;
|
||||
$usr_datas{trt} = 'SUC';
|
||||
}
|
||||
} ## end if (!$result)
|
||||
@@ -361,7 +361,7 @@ sub lock_account {
|
||||
$adb = esmith::AccountsDB::UTF8->open();
|
||||
return 'OK';
|
||||
} else {
|
||||
return $c->l('NO_SUCH_USER', $user);
|
||||
return $c->l('usr_NO_SUCH_USER', $user);
|
||||
}
|
||||
} ## end sub lock_account
|
||||
|
||||
@@ -380,13 +380,13 @@ sub remove_account {
|
||||
|
||||
if (system("/sbin/e-smith/signal-event", "user-delete", $user)) {
|
||||
$adb = esmith::AccountsDB::UTF8->open();
|
||||
return $c->l("ERR_OCCURRED_DELETING");
|
||||
return $c->l("usr_ERR_OCCURRED_DELETING");
|
||||
}
|
||||
$adb = esmith::AccountsDB::UTF8->open();
|
||||
$adb->get($user)->delete;
|
||||
return 'OK';
|
||||
} else {
|
||||
return $c->l('NO_SUCH_USER', $user);
|
||||
return $c->l('usr_NO_SUCH_USER', $user);
|
||||
}
|
||||
} ## end sub remove_account
|
||||
|
||||
@@ -413,7 +413,7 @@ sub reset_password {
|
||||
$adb = esmith::AccountsDB::UTF8->open();
|
||||
return 'OK';
|
||||
} else {
|
||||
return $c->l('NO_SUCH_USER', $user);
|
||||
return $c->l('usr_NO_SUCH_USER', $user);
|
||||
}
|
||||
} ## end sub reset_password
|
||||
|
||||
@@ -788,7 +788,7 @@ sub system_change_password {
|
||||
if ($result == 0) {
|
||||
return 'OK';
|
||||
} 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
|
||||
1
|
||||
1
|
@@ -21,6 +21,7 @@ use SrvMngr qw( theme_list init_session validate_password );
|
||||
sub main {
|
||||
my $c = shift;
|
||||
my %pwd_datas = ();
|
||||
my $title = $c->l("pwd_ACCOUNT_PASSWORD_CHANGE");
|
||||
|
||||
if ($c->is_logged_in) {
|
||||
$pwd_datas{Account} = $c->session->{username};
|
||||
@@ -34,7 +35,7 @@ sub main {
|
||||
|
||||
# request already treated or outdated
|
||||
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) {
|
||||
@@ -47,7 +48,7 @@ sub main {
|
||||
$pwd_datas{Account} = $name;
|
||||
$pwd_datas{trt} = 'RESET';
|
||||
$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) ]
|
||||
$c->stash(pwd_datas => \%pwd_datas);
|
||||
$c->render('userpassword');
|
||||
@@ -74,7 +75,7 @@ sub change_password {
|
||||
|
||||
# request already treated or outdated
|
||||
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) {
|
||||
@@ -158,7 +159,7 @@ sub change_password {
|
||||
sub reset_password {
|
||||
my ($c, $trt, $user, $password, $oldpassword) = @_;
|
||||
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;
|
||||
my $adb = esmith::AccountsDB::UTF8->open();
|
||||
my $acct = $adb->get($user);
|
||||
@@ -171,7 +172,7 @@ sub reset_password {
|
||||
|
||||
if (system("/sbin/e-smith/signal-event", "password-modify", $user)) {
|
||||
$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();
|
||||
return 'OK';
|
||||
@@ -199,4 +200,4 @@ sub check_password {
|
||||
return validate_password($c, $strength, $password);
|
||||
} ## end sub check_password
|
||||
|
||||
1;
|
||||
1;
|
@@ -34,6 +34,7 @@ sub main {
|
||||
sub do_update {
|
||||
my $c = shift;
|
||||
$c->app->log->info($c->log_req);
|
||||
$db = esmith::ConfigDB::UTF8->open || die "Couldn't open config db";
|
||||
my $result = "";
|
||||
my $workgroup = ($c->param('Workgroup') || 'no');
|
||||
my $servername = ($c->param('ServerName') || 'WS');
|
||||
@@ -78,4 +79,4 @@ sub validate2_workgroup {
|
||||
return $c->l('INVALID_WORKGROUP_MATCHES_SERVERNAME') if ($servername eq $workgroup);
|
||||
return ('OK');
|
||||
} ## end sub validate2_workgroup
|
||||
1;
|
||||
1;
|
@@ -4,6 +4,12 @@ package SrvMngr::Controller::Yum;
|
||||
# heading : System
|
||||
# description : Software installer
|
||||
# navigation : 4000 500
|
||||
|
||||
#$if_admin->get('/yum')->to('yum#main')->name('yum');
|
||||
#$if_admin->post('/yum')->to('yum#do_display')->name('yumd1');
|
||||
#$if_admin->get('/yumd')->to('yum#do_display')->name('yumd');
|
||||
#$if_admin->post('/yumd')->to('yum#do_update')->name('yumu');
|
||||
|
||||
#
|
||||
# routes : end
|
||||
#----------------------------------------------------------------------
|
||||
@@ -23,20 +29,20 @@ my $dnf_status_file = '/var/cache/dnf/dnf.status';
|
||||
#use File::stat;
|
||||
our %dbs;
|
||||
|
||||
for (qw(available installed updates)) {
|
||||
$dbs{$_} = esmith::ConfigDB::UTF8->open_ro("dnf_$_")
|
||||
or die "Couldn't open dnf_$_ DB\n";
|
||||
}
|
||||
|
||||
for (qw(repositories)) {
|
||||
$dbs{$_} = esmith::ConfigDB::UTF8->open("yum_$_")
|
||||
or die "Couldn't open yum_$_ DB\n";
|
||||
}
|
||||
|
||||
sub main {
|
||||
my $c = shift;
|
||||
$c->app->log->info($c->log_req);
|
||||
$cdb = esmith::ConfigDB::UTF8->open || die "Couldn't open config db";
|
||||
for (qw(available installed updates)) {
|
||||
$dbs{$_} = esmith::ConfigDB::UTF8->open_ro("dnf_$_")
|
||||
or die "Couldn't open dnf_$_ DB\n";
|
||||
}
|
||||
|
||||
for (qw(repositories)) {
|
||||
$dbs{$_} = esmith::ConfigDB::UTF8->open("yum_$_")
|
||||
or die "Couldn't open yum_$_ DB\n";
|
||||
}
|
||||
my %yum_datas = ();
|
||||
my $title = $c->l('yum_FORM_TITLE');
|
||||
my $dest = 'yum';
|
||||
@@ -63,6 +69,15 @@ sub do_display {
|
||||
my $rt = $c->current_route;
|
||||
my $trt = ($c->param('trt') || 'STAT');
|
||||
$cdb = esmith::ConfigDB::UTF8->open || die "Couldn't open config db";
|
||||
for (qw(available installed updates)) {
|
||||
$dbs{$_} = esmith::ConfigDB::UTF8->open_ro("dnf_$_")
|
||||
or die "Couldn't open dnf_$_ DB\n";
|
||||
}
|
||||
|
||||
for (qw(repositories)) {
|
||||
$dbs{$_} = esmith::ConfigDB::UTF8->open("yum_$_")
|
||||
or die "Couldn't open yum_$_ DB\n";
|
||||
}
|
||||
my %yum_datas = ();
|
||||
my $title = $c->l('yum_FORM_TITLE');
|
||||
my ($notif, $dest) = '';
|
||||
@@ -113,6 +128,16 @@ sub do_update {
|
||||
$c->app->log->info($c->log_req);
|
||||
my $rt = $c->current_route;
|
||||
my $trt = $c->param('trt');
|
||||
$cdb = esmith::ConfigDB::UTF8->open || die "Couldn't open config db";
|
||||
for (qw(available installed updates)) {
|
||||
$dbs{$_} = esmith::ConfigDB::UTF8->open_ro("dnf_$_")
|
||||
or die "Couldn't open dnf_$_ DB\n";
|
||||
}
|
||||
|
||||
for (qw(repositories)) {
|
||||
$dbs{$_} = esmith::ConfigDB::UTF8->open("yum_$_")
|
||||
or die "Couldn't open yum_$_ DB\n";
|
||||
}
|
||||
my %yum_datas = ();
|
||||
$yum_datas{trt} = $trt;
|
||||
my $title = $c->l('yum_FORM_TITLE');
|
||||
@@ -456,4 +481,4 @@ sub show_yum_log {
|
||||
my $yum_log = $cdb->get_prop_and_delete('dnf', 'LogFile');
|
||||
return $out;
|
||||
} ## end sub show_yum_log
|
||||
1;
|
||||
1;
|
@@ -1,5 +1,5 @@
|
||||
|
||||
'dat_FORM_TITLE' => 'Date and time configuration',
|
||||
'dat_The_time_is_currently' => 'The time is currently:',
|
||||
'dat_INITIAL_DESC' => 'This is where you configure the date and time of this server. You may use an existing network time server or
|
||||
manually set the date and time for your time zone.',
|
||||
'dat_SET_DATE_TITLE' => 'Set Date and Time',
|
||||
@@ -18,7 +18,7 @@ manually set the date and time for your time zone.',
|
||||
'dat_DECEMBER' => 'December',
|
||||
'dat_NEW_M/D/Y' => 'New month/day/year:',
|
||||
'dat_NEW_H/M/S' => 'New hour/min/sec:',
|
||||
'dat_AM/PM_AND_TZ' => 'AM/PM and time zone:',
|
||||
'dat_TZ' => 'Time zone:',
|
||||
'dat_NTP_ENABLE_DESC' => 'The server can periodically synchronize the system clock to a network time protocol (NTP) server. If you select this option, enter the hostname or IP address of the NTP server below.',
|
||||
'dat_NTP_CONFIGURE_DESC' => 'The server is periodically synchronizing the system clock to the network time protocol (NTP) server specified below. To synchronize to a different NTP server, enter a different hostname or IP address in the field below.',
|
||||
'dat_NTP_DISABLE_DESC' => 'Choose this option to stop syncronizing the system clock to the NTP
|
||||
@@ -38,9 +38,7 @@ server.When the NTP service is disabled, you can set the system date and time ma
|
||||
'dat_INVALID_SECOND' => 'Error: invalid second',
|
||||
'dat_MONTH_BETWEEN_1_AND_12' => 'Please choose a month value between 1 and 12.',
|
||||
'dat_INVALID_MONTH' => 'Error: invalid month',
|
||||
'dat_UPDATING_CLOCK' => 'System clock is being updated. Please wait for a few seconds,
|
||||
then click <A HREF="datetime?page=1&wherenext=Verify" TARGET="main">here</A>
|
||||
to verify changes.',
|
||||
'dat_UPDATING_CLOCK' => 'System clock is being updated',
|
||||
'dat_ERR_SETTING_CLOCK' => 'Error occurred while setting system time and hardware clock.',
|
||||
'dat_SERVER_DISABLED' => 'Network time server disabled successfully',
|
||||
'dat_SERVER_DISABLED_DESC' => 'You have disabled this service: The server will rely on its internal
|
||||
@@ -57,3 +55,8 @@ clock, and <b>will not</b> try to synchronize from a time server.',
|
||||
'dat_NTP_DISABLE_TITLE' => 'Disable Network Time Server',
|
||||
'dat_CURRENT_SETTING' => 'Current setting',
|
||||
'Date and time' => 'Date and time',
|
||||
'dat_ntp_server' => 'NTP server',
|
||||
'dat_manually_set' => 'Set manually',
|
||||
'dat_NTP_Server_URL' =>'NTP Server URL:',
|
||||
'dat_set_manually' =>'Set Date and Time:',
|
||||
'dat_Invalid_date' => 'Invalid date',
|
@@ -1,6 +1,5 @@
|
||||
|
||||
'mai_FORM_TITLE' => 'E-mail settings',
|
||||
'E-mail' => 'E-mail',
|
||||
'mai_E-Mail' => 'E-mail',
|
||||
'mai_SUCCESS' => 'The new e-mail settings have been saved.',
|
||||
'mai_NEVER' => 'not at all',
|
||||
'mai_EVERY5MIN' => 'Every 5 minutes',
|
||||
@@ -20,7 +19,7 @@ for dialup connections), or multi-drop (for dialup connections if
|
||||
ETRN is not supported by your Internet provider). Note that
|
||||
multi-drop mode is the only option available when the server is
|
||||
configured in private server and gateway mode.',
|
||||
'mai_LABEL_DELEGATE' => 'Address of internal mail server',
|
||||
'mai_LABEL_DELEGATE' => 'IP Address of internal mail server',
|
||||
'mai_TITLE_DELEGATE' => 'Delegate mail servers',
|
||||
'mai_DESC_DELEGATE' => 'Your server includes a complete, full-featured e-mail server. However,
|
||||
if for some reason you wish to delegate e-mail processing to
|
||||
@@ -79,10 +78,9 @@ destination (recommended in most cases) or can deliver them via
|
||||
your Internet provider\'s SMTP server (recommended if you have an
|
||||
unreliable Internet connection or are using a residential Internet
|
||||
service). If using your Internet provider\'s SMTP server, specify
|
||||
its hostname or IP address below. Otherwise leave this field
|
||||
blank.',
|
||||
'mai_INVALID_SMARTHOST' => 'The smarthost name you entered is not a valid internet domain name
|
||||
and is not blank',
|
||||
its hostname or IP address below. Otherwise leave this field blank.',
|
||||
'mai_INVALID_SMARTHOST' => 'The smarthost name you entered is not a valid internet domain name and is not blank',
|
||||
'mai_INVALID_DELEGATE' => 'The delegate host name you entered is not a valid IP Address and is not blank',
|
||||
'mai_DESC_POP_ACCESS_CONTROL' => 'You can control POP3 server access. The setting \'Allow access
|
||||
only from local networks\' allows POP3 access only from your
|
||||
local network(s). The POP3S setting can be used to provide
|
||||
@@ -150,5 +148,16 @@ The value for this tag can be defined below.',
|
||||
'mai_LABEL_SMARTHOST_SMTPAUTH_STATUS' => 'SMTP Authentication for Internet provider',
|
||||
'mai_LABEL_SMARTHOST_SMTPAUTH_USERID' => 'Mail server user id',
|
||||
'mai_LABEL_SMARTHOST_SMTPAUTH_PASSWD' => 'Mail server password',
|
||||
'mai_VALIDATION_SMTPAUTH_NONBLANK' => 'This field cannot be left blank if SMTP Authentication is
|
||||
'mai_VALIDATION_SMTPAUTH_NONBLANK' => 'The user id and password fields cannot be left blank if SMTP Authentication is
|
||||
enabled.',
|
||||
'mai_ACC_panel_action_was_successful' => 'Email access settings saved sucessfully',
|
||||
'mai_DEL_panel_action_was_successful' => 'Email delivery settings saved sucessfully',
|
||||
'mai_FIL_panel_action_was_successful' => 'Email filtering settings saved sucessfully',
|
||||
'mai_REC_panel_action_was_successful' => 'Email receive settings saved sucessfully',
|
||||
|
||||
'mai_SMTP_port_authenticate' => 'Smtp port %u allow client to authenticate:',
|
||||
'mai_SMTP_port_(25)' => 'Smtp port (25) main purpose is to receive emails from another server, starttls is always offered, but auth if offered is only if starttls is also used by client.',
|
||||
'mai_SMTP_Submission' => 'Smtp submission port (587) will require starttls, then authenticate to send.',
|
||||
'mai_SMTPS_port_(465)' => 'Smtps port (465) will require implicit ssl/tls then authenticate to send.',
|
||||
'mai_SMTPS_SSL/TLS' => 'Smtps ssl/tls auth: port %u status:',
|
||||
'mai_Submission_port' => 'Submission port %u status:'
|
@@ -12,13 +12,13 @@
|
||||
'ln_REMOVE_CONFIRM' => 'Are you sure you wish to remove this network?',
|
||||
'ln_DEFAULT' => 'default',
|
||||
'ln_NUMBER_OF_HOSTS' => 'Number of hosts',
|
||||
'ln_NOT_ACCESSIBLE_FROM_LOCAL_NETWORK' => 'Error: router address {$networkRouter} is not accessible from local network. Did not add network.',
|
||||
'ln_NOT_ACCESSIBLE_FROM_LOCAL_NETWORK' => 'Error: router address [_3] is not accessible from local network. Did not add network.',
|
||||
'ln_LOCALNETWORK_ADD'=>'Add network',
|
||||
'ln_NETWORK_ALREADY_LOCAL' => ' Error: network {$network} (derived from network {$networkAddress} and subnet mask {$networkMask}) is already considered local. Did not add new network. ',
|
||||
'ln_NETWORK_ALREADY_ADDED' => 'Error: network {$network} (derived from network {$networkAddress} and subnet mask {$networkMask}) has already been added. Did not add new network.',
|
||||
'ln_NETWORK_ALREADY_LOCAL' => ' Error: network [_1] (derived from network [_1] and subnet mask [_2]) is already considered local. Did not add new network. ',
|
||||
'ln_NETWORK_ALREADY_ADDED' => 'Error: network [_1] (derived from network [_1] and subnet mask [_2]) has already been added. Did not add new network.',
|
||||
'ln_ERROR_CREATING_NETWORK' => 'Error occurred while creating network.',
|
||||
'ln_SUCCESS' =>'Successfully added network [_1]/[_2] via router [_3].',
|
||||
'ln_SUCCESS_SINGLE_ADDRESS' =>'Successfully added network {$network}/{$networkMask} via router {$networkRouter}. Your server will grant local access privileges to the single IP address {$network}. ',
|
||||
'ln_SUCCESS_SINGLE_ADDRESS' =>'Successfully added network [_1]/[_2] via router [_3]. Your server will grant local access privileges to the single IP address [_1]. ',
|
||||
'ln_SUCCESS_NETWORK_RANGE' =>'Successfully added network [_1]/[_2] via router [_3]. Your server will grant local access privileges to [_4] IP addresses in the range [_5] to [_6]. ',
|
||||
'ln_NO_SUCH_NETWORK' =>'Network not found in network db',
|
||||
'ln_SUCCESS_REMOVED_NETWORK' =>'Successfully removed network [_1]/[_2] via router [_3].',
|
||||
@@ -26,5 +26,6 @@
|
||||
'ln_NO_ADDITIONAL_NETWORKS' => 'No additional networks',
|
||||
'ln_REMOVE_HOSTS_DESC' => 'Local hosts configured on the network you are about to remove have been detected. By default, they will also be removed. Uncheck this box if, for some reason, you do not wish this to happen. Note that they will not be treated as local, and may not even be reachable, after this network is removed. ',
|
||||
'ln_REMOVE_HOSTS_LABEL' => 'Remove hosts on network',
|
||||
'ln_extra' => '{$network}/{$networkMask} via router $networkRouter}.',
|
||||
'ln_extra' => '[_1]/[_2] via router $networkRouter}.',
|
||||
'ln_SUCCESS_NONSTANDARD_RANGE' =>'<p>Successfully added network [_1]/[_2] via router [_3].</p><p> Your server will grant local access privileges to [_4] IP addresses in the range [_5] to [_6].</p><p> Warning: the ProFTPd FTP server cannot handle this nonstandard subnet mask. The simpler specification <b>[_7]</b> will be used instead.</p>',
|
||||
'ln_Failed to find network in Db' => 'Failed to find network in Db',
|
@@ -1,16 +1,13 @@
|
||||
'pf_FORM_TITLE' => 'Configure Port Forwarding',
|
||||
'pf_FIRST_PAGE_DESCRIPTION' => '<p>
|
||||
You can use this panel to modify your firewall rules so
|
||||
'pf_FIRST_PAGE_DESCRIPTION' => 'You can use this panel to modify your firewall rules so
|
||||
as to open a specific port on this server and forward it
|
||||
to another port on another host. Doing so will permit
|
||||
incoming traffic to directly access a private host on
|
||||
your LAN.
|
||||
</p><p>
|
||||
WARNING: Misuse of this feature can seriously compromise the
|
||||
security of your network. Do not use this feature
|
||||
lightly, or without fully understanding the implications
|
||||
of your actions.
|
||||
</p>',
|
||||
of your actions.',
|
||||
'pf_CREATE_RULE' => 'Create portforwarding rule',
|
||||
'pf_SUMMARY_ADD_DESC' => 'The following summarizes the port-forwarding rule
|
||||
that you are about to add. If you are satisfied with the rule,
|
||||
@@ -22,13 +19,13 @@
|
||||
port-forwarding rules installed on this server. Click on the
|
||||
\'Remove\' link to remove the corresponding rule.',
|
||||
'pf_NO_FORWARDS' => 'There are currently no forwarded ports on the system.',
|
||||
'pf_CREATE_PAGE_DESCRIPTION' => '<p>Select the protocol, the port you wish to forward, the
|
||||
'pf_CREATE_PAGE_DESCRIPTION' => 'Select the protocol, the port you wish to forward, the
|
||||
destination host, and the port on the destination host
|
||||
that you wish to forward to. If you wish to specify a port
|
||||
range, enter the lower and upper boundaries separated by a
|
||||
hyphen. The destination port may be left blank, which will
|
||||
instruct the firewall to leave the source port
|
||||
unaltered.</p>',
|
||||
unaltered',
|
||||
'pf_LABEL_SOURCE_PORT' => 'Source Port(s)',
|
||||
'pf_LABEL_PROTOCOL' => 'Protocol',
|
||||
'pf_LABEL_DESTINATION_PORT' => 'Destination Port(s)',
|
||||
@@ -53,4 +50,4 @@
|
||||
'pf_ERR_BADAHOST' => 'This does not appear to be a valid IP address list.
|
||||
ie: 192.168.0.1,192.168.1.1/24',
|
||||
'pf_IN_SERVERONLY' => 'This server is currently in serveronly mode and portforwarding
|
||||
is possible only to localhost.',
|
||||
is possible only to localhost.',
|
@@ -19,3 +19,5 @@
|
||||
'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_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>",
|
@@ -0,0 +1,51 @@
|
||||
.datetime-config-row {
|
||||
display: flex;
|
||||
align-items: stretch;
|
||||
margin-bottom: 1em;
|
||||
}
|
||||
|
||||
.datetime-label-col {
|
||||
background: #e8f3e2; /* light green */
|
||||
padding: 1em 0em 0em 0em;
|
||||
min-width: 30%;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: flex-end;
|
||||
font-weight: bold;
|
||||
border-radius: 4px 0 0 4px;
|
||||
}
|
||||
|
||||
.datetime-label {
|
||||
display:inline-flex;
|
||||
}
|
||||
|
||||
.datetime-fields-col {
|
||||
background: #fff;
|
||||
padding: 1em;
|
||||
flex: 1;
|
||||
border: 1px solid #ccc;
|
||||
border-left: none;
|
||||
border-radius: 0 4px 4px 0;
|
||||
}
|
||||
|
||||
.datetime-clock {
|
||||
min-width: 20em;
|
||||
display:inline-flex;
|
||||
border:0px;
|
||||
padding:5px;
|
||||
}
|
||||
|
||||
.datetime-clock-label {
|
||||
background-color:#e8f3e2;
|
||||
display:inline-flex;
|
||||
width:30%;
|
||||
font-weight:bold;
|
||||
text-align:right;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.ntp-test-result { font-weight: bold; }
|
||||
.ntp-test-success { color: green; }
|
||||
.ntp-test-error { color: red; }
|
||||
.ntp-test-wait { color: #333; }
|
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
|
||||
*/
|
||||
.Emailsettings-panel {}
|
||||
.name {}
|
||||
.rout {}
|
||||
.name {}
|
||||
.rout {}
|
||||
.name {}
|
||||
.rout {}
|
||||
.name {}
|
||||
.rout {}
|
||||
.name {}
|
||||
.rout {}
|
@@ -280,4 +280,14 @@ background-color: #e8f3e1;
|
||||
/* Or specify the desired color */
|
||||
text-decoration: none;
|
||||
/* Or any other style you want to reset */
|
||||
}
|
||||
|
||||
#busy-indicator {
|
||||
display: none;
|
||||
margin-top: 10px;
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
}
|
||||
.busy {
|
||||
cursor: wait; /* Change the cursor to a 'wait' cursor */
|
||||
}
|
101
root/usr/share/smanager/themes/default/public/js/datetime.js
Normal file
101
root/usr/share/smanager/themes/default/public/js/datetime.js
Normal file
@@ -0,0 +1,101 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
var select = document.getElementById('time_mode_select');
|
||||
var ntpSection = document.getElementById('ntp_section');
|
||||
var manualSection = document.getElementById('manual_section');
|
||||
|
||||
function toggleSections() {
|
||||
if (select.value === 'dat_manually_set') {
|
||||
ntpSection.style.display = 'none';
|
||||
manualSection.style.display = 'block';
|
||||
} else {
|
||||
ntpSection.style.display = 'block';
|
||||
manualSection.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
select.addEventListener('change', toggleSections);
|
||||
toggleSections(); // Set initial state
|
||||
});
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Parse the initial server time from the input value
|
||||
const clockElement = document.getElementById('real-time-clock');
|
||||
if (!clockElement) return;
|
||||
|
||||
// Get the initial server time from the input's value
|
||||
let serverTime = new Date(clockElement.value.replace(' ', 'T'));
|
||||
|
||||
function updateDateTime() {
|
||||
// Format the date/time string as desired
|
||||
const daysOfWeek = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
||||
const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
||||
|
||||
const dayOfWeek = daysOfWeek[serverTime.getDay()];
|
||||
const month = months[serverTime.getMonth()];
|
||||
const day = serverTime.getDate();
|
||||
const year = serverTime.getFullYear();
|
||||
|
||||
let hours = serverTime.getHours();
|
||||
const ampm = hours >= 12 ? 'PM' : 'AM';
|
||||
hours = hours % 12 || 12;
|
||||
|
||||
const minutes = serverTime.getMinutes().toString().padStart(2, '0');
|
||||
const seconds = serverTime.getSeconds().toString().padStart(2, '0');
|
||||
|
||||
const dateTimeString = `${dayOfWeek}, ${month} ${day}, ${year} ${hours}:${minutes}:${seconds} ${ampm}`;
|
||||
clockElement.value = dateTimeString;
|
||||
|
||||
// Advance serverTime by one second
|
||||
serverTime.setSeconds(serverTime.getSeconds() + 1);
|
||||
}
|
||||
|
||||
updateDateTime();
|
||||
setInterval(updateDateTime, 1000);
|
||||
});
|
||||
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const btn = document.getElementById('test-ntp-btn');
|
||||
const input = document.getElementById('ntpserver');
|
||||
const result = document.getElementById('ntp-test-result');
|
||||
|
||||
btn.addEventListener('click', function() {
|
||||
const server = input.value.trim();
|
||||
result.className = 'ntp-test-result'; // reset
|
||||
|
||||
if (!server) {
|
||||
result.textContent = "Please enter a server address.";
|
||||
result.classList.add('ntp-test-error');
|
||||
return;
|
||||
}
|
||||
result.textContent = "Testing...";
|
||||
result.classList.add('ntp-test-wait');
|
||||
|
||||
fetch('/smanager/datetimet', {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
body: JSON.stringify({ ntpserver: server })
|
||||
})
|
||||
.then(response => {
|
||||
if (!response.ok) {
|
||||
// HTTP error, e.g., 404, 500
|
||||
throw new Error(`HTTP error: ${response.status} ${response.statusText}`);
|
||||
}
|
||||
return response.json();
|
||||
})
|
||||
.then(data => {
|
||||
result.className = 'ntp-test-result'; // reset
|
||||
if (data.success) {
|
||||
result.textContent = `Server time: ${data.time}`;
|
||||
result.classList.add('ntp-test-success');
|
||||
} else {
|
||||
result.textContent = `Error: ${data.error}`;
|
||||
result.classList.add('ntp-test-error');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
// Network error or thrown HTTP error
|
||||
result.className = 'ntp-test-result ntp-test-error';
|
||||
result.textContent = `Request failed: ${error.message}`;
|
||||
});
|
||||
});
|
||||
});
|
@@ -0,0 +1,5 @@
|
||||
//
|
||||
//Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
|
||||
//
|
||||
$(document).ready(function() {
|
||||
});
|
@@ -28,4 +28,16 @@ $(document).ready(function() {
|
||||
var iconSrc = inputType === 'password' ? 'images/visible.png' : 'images/visible-slash.png';
|
||||
$(this).attr('src', iconSrc);
|
||||
});
|
||||
});
|
||||
|
||||
// and busy cursor
|
||||
$(document).ready(function() {
|
||||
// Handle form submission for any form
|
||||
$('form').on('submit', function(event) {
|
||||
// Disable all submit buttons and update their labels
|
||||
$(this).find('button[type="submit"]').prop('disabled', true).text('Please wait...');
|
||||
$(this).find('input[type="submit"]').prop('disabled', true).val('Please wait...');
|
||||
// Add busy cursor
|
||||
$('body').addClass('busy');
|
||||
});
|
||||
});
|
@@ -1,125 +1,147 @@
|
||||
% layout 'default', title => "Sme server 2 - datetime";
|
||||
|
||||
% layout 'default', title => 'Sme server 2 - datetime';
|
||||
% content_for 'module' => begin
|
||||
<div id='module' class='module datetime-panel'>
|
||||
<div id='module' class='module datetime-panel'>
|
||||
% if (config->{debug} == 1) {
|
||||
<p>
|
||||
%= dumper $c->current_route
|
||||
%= dumper $dat_data
|
||||
</p>
|
||||
% }
|
||||
|
||||
% if (config->{debug} == 1) {
|
||||
<p>
|
||||
%= dumper $c->current_route
|
||||
%= dumper $dat_datas
|
||||
</p>
|
||||
% }
|
||||
%if ($c->stash('first')) {
|
||||
<br><p>
|
||||
%=$c->render_to_string(inline =>$c->l($c->stash('first')))
|
||||
</p>
|
||||
%} elsif ($c->stash('success')) {
|
||||
<div class='success '>
|
||||
%= $c->l($c->stash('success'));
|
||||
</div>
|
||||
%} elsif ($c->stash('error')) {
|
||||
<div class='sme-error'>
|
||||
%= $c->l($c->stash('error'));
|
||||
</div>
|
||||
%}
|
||||
|
||||
% if ( stash 'error' ) {
|
||||
<br><div class=sme-error>
|
||||
%= $c->render_to_string(inline => stash 'error')
|
||||
<h1><%= $title %></h1><br>
|
||||
%= $modul
|
||||
<% my $btn = l('SAVE'); %>
|
||||
<br /><br />
|
||||
<span>
|
||||
%= label_for 'real-time-clock' => $c->l('dat_The_time_is_currently'), class => 'datetime-clock-label'
|
||||
</span><span class=data2>
|
||||
<!--
|
||||
<div id="real-time-clock"></div>
|
||||
-->
|
||||
%= text_field 'clock', id => 'real-time-clock', readonly => 'readonly', class => 'datetime-clock' , value => $dat_data->{currentdatetime}
|
||||
</span>
|
||||
% if ($dat_data->{ntpstatus} eq 'disabled') {
|
||||
<div class='datetime-set-ntp'>
|
||||
%=l 'dat_NTP_ENABLE_DESC'
|
||||
<br>
|
||||
</div>
|
||||
% } else {
|
||||
% my $current_year = $dat_data->{year};
|
||||
% my $year_options = [ map { [ $_, $_ ] } ($current_year..($current_year+30)) ];
|
||||
% my $month_options = [ map { [ sprintf('%02d', $_), sprintf('%02d', $_) ] } (1..12) ];
|
||||
% my $hour_options = [ map { [ sprintf('%02d', $_), sprintf('%02d', $_) ] } (0..23) ];
|
||||
% my $mode_options = [
|
||||
% [ $c->l('dat_ntp_server'), 'dat_ntp_server' ],
|
||||
% [ $c->l('dat_manually_set'), 'dat_manually_set' ]
|
||||
% ];
|
||||
<h2><%= $c->l('Time Configuration') %></h2>
|
||||
%= form_for "datetimeu" => (method => 'post') => begin
|
||||
|
||||
%= hidden_field 'Old_ntpstatus' => $dat_data->{ntpstatus};
|
||||
%= hidden_field 'trt' => $dat_data->{trt};
|
||||
|
||||
<span class=label>
|
||||
%= label_for time_mode => $c->l('Time Setting Mode:')
|
||||
</span><span class=data2>
|
||||
% param 'time_mode' => $dat_data->{time_mode} unless param 'time_mode';
|
||||
%= select_field time_mode => ($mode_options, id => 'time_mode_select')
|
||||
</span>
|
||||
|
||||
<div id='ntp_section'>
|
||||
<p>
|
||||
%= $c->l('dat_NTP_CONFIGURE_DESC')
|
||||
</p>
|
||||
<div class='datetime-config-row'>
|
||||
<div class='datetime-label-col'>
|
||||
<span class='datetime-label'>
|
||||
%= label_for ntpserver => $c->l('dat_NTP_Server_URL')
|
||||
</span>
|
||||
</div>
|
||||
<div class=datetime-fields-col>
|
||||
% my $server_check = '^([a-zA-Z0-9][a-zA-Z0-9\.\-]{0,253}[a-zA-Z0-9]|(\d{1,3}\.){3}\d{1,3})$';
|
||||
% param 'ntpserver' => $dat_data->{ntpserver} unless param 'ntpserver';
|
||||
%= text_field ntpserver => placeholder => 'e.g. smeserver.pool.ntp.org', id => 'ntpserver', pattern => $server_check, title => 'Enter a valid hostname or IPv4 address', required => 'required'
|
||||
<button type="button" id="test-ntp-btn" class="btn btn-primary ml-2">Test Server</button>
|
||||
<span id="ntp-test-result" class="ntp-test-result ml-2"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id='manual_section'>
|
||||
<p>
|
||||
%= $c->l('dat_NTP_DISABLE_DESC')
|
||||
</p>
|
||||
<div class='datetime-config-row'>
|
||||
<div class='datetime-label-col'>
|
||||
<span class='datetime-label'>
|
||||
%= label_for 'datetime_manual' => $c->l('dat_set_manually')
|
||||
</span>
|
||||
</div>
|
||||
<div class='datetime-fields-col' id='datetime_manual'>
|
||||
<fieldset>
|
||||
<legend><%= $c->l('Date') %></legend>
|
||||
%= label_for year => $c->l('Year:')
|
||||
% param 'year' => ($dat_data->{year}) unless param 'year';
|
||||
%= select_field year => ($year_options, id => 'year'), required => 'required'
|
||||
|
||||
|
||||
%= label_for month => $c->l('Month:')
|
||||
% param 'month' => ($dat_data->{month}) unless param 'month';
|
||||
%= select_field month => ($month_options, id => 'month'), required => 'required'
|
||||
|
||||
|
||||
%= label_for day => $c->l('Day:')
|
||||
% param 'day' => ($dat_data->{day}) unless param 'day';
|
||||
%= text_field day => id => 'day', size => 2, maxlength => 2, placeholder => 'DD', pattern => '^(0[1-9]|[12][0-9]|3[01])$', title => 'Day (01-31)', required => 'required', inputmode => 'numeric', autocomplete => 'off'
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<legend><%= $c->l('Time') %></legend>
|
||||
%= label_for hour => $c->l('Hour:')
|
||||
% param 'hour' => ($dat_data->{hour}) unless param 'hour';
|
||||
%= select_field hour => ($hour_options, id => 'hour'), required => 'required'
|
||||
|
||||
|
||||
%= label_for minute => $c->l('Minute:')
|
||||
% param 'minute' => ($dat_data->{minute}) unless param 'minute';
|
||||
%= text_field minute => id => 'minute', size => 2, maxlength => 2, placeholder => 'MM', pattern => '^[0-5][0-9]$', title => 'Minute (00-59)', required => 'required', inputmode => 'numeric', autocomplete => 'off'
|
||||
|
||||
|
||||
%= label_for second => $c->l('Second:')
|
||||
% param 'second' => ($dat_data->{second}) unless param 'second';
|
||||
%= text_field second => id => 'second', size => 2, maxlength => 2, placeholder => 'SS', pattern => '^[0-5][0-9]$', title => 'Second (00-59)', required => 'required', inputmode => 'numeric', autocomplete => 'off'
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<div class='datetime-config-row'>
|
||||
<div class='datetime-label-col'>
|
||||
<span class='datetime-label'>
|
||||
%=l 'dat_TZ'
|
||||
</span>
|
||||
</div>
|
||||
<div class='datetime-fields-col' id='datetime_manual'>
|
||||
% param 'Timezone' => $c->getTimezone() unless param 'Timezone';
|
||||
%= select_field 'Timezone' => $c->getZone_list(), class => 'input'
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
%= submit_button $btn, class => 'action'
|
||||
% end
|
||||
% }
|
||||
</div>
|
||||
%}
|
||||
|
||||
<h1><%= $title %></h1><br>
|
||||
%= $modul
|
||||
<% my $btn = l('SAVE'); %>
|
||||
|
||||
%= form_for '/datetime' => (method => 'POST') => begin
|
||||
<p>
|
||||
%= hidden_field 'Old_ntpstatus' => $dat_datas->{ntpstatus};
|
||||
|
||||
% param 'Ntpstatus' => $dat_datas->{ntpstatus} unless param 'Ntpstatus';
|
||||
%= radio_button Ntpstatus => 'enabled'
|
||||
<span class=label>
|
||||
%=l 'dat_NTP_CONFIGURE_TITLE'
|
||||
</span>
|
||||
<br>
|
||||
% if ($dat_datas->{ntpstatus} eq 'disabled') {
|
||||
<div class='datetime-set-ntp'>
|
||||
%=l 'dat_NTP_ENABLE_DESC'
|
||||
<br>
|
||||
</div>
|
||||
% } else {
|
||||
<div class='datetime-set-ntp'>
|
||||
%=l 'dat_NTP_CONFIGURE_DESC'
|
||||
<br><br>
|
||||
<p>
|
||||
%=l 'dat_CURRENT_SETTING'
|
||||
<b>
|
||||
%= $dat_datas->{now_string}
|
||||
</b>
|
||||
</p>
|
||||
<p>
|
||||
<br>
|
||||
<span class=label>
|
||||
%=l 'dat_NTP_SERVER'
|
||||
</span><span class=data2>
|
||||
%= text_field 'Ntpserver' => $dat_datas->{ntpserver}, class => 'input'
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
% }
|
||||
%= radio_button Ntpstatus => 'disabled'
|
||||
<span class=label datetime-set-ntp>
|
||||
%=l 'dat_NTP_DISABLE_TITLE'
|
||||
</span>
|
||||
|
||||
% if ($dat_datas->{ntpstatus} eq 'enabled') {
|
||||
|
||||
<br><BR>
|
||||
<div class='datetime-set-ntp'>
|
||||
%=l 'dat_NTP_DISABLE_DESC'
|
||||
</div>
|
||||
% } else {
|
||||
<div class='datetime-set-ntp'>
|
||||
<br>
|
||||
</p>
|
||||
<p>
|
||||
%=l 'dat_CURRENT_SETTING'
|
||||
<b>
|
||||
%= $dat_datas->{now_string}
|
||||
</b>
|
||||
<br>
|
||||
<span class=label>
|
||||
%=l 'dat_NEW_M/D/Y'
|
||||
</span><span class=data2>
|
||||
% param 'Month' => $dat_datas->{month} unless param 'Month';
|
||||
%= select_field 'Month' => $c->getMonth_list(), class => 'input'
|
||||
</span><span class=data2>
|
||||
% param 'Day' => $dat_datas->{day} unless param 'Day';
|
||||
%= text_field 'Day', size => '2', class => 'input'
|
||||
</span><span class=data2>
|
||||
% param 'Year' => $dat_datas->{year} unless param 'Year';
|
||||
%= text_field 'Year', size => '4', class => 'input'
|
||||
</span>
|
||||
<br>
|
||||
<span class=label>
|
||||
%=l 'dat_NEW_H/M/S'
|
||||
</span><span class=data2>
|
||||
% param 'Hour' => $dat_datas->{hour} unless param 'Hour';
|
||||
%= text_field 'Hour', size => '2', class => 'input'
|
||||
</span><span class=data2>
|
||||
% param 'Minute' => $dat_datas->{minute} unless param 'Minute';
|
||||
%= text_field 'Minute', size => '2', class => 'input'
|
||||
</span><span class=data2>
|
||||
% param 'Second' => $dat_datas->{second} unless param 'Second';
|
||||
%= text_field 'Second', size => '2', class => 'input'
|
||||
</span>
|
||||
<br>
|
||||
<span class=label>
|
||||
%=l 'dat_AM/PM_AND_TZ'
|
||||
</span><span class=data2>
|
||||
% param 'Ampm' => $dat_datas->{ampm} unless param 'Ampm';
|
||||
%= select_field 'Ampm' => ['AM', 'PM'], class => 'input'
|
||||
</span><span class=data2>
|
||||
% param 'Timezone' => $c->getTimezone() unless param 'Timezone';
|
||||
%= select_field 'Timezone' => $c->getZone_list(), class => 'input'
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
% }
|
||||
<p>
|
||||
<br>
|
||||
%= submit_button "$btn", class => 'action'
|
||||
</p>
|
||||
|
||||
% end
|
||||
|
||||
</div>
|
||||
%end
|
||||
% end
|
||||
1;
|
@@ -1,57 +0,0 @@
|
||||
% layout 'default', title => "Sme server 2 - emailaccess";
|
||||
|
||||
% content_for 'module' => begin
|
||||
<div id='module' class='module emailaccess-panel'>
|
||||
|
||||
% if (config->{debug} == 1) {
|
||||
<p>
|
||||
%= dumper $c->current_route
|
||||
%= dumper $mai_datas
|
||||
</p>
|
||||
% }
|
||||
|
||||
% if ( stash 'error' ) {
|
||||
<br><div class=sme-error>
|
||||
%= $c->render_to_string(inline => stash 'error')
|
||||
</div>
|
||||
%}
|
||||
|
||||
<h1><%= $title%></h1>
|
||||
|
||||
%= form_for '/emailsettingd' => (method => 'POST') => begin
|
||||
|
||||
%=l 'mai_DESC_POP_ACCESS_CONTROL'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_POP_ACCESS_CONTROL'
|
||||
</span><span class=input>
|
||||
% param 'POPAccess' => $c->get_current_pop3_access() unless param 'POPAccess';
|
||||
%= select_field 'POPAccess' => $c->get_pop_opt(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
%=l 'mai_DESC_IMAP_ACCESS_CONTROL'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_IMAP_ACCESS_CONTROL'
|
||||
</span><span class=input>
|
||||
% param 'IMAPAccess' => $c->get_current_imap_access() unless param 'IMAPAccess';
|
||||
%= select_field 'IMAPAccess' => $c->get_imap_opt(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
%=l 'mai_DESC_WEBMAIL'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_WEBMAIL'
|
||||
</span><span class=input>
|
||||
% param 'WebMail' => $c->get_current_webmail_status() unless param 'WebMail';
|
||||
%= select_field 'WebMail' => $c->get_webmail_opt(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
% my $btn = l('SAVE');
|
||||
%= submit_button "$btn", class => 'action'
|
||||
|
||||
%= hidden_field 'trt' => 'ACC'
|
||||
% end
|
||||
|
||||
</div>
|
||||
%end
|
@@ -1,92 +0,0 @@
|
||||
% layout 'default', title => "Sme server 2 - emaildeliver";
|
||||
|
||||
% content_for 'module' => begin
|
||||
<div id='module' class='module emaildeliver-panel'>
|
||||
|
||||
% if (config->{debug} == 1) {
|
||||
<p>
|
||||
%= dumper $c->current_route
|
||||
%= dumper $mai_datas
|
||||
</p>
|
||||
% }
|
||||
|
||||
% if ( stash 'error' ) {
|
||||
<br><div class=sme-error>
|
||||
%= $c->render_to_string(inline => stash 'error')
|
||||
</div>
|
||||
%}
|
||||
|
||||
<h1><%= $title%></h1>
|
||||
|
||||
%= form_for '/emailsettingd' => (method => 'POST') => begin
|
||||
|
||||
<h2>
|
||||
%=l 'mai_TITLE_UNKNOWN'
|
||||
</h2>
|
||||
|
||||
%=l 'mai_DESC_UNKNOWN'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_UNKNOWN'
|
||||
</span><span class=input>
|
||||
% param 'EmailUnknownUser' => $mai_datas->{emailunknownuser} unless param 'EmailUnknownUser';
|
||||
%= select_field 'EmailUnknownUser' => $c->get_emailunknownuser_opt(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
<!--<hr class='menubar' />-->
|
||||
<h2>
|
||||
%=l 'mai_TITLE_DELEGATE'
|
||||
</h2>
|
||||
|
||||
%=l 'mai_DESC_DELEGATE'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_DELEGATE'
|
||||
</span><span class=input>
|
||||
% param 'DelegateMailServer' => $mai_datas->{delegatemailserver} unless param 'DelegateMailServer';
|
||||
%= text_field 'DelegateMailServer', class => 'input'
|
||||
</span></p>
|
||||
|
||||
<!--<hr class='sectionbar' />-->
|
||||
<h2>
|
||||
%=l 'mai_TITLE_SMARTHOST'
|
||||
</h2>
|
||||
|
||||
%=l 'mai_DESC_SMARTHOST'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SMARTHOST'
|
||||
</span><span class=input>
|
||||
% param 'SMTPSmartHost' => $mai_datas->{smtpsmarthost} unless param 'SMTPSmartHost';
|
||||
%= text_field 'SMTPSmartHost', class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SMARTHOST_SMTPAUTH_STATUS'
|
||||
</span><span class=input>
|
||||
% param 'SMTPAUTHPROXY_status' => $mai_datas->{smtpauthproxystatus} unless param 'SMTPAUTHPROXY_status';
|
||||
%= select_field 'SMTPAUTHPROXY_status' => [[(l 'DISABLED') => 'disabled'], [(l 'ENABLED') => 'enabled']], class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SMARTHOST_SMTPAUTH_USERID'
|
||||
</span><span class=input>
|
||||
% param 'SMTPAUTHPROXY_Userid' => $mai_datas->{smtpauthproxyuserid} unless param 'SMTPAUTHPROXY_Userid';
|
||||
%= text_field 'SMTPAUTHPROXY_Userid', class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SMARTHOST_SMTPAUTH_PASSWD'
|
||||
</span><span class=input>
|
||||
% param 'SMTPAUTHPROXY_Passwd' => $mai_datas->{smtpauthproxypassword} unless param 'SMTPAUTHPROXY_Passwd';
|
||||
%= password_field 'SMTPAUTHPROXY_Passwd', class => 'input'
|
||||
</span></p>
|
||||
|
||||
% my $btn = l('SAVE');
|
||||
%= submit_button "$btn", class => 'action'
|
||||
|
||||
%= hidden_field 'trt' => 'DEL'
|
||||
% end
|
||||
|
||||
</div>
|
||||
%end
|
@@ -1,101 +0,0 @@
|
||||
% layout 'default', title => "Sme server 2 - emailfilter";
|
||||
|
||||
% content_for 'module' => begin
|
||||
<div id='module' class='module emailfilter-panel'>
|
||||
|
||||
% if (config->{debug} == 1) {
|
||||
<p>
|
||||
%= dumper $c->current_route
|
||||
%= dumper $mai_datas
|
||||
</p>
|
||||
% }
|
||||
|
||||
% if ( stash 'error' ) {
|
||||
<br><div class=sme-error>
|
||||
%= $c->render_to_string(inline => stash 'error')
|
||||
</div>
|
||||
%}
|
||||
|
||||
<h1><%= $title%></h1>
|
||||
|
||||
%= form_for '/emailsettingd' => (method => 'POST') => begin
|
||||
|
||||
%=l 'mai_DESC_VIRUS_SCAN'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_VIRUS_SCAN'
|
||||
</span><span class=input>
|
||||
% param 'VirusStatus' => $mai_datas->{virusstatus} unless param 'VirusStatus';
|
||||
%= select_field 'VirusStatus' => [[(l 'DISABLED') => 'disabled'], [ (l 'ENABLED') => 'enabled']], class => 'input'
|
||||
</span><br></p>
|
||||
|
||||
%=l 'mai_DESC_SPAM_SCAN'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SPAM_SCAN'
|
||||
</span><span class=input>
|
||||
% param 'Spamstatus' => $mai_datas->{spamstatus} unless param 'Spamstatus';
|
||||
%= select_field 'Spamstatus' => [[(l 'DISABLED') => 'disabled'], [ (l 'ENABLED') => 'enabled']], class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SPAM_SENSITIVITY'
|
||||
</span><span class=input>
|
||||
% param 'SpamSensitivity' => $mai_datas->{spamsensitivity} unless param 'SpamSensitivity';
|
||||
%= select_field 'SpamSensitivity' => $c->get_spam_sensitivity_opt(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SPAM_TAGLEVEL'
|
||||
</span><span class=input>
|
||||
% param 'SpamTagLevel' => $mai_datas->{spamtaglevel} unless param 'SpamTagLevel';
|
||||
%= select_field 'SpamTagLevel' => $c->get_spam_level_options(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SPAM_REJECTLEVEL'
|
||||
</span><span class=input>
|
||||
% param 'SpamRejectLevel' => $mai_datas->{spamrejectlevel} unless param 'SpamRejectLevel';
|
||||
%= select_field 'SpamRejectLevel' => $c->get_spam_level_options(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SORTSPAM'
|
||||
</span><span class=input>
|
||||
% param 'SpamSortSpam' => $mai_datas->{spamsortspam} unless param 'SpamSortSpam';
|
||||
%= select_field 'SpamSortSpam' => [[(l 'DISABLED') => 'disabled'], [ (l 'ENABLED') => 'enabled']], class => 'input'
|
||||
</span></p>
|
||||
|
||||
%=l 'mai_DESC_SPAM_SUBJECT'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SPAM_SUBJECTTAG'
|
||||
</span><span class=input>
|
||||
% param 'SpamSubjectTag' => $mai_datas->{spamsubjecttag} unless param 'SpamSubjectTag';
|
||||
%= select_field 'SpamSubjectTag' => [[(l 'DISABLED') => 'disabled'], [ (l 'ENABLED') => 'enabled']], class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SPAM_SUBJECT'
|
||||
</span><span class=input>
|
||||
% param 'SpamSubject' => $mai_datas->{spamsubject} unless param 'SpamSubject';
|
||||
%= text_field 'SpamSubject' => class => 'input'
|
||||
</span></p>
|
||||
|
||||
%=l 'mai_DESC_BLOCK_EXECUTABLE_CONTENT'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_CONTENT_TO_BLOCK'
|
||||
</span><span class=input>
|
||||
% param 'BlockExecutableContent' => $c->get_patterns_current_opt() unless param 'BlockExecutableContent';
|
||||
%= select_field 'BlockExecutableContent' => $c->get_patterns_opt(), class => 'input', multiple => "1"
|
||||
</span></p>
|
||||
|
||||
% my $btn = l('SAVE');
|
||||
%= submit_button "$btn", class => 'action'
|
||||
|
||||
%= hidden_field 'trt' => 'FIL'
|
||||
% end
|
||||
|
||||
</div>
|
||||
%end
|
@@ -1,167 +0,0 @@
|
||||
% layout 'default', title => "Sme server 2 - emailreceive";
|
||||
|
||||
% content_for 'module' => begin
|
||||
|
||||
% use constant FALSE => 0;
|
||||
% use constant TRUE => 1;
|
||||
|
||||
<div id='module' class='module emailreceive-panel'>
|
||||
|
||||
% if (config->{debug} == 1) {
|
||||
<p>
|
||||
%= dumper $c->current_route
|
||||
%= dumper $mai_datas
|
||||
%= dumper $c->param('SMTPAuth')
|
||||
</p>
|
||||
% }
|
||||
|
||||
% if ( stash 'error' ) {
|
||||
<br><div class=sme-error>
|
||||
%= $c->render_to_string(inline => stash 'error')
|
||||
</div>
|
||||
%}
|
||||
|
||||
<h1><%= $title%></h1>
|
||||
|
||||
%= form_for '/emailsettingd' => (method => 'POST') => begin
|
||||
|
||||
%=l 'mai_DESC_MODE'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_MODE'
|
||||
</span><span class=input>
|
||||
% param 'FetchmailMethod' => $mai_datas->{fetchmailmethod} unless param 'FetchmailMethod';
|
||||
<!--
|
||||
<pre>
|
||||
%= dumper $mai_datas->{fetchmailmethod}
|
||||
%= dumper $c->get_retrieval_opt()
|
||||
%= param 'FetchmailMethod'
|
||||
</pre>
|
||||
-->
|
||||
%= select_field 'FetchmailMethod' => $c->get_retrieval_opt(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
%#=l 'mai_DESC_SMTP_AUTH_CONTROL'
|
||||
<br />
|
||||
%= l "SMTP port (25) main purpose is to receive emails from another server, STARTTLS is always offered, but auth if offered is only if STARTTLS is also used by client."
|
||||
<br />
|
||||
%= l "SMTPS port (465) will require implicit SSL/TLS then authenticate to send."
|
||||
<br />
|
||||
%= l "SMTP Submission port (587) will require STARTTLS, then authenticate to send."
|
||||
<br />
|
||||
|
||||
% my $smtp_mesg=l('SMTP port %u allow client to authenticate:');
|
||||
<p><span class=label>
|
||||
%= sprintf($smtp_mesg,$c->get_db_prop('qpsmtpd','TCPPort',25));
|
||||
</span><span class=input>
|
||||
% param 'SMTPAuth' => $c->get_current_smtp_auth( FALSE ) unless param 'SMTPAuth';
|
||||
<!--
|
||||
<pre>
|
||||
%= dumper $c->get_smtp_auth_opt()
|
||||
%= dumper $c->get_current_smtp_auth(FALSE)
|
||||
%= dumper $c->get_db_prop("qpsmtpd","Authentication")
|
||||
%= param 'SMTPAuth'
|
||||
</pre>
|
||||
-->
|
||||
%= select_field 'SMTPAuth' => $c->get_smtp_auth_opt(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
% my $smtp_mesg=l('SMTPS SSL/TLS auth: port %u status:');
|
||||
<p><span class=label>
|
||||
%= sprintf($smtp_mesg,$c->get_db_prop('sqpsmtpd','TCPPort',465));
|
||||
</span><span class=input>
|
||||
% param 'sSMTPAuth' => $c->get_current_smtp_ssl_auth(FALSE,'s', TRUE) unless param 'sSMTPAuth';
|
||||
|
||||
%= select_field 'sSMTPAuth' => $c->get_smtp_ssl_auth_opt(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
%my $smtp_mesg=l('Submission port %u status:');
|
||||
<p><span class=label>
|
||||
%= sprintf($smtp_mesg,$c->get_db_prop('uqpsmtpd','TCPPort',587));
|
||||
</span><span class=input>
|
||||
% param 'uSMTPAuth' => $c->get_current_smtp_ssl_auth(FALSE,'u', TRUE) unless param 'uSMTPAuth';
|
||||
<!--
|
||||
<pre>
|
||||
%= dumper $c->get_smtp_ssl_auth_opt()
|
||||
%= dumper $c->get_current_smtp_ssl_auth(FALSE,'s', TRUE)
|
||||
%= dumper $c->get_current_smtp_ssl_auth(FALSE,'u', TRUE)
|
||||
%= dumper $c->get_db_prop("uqpsmtpd","access")
|
||||
%= param 'uSMTPAuth'
|
||||
</pre>
|
||||
-->
|
||||
%= select_field 'uSMTPAuth' => $c->get_smtp_ssl_auth_opt(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
<!--<hr class="sectionbar" />-->
|
||||
<h2>
|
||||
%=l 'mai_TITLE_SECONDARY'
|
||||
</h2>
|
||||
|
||||
%=l 'mai_DESC_SECONDARY'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SECONDARY'
|
||||
</span><span class=input>
|
||||
% param 'SecondaryMailServer' => $mai_datas->{secondarymailserver} unless param 'SecondaryMailServer';
|
||||
%= text_field 'SecondaryMailServer', class => 'input'
|
||||
</span></p>
|
||||
|
||||
%=l 'mai_DESC_FETCH_PERIOD'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_FETCH_PERIOD'
|
||||
</span><span class=input>
|
||||
% param 'FreqOffice' => $mai_datas->{freqoffice} unless param 'FreqOffice';
|
||||
%= select_field 'FreqOffice' => $c->fetchmail_freq(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_FETCH_PERIOD_NIGHTS'
|
||||
</span><span class=input>
|
||||
% param 'FreqOutside' => $mai_datas->{freqoutside} unless param 'FreqOutside';
|
||||
%= select_field 'FreqOutside' => $c->fetchmail_freq(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_FETCH_PERIOD_WEEKENDS'
|
||||
</span><span class=input>
|
||||
% param 'FreqWeekend' => $mai_datas->{freqweekend} unless param 'FreqWeekend';
|
||||
%= select_field 'FreqWeekend' => $c->fetchmail_freq(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_POP_ACCOUNT'
|
||||
</span><span class=input>
|
||||
% param 'SecondaryMailAccount' => $mai_datas->{secondarymailaccount} unless param 'SecondaryMailAccount';
|
||||
%= text_field 'SecondaryMailAccount', class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_POP_PASS'
|
||||
</span><span class=input>
|
||||
% param 'SecondaryMailPassword' => $mai_datas->{secondarymailpassword} unless param 'SecondaryMailPassword';
|
||||
%= password_field 'SecondaryMailPassword', class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SORT_METHOD'
|
||||
</span><span class=input>
|
||||
% param 'SpecifyHeader' => $mai_datas->{specifyheader} unless param 'SpecifyHeader';
|
||||
%= select_field 'SpecifyHeader' => [[(l 'mai_DEFAULT') => 'off'], [(l 'mai_SPECIFY_BELOW') => 'on']], class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SORT_HEADER'
|
||||
</span><span class=input>
|
||||
% param 'SecondaryMailEnvelope' => $mai_datas->{secondarymailenvelope} unless param 'SecondaryMailEnvelope';
|
||||
%= text_field 'SecondaryMailEnvelope', class => 'input'
|
||||
</span></p>
|
||||
|
||||
% my $btn = l('SAVE');
|
||||
%= submit_button "$btn", class => 'action'
|
||||
|
||||
%= hidden_field 'trt' => 'REC'
|
||||
% end
|
||||
|
||||
</div>
|
||||
%end
|
@@ -1,155 +1,70 @@
|
||||
% layout 'default', title => "Sme server 2 - emailsettings";
|
||||
|
||||
%#
|
||||
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
|
||||
%#
|
||||
% layout 'default', title => "Sme server 2 - E-Mail", share_dir => './';
|
||||
%# css specific to this panel:
|
||||
% content_for 'module' => begin
|
||||
|
||||
% use constant FALSE => 0;
|
||||
% use constant TRUE => 1;
|
||||
|
||||
<div id='module' class='module emailsettings-panel'>
|
||||
<div id="module" class="module Emailsettings-panel">
|
||||
|
||||
% if (config->{debug} == TRUE) {
|
||||
<p>
|
||||
%= dumper $c->current_route
|
||||
%= dumper $mai_datas
|
||||
</p>
|
||||
% if (config->{debug} == 1) {
|
||||
<pre>
|
||||
%= dumper $c->current_route
|
||||
%= dumper $mai_data->{trt}
|
||||
</pre>
|
||||
% }
|
||||
|
||||
<h1><%=$title%></h1>
|
||||
|
||||
% if ( stash('modul')) {
|
||||
%= $c->render_to_string(inline => stash('modul') );
|
||||
% }
|
||||
|
||||
% if ( stash 'error' ) {
|
||||
<br><div class=sme-error>
|
||||
%= $c->render_to_string(inline => stash 'error')
|
||||
</div>
|
||||
%}
|
||||
%if ($c->stash('first')) {
|
||||
<br><p>
|
||||
%=$c->render_to_string(inline =>$c->l($c->stash('first')))
|
||||
</p>
|
||||
|
||||
<h1><%= $title%></h1>
|
||||
%} elsif ($c->stash('success')) {
|
||||
<div class='success '>
|
||||
%= $c->l($c->stash('success'));
|
||||
</div>
|
||||
<br />
|
||||
|
||||
%= form_for 'emailsettings' => (method => 'POST') => begin
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_POP_ACCESS_CONTROL'
|
||||
</span><span class=data2>
|
||||
%= $c->get_current_pop3_access( TRUE )
|
||||
</span></p>
|
||||
%} elsif ($c->stash('error')) {
|
||||
<div class='sme-error'>
|
||||
%= $c->l($c->stash('error'));
|
||||
</div>
|
||||
<br />
|
||||
%}
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_IMAP_ACCESS_CONTROL'
|
||||
</span><span class=data2>
|
||||
%= $c->get_current_imap_access( TRUE )
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_WEBMAIL'
|
||||
</span><span class=data2>
|
||||
%= $c->get_current_webmail_status( TRUE )
|
||||
</span></p>
|
||||
|
||||
% my $btn = l('mai_DESC_STATE_ACCESS_BUTTON');
|
||||
<div class='center'>
|
||||
%= submit_button "$btn", class => 'action'
|
||||
</div>
|
||||
|
||||
%= hidden_field 'trt' => 'ACC'
|
||||
% end
|
||||
<br>
|
||||
|
||||
<!--<hr class="sectionbar" />-->
|
||||
|
||||
%= form_for 'emailsettings' => (method => 'POST') => begin
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_VIRUS_SCAN'
|
||||
</span><span class=data2>
|
||||
%= $c->get_virus_status(TRUE)
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SPAM_SCAN'
|
||||
</span><span class=data2>
|
||||
%= $c->get_spam_status(TRUE)
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_BLOCK_EXECUTABLE_CONTENT'
|
||||
</span><span class=data2>
|
||||
%= $c->get_patterns_status(TRUE)
|
||||
</span></p>
|
||||
|
||||
% my $btn = l('mai_DESC_STATE_FILTERING_BUTTON');
|
||||
<div class='center'>
|
||||
%= submit_button "$btn", class => 'action'
|
||||
</div>
|
||||
|
||||
%= hidden_field 'trt' => 'FIL'
|
||||
% end
|
||||
<br>
|
||||
|
||||
<!--<hr class="sectionbar" />-->
|
||||
|
||||
%= form_for 'emailsettings' => (method => 'POST') => begin
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_MODE'
|
||||
</span><span class=data2>
|
||||
%= $mai_datas->{fetchmailmethod}
|
||||
</span></p>
|
||||
%#Routing to partials according to trt parameter.
|
||||
%#This ought to be cascading if/then/elsif, but is easier to just stack the if/then's rather like a case statement'
|
||||
|
||||
% if ($mai_data->{trt} eq "FRONT") {
|
||||
%= include 'partials/_mai_FRONT'
|
||||
%}
|
||||
|
||||
% if ($mai_data->{trt} eq "ACC") {
|
||||
%= include 'partials/_mai_ACC'
|
||||
%}
|
||||
|
||||
% if ($mai_data->{trt} eq "FIL") {
|
||||
%= include 'partials/_mai_FIL'
|
||||
%}
|
||||
|
||||
% if ($mai_data->{trt} eq "REC") {
|
||||
%= include 'partials/_mai_REC'
|
||||
%}
|
||||
|
||||
% if ($mai_data->{trt} eq "DEL") {
|
||||
%= include 'partials/_mai_DEL'
|
||||
%}
|
||||
|
||||
% my $smtp_mesg;
|
||||
|
||||
% $smtp_mesg=l('SMTP port %u allow client to authenticate:');
|
||||
<p><span class=label>
|
||||
%= sprintf($smtp_mesg,$c->get_db_prop('qpsmtpd','TCPPort',25));
|
||||
</span><span class=data2>
|
||||
%= $c->get_current_smtp_auth( TRUE )
|
||||
</span></p>
|
||||
|
||||
% $smtp_mesg=l('SMTPS SSL/TLS auth: port %u status:');
|
||||
<p><span class=label>
|
||||
%= sprintf($smtp_mesg,$c->get_db_prop('sqpsmtpd','TCPPort',465));
|
||||
</span><span class=data2>
|
||||
%= $c->get_current_smtp_ssl_auth( TRUE, 's', FALSE )
|
||||
</span></p>
|
||||
|
||||
% $smtp_mesg=l 'Submission port %u status:';
|
||||
<p><span class=label>
|
||||
%= sprintf($smtp_mesg,$c->get_db_prop('uqpsmtpd','TCPPort',587));
|
||||
</span><span class=data2>
|
||||
%= $c->get_current_smtp_ssl_auth( TRUE,'u', FALSE )
|
||||
</span></p>
|
||||
<br />
|
||||
|
||||
% my $btn = l('mai_DESC_STATE_RECEPTION_BUTTON');
|
||||
<div class='center'>
|
||||
%= submit_button "$btn", class => 'action'
|
||||
</div>
|
||||
|
||||
%= hidden_field 'trt' => 'REC'
|
||||
% end
|
||||
<br>
|
||||
|
||||
<!--<hr class="sectionbar" />-->
|
||||
|
||||
%= form_for 'emailsettings' => (method => 'POST') => begin
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_UNKNOWN'
|
||||
</span><span class=data2>
|
||||
%= $c->get_emailunknownuser_status( TRUE )
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_DELEGATE'
|
||||
</span><span class=data2>
|
||||
%= $c->get_value('DelegateMailServer')
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SMARTHOST'
|
||||
</span><span class=data2>
|
||||
%= $c->get_value('SMTPSmartHost')
|
||||
</span></p>
|
||||
|
||||
% my $btn = l('mai_DESC_STATE_DELIVERY_BUTTON');
|
||||
<div class='center'>
|
||||
%= submit_button "$btn", class => 'action'
|
||||
</div>
|
||||
|
||||
%= hidden_field 'trt' => 'DEL'
|
||||
% end
|
||||
|
||||
</div>
|
||||
%end
|
@@ -2,7 +2,6 @@
|
||||
PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
|
||||
"http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<!-- default +jquery -->
|
||||
<head>
|
||||
<title><%= $title %></title>
|
||||
<link rel="made" href="mailto:bugs%40koozali.org">
|
||||
@@ -11,27 +10,16 @@
|
||||
%= stylesheet '/css/new_sme.css'
|
||||
%= stylesheet '/css/new-sme-main.css'
|
||||
|
||||
|
||||
%# Replaced by consolidated (and rationlised) CSS files as above March 2025
|
||||
%#= stylesheet '/css/sme_core.css'
|
||||
%#= stylesheet '/css/sme_main.css'
|
||||
%#= stylesheet '/css/sme_menu.css'
|
||||
%#= stylesheet '/css/styles.css'
|
||||
%#= stylesheet '/css/sme-password.css'
|
||||
|
||||
%= content_for 'head_contrib'
|
||||
% if (config 'hasJquery') {
|
||||
%= include 'partials/_js_imports'
|
||||
%= include 'common_js'
|
||||
% if (config 'hasJquery') {
|
||||
%= include 'partials/_js_imports'
|
||||
%= include 'common_js'
|
||||
% }
|
||||
%= content_for 'refresh'
|
||||
|
||||
|
||||
%= content_for 'refresh'
|
||||
%= stylesheet '/js/datatables.min.css'
|
||||
|
||||
%= javascript '/js/datatables.min.js'
|
||||
|
||||
%= stylesheet '/js/jquery-ui.min.css'
|
||||
|
||||
%= javascript '/js/jquery-ui.min.js'
|
||||
%= javascript '/js/dataTables.buttons.min.js'
|
||||
%= javascript '/js/jszip.min.js'
|
||||
@@ -44,26 +32,23 @@
|
||||
|
||||
<link rel="stylesheet" href="/smanager/css/flag-icon.min.css">
|
||||
%= stylesheet '/css/sme-jquery-overrides.css'
|
||||
|
||||
<style>
|
||||
#busy-indicator {
|
||||
display: none;
|
||||
margin-top: 10px;
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
}
|
||||
.busy {
|
||||
cursor: wait; /* Change the cursor to a 'wait' cursor */
|
||||
}
|
||||
</style>
|
||||
|
||||
%# panel specific css file
|
||||
% my $controller = stash('controller');
|
||||
% if ($controller) {
|
||||
% my $css_path = "css/$controller.css";
|
||||
%# Use the url_for helper to generate the correct static file URL
|
||||
% if (app->static->file($css_path)) {
|
||||
<link rel="stylesheet" href="<%= url_for("/$css_path") %>">
|
||||
% }
|
||||
% }
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
% if ( not defined $c->session->{lang} ) {
|
||||
% SrvMngr::init_session ( $c );
|
||||
% }
|
||||
% if ( not defined $c->session->{lang} ) {
|
||||
% SrvMngr::init_session ( $c );
|
||||
% }
|
||||
|
||||
<div id="header">
|
||||
%= include 'partials/_header'
|
||||
% if ($c->is_logged_in && scalar @{SrvMngr::theme_list( $c )} > 1) {
|
||||
@@ -72,42 +57,40 @@
|
||||
</div>
|
||||
|
||||
<div id="container">
|
||||
% if (config 'hasJquery') {
|
||||
%= content 'js_toggleMenu'
|
||||
% }
|
||||
|
||||
% if (config 'hasJquery') {
|
||||
%= content 'js_toggleMenu'
|
||||
% }
|
||||
|
||||
<div id="navigation" class="col-md-3 module">
|
||||
%= include 'partials/_nav_menu'
|
||||
% if ( $c->is_logged_in ) {
|
||||
%= include 'partials/_user_menu'
|
||||
% }
|
||||
% if ( $c->is_admin ) {
|
||||
%= include 'partials/_navig2'
|
||||
% }
|
||||
</div>
|
||||
<div id="main" class="col-md-9">
|
||||
|
||||
%= include 'partials/_info'
|
||||
|
||||
% if (flash 'success') {
|
||||
<br><div class="success module">
|
||||
%= $c->render_to_string(inline => flash 'success')
|
||||
<div id="navigation" class="col-md-3 module">
|
||||
%= include 'partials/_nav_menu'
|
||||
% if ( $c->is_logged_in ) {
|
||||
%= include 'partials/_user_menu'
|
||||
% }
|
||||
% if ( $c->is_admin ) {
|
||||
%= include 'partials/_navig2'
|
||||
% }
|
||||
</div>
|
||||
% }
|
||||
% if ( flash 'warning' ) {
|
||||
<br><div class="sme-warning module">
|
||||
%= $c->render_to_string(inline => flash 'warning')
|
||||
|
||||
<div id="main" class="col-md-9">
|
||||
%= include 'partials/_info'
|
||||
% if (flash 'success') {
|
||||
<br><div class="success module">
|
||||
%= $c->render_to_string(inline => flash 'success')
|
||||
</div>
|
||||
% }
|
||||
% if ( flash 'warning' ) {
|
||||
<br><div class="sme-warning module">
|
||||
%= $c->render_to_string(inline => flash 'warning')
|
||||
</div>
|
||||
%}
|
||||
% if ( flash 'error' ) {
|
||||
<br><div class="sme-error module">
|
||||
%= $c->render_to_string(inline => flash 'error')
|
||||
</div>
|
||||
%}
|
||||
%= content 'module'
|
||||
%= include 'partials/_footer'
|
||||
</div>
|
||||
%}
|
||||
% if ( flash 'error' ) {
|
||||
<br><div class="sme-error module">
|
||||
%= $c->render_to_string(inline => flash 'error')
|
||||
</div>
|
||||
%}
|
||||
%= content 'module'
|
||||
%= include 'partials/_footer'
|
||||
</div>
|
||||
</div>
|
||||
|
||||
% if (config 'hasJquery') {
|
||||
@@ -115,23 +98,17 @@
|
||||
%= content 'js_togglePassword'
|
||||
% }
|
||||
|
||||
%= javascript '/js/sme-dataTable-setup.js'
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
// Handle form submission for any form
|
||||
$('form').on('submit', function(event) {
|
||||
// Disable the submit button
|
||||
$(this).find('button[type="submit"], input[type="submit"]').prop('disabled', true);
|
||||
// Show the busy indicator
|
||||
// $('#busy-indicator').show();
|
||||
|
||||
// Change the cursor to "wait"
|
||||
$('body').addClass('busy');
|
||||
});
|
||||
});
|
||||
</script>
|
||||
%= javascript '/js/sme-dataTable-setup.js'
|
||||
|
||||
%# Specific panel js code
|
||||
% $controller = stash('controller');
|
||||
% if ($controller) {
|
||||
% my $js_path = "js/$controller.js";
|
||||
%# Use the url_for helper to generate the correct static file URL
|
||||
% if (app->static->file($js_path)) {
|
||||
<script src="<%= url_for("/$js_path") %>"></script>
|
||||
% }
|
||||
% }
|
||||
|
||||
</body>
|
||||
</html>
|
@@ -6,12 +6,12 @@
|
||||
% my $router = $ln_datas->{router};
|
||||
|
||||
% if (config->{debug} == 1) {
|
||||
<p>
|
||||
%= dumper $c->current_route
|
||||
%= dumper $c->stash("ret")
|
||||
%= dumper %$ln_datas
|
||||
%= dumper $deletehosts
|
||||
</p>
|
||||
<pre>
|
||||
%= dumper $c->current_route
|
||||
%= dumper $c->stash("ret")
|
||||
%= dumper %$ln_datas
|
||||
%= dumper $deletehosts
|
||||
</pre>
|
||||
% }
|
||||
|
||||
%= form_for '/localnetworkse' => (method => 'POST') => begin
|
||||
@@ -56,4 +56,4 @@
|
||||
|
||||
%end
|
||||
|
||||
</div>
|
||||
</div>
|
@@ -8,9 +8,9 @@
|
||||
% my ($var1, $var2, $var3, $var4, $var5, $var6, $var7) = @vars;
|
||||
|
||||
% if ($c->app->config->{debug}) {
|
||||
<p>
|
||||
<pre>
|
||||
%= dumper { ret_data => \%ret }
|
||||
</p>
|
||||
</pre>
|
||||
% }
|
||||
|
||||
% if ($ret{ret} eq "") {
|
||||
|
@@ -0,0 +1,54 @@
|
||||
%#
|
||||
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
|
||||
%#
|
||||
<div id="Emailsettings-ACC" class="partial Emailsettings-ACC">
|
||||
%# <script>
|
||||
%# window.onload = function() {
|
||||
%# SelectInput();
|
||||
%# };
|
||||
%# </script>
|
||||
% if (config->{debug} == 1) {
|
||||
<pre>
|
||||
%= dumper $mai_data
|
||||
</pre>
|
||||
% }
|
||||
% my $btn = l('SAVE');
|
||||
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
|
||||
|
||||
<h2><%= $c->l('mai_DESC_STATE_ACCESS_BUTTON') %></h2><br>
|
||||
%= form_for "emailsettingsu" => (method => 'POST') => begin
|
||||
% param 'trt' => $mai_data->{trt} unless param 'trt';
|
||||
%= hidden_field 'trt' => $mai_data->{trt}
|
||||
%# Inputs etc in here.
|
||||
%=l 'mai_DESC_POP_ACCESS_CONTROL'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_POP_ACCESS_CONTROL'
|
||||
</span><span class=input>
|
||||
% param 'POPAccess' => $c->get_current_pop3_access() unless param 'POPAccess';
|
||||
%= select_field 'POPAccess' => $c->get_pop_opt(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
%=l 'mai_DESC_IMAP_ACCESS_CONTROL'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_IMAP_ACCESS_CONTROL'
|
||||
</span><span class=input>
|
||||
% param 'IMAPAccess' => $c->get_current_imap_access() unless param 'IMAPAccess';
|
||||
%= select_field 'IMAPAccess' => $c->get_imap_opt(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
%=l 'mai_DESC_WEBMAIL'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_WEBMAIL'
|
||||
</span><span class=input>
|
||||
% param 'WebMail' => $c->get_current_webmail_status() unless param 'WebMail';
|
||||
%= select_field 'WebMail' => $c->get_webmail_opt(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
%# ....
|
||||
%# Probably finally by a submit.
|
||||
%= submit_button $btn, class => 'action'
|
||||
%end
|
||||
</div>
|
@@ -0,0 +1,90 @@
|
||||
%#
|
||||
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
|
||||
%#
|
||||
<div id="Emailsettings-DEL" class="partial Emailsettings-DEL">
|
||||
%# <script>
|
||||
%# window.onload = function() {
|
||||
%# SelectInput();
|
||||
%# };
|
||||
%# </script>
|
||||
% if (config->{debug} == 1) {
|
||||
<pre>
|
||||
%= dumper $mai_data
|
||||
</pre>
|
||||
% }
|
||||
% my $btn = l('SAVE');
|
||||
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
|
||||
|
||||
<h2><%= $c->l('mai_DESC_STATE_DELIVERY_BUTTON') %></h2>
|
||||
%= form_for "emailsettingsu" => (method => 'POST') => begin
|
||||
% param 'trt' => $mai_data->{trt} unless param 'trt';
|
||||
%= hidden_field 'trt' => $mai_data->{trt}
|
||||
%# Inputs etc in here.
|
||||
<h2>
|
||||
%=l 'mai_TITLE_UNKNOWN'
|
||||
</h2>
|
||||
|
||||
%=l 'mai_DESC_UNKNOWN'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_UNKNOWN'
|
||||
</span><span class=input>
|
||||
% param 'EmailUnknownUser' => $mai_data->{emailunknownuser} unless param 'EmailUnknownUser';
|
||||
%= select_field 'EmailUnknownUser' => $c->get_emailunknownuser_opt(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
<!--<hr class='menubar' />-->
|
||||
<h2>
|
||||
%=l 'mai_TITLE_DELEGATE'
|
||||
</h2>
|
||||
|
||||
%=l 'mai_DESC_DELEGATE'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_DELEGATE'
|
||||
</span><span class=input>
|
||||
% param 'DelegateMailServer' => $mai_data->{delegatemailserver} unless param 'DelegateMailServer';
|
||||
%= text_field 'DelegateMailServer', class => 'input'
|
||||
</span></p>
|
||||
|
||||
<!--<hr class='sectionbar' />-->
|
||||
<h2>
|
||||
%=l 'mai_TITLE_SMARTHOST'
|
||||
</h2>
|
||||
|
||||
%=l 'mai_DESC_SMARTHOST'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SMARTHOST'
|
||||
</span><span class=input>
|
||||
% param 'SMTPSmartHost' => $mai_data->{smtpsmarthost} unless param 'SMTPSmartHost';
|
||||
%= text_field 'SMTPSmartHost', class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SMARTHOST_SMTPAUTH_STATUS'
|
||||
</span><span class=input>
|
||||
% param 'SMTPAUTHPROXY_status' => $mai_data->{smtpauthproxystatus} unless param 'SMTPAUTHPROXY_status';
|
||||
%= select_field 'SMTPAUTHPROXY_status' => [[(l 'DISABLED') => 'disabled'], [(l 'ENABLED') => 'enabled']], class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SMARTHOST_SMTPAUTH_USERID'
|
||||
</span><span class=input>
|
||||
% param 'SMTPAUTHPROXY_Userid' => $mai_data->{smtpauthproxyuserid} unless param 'SMTPAUTHPROXY_Userid';
|
||||
%= text_field 'SMTPAUTHPROXY_Userid', class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SMARTHOST_SMTPAUTH_PASSWD'
|
||||
</span><span class=input>
|
||||
% param 'SMTPAUTHPROXY_Passwd' => $mai_data->{smtpauthproxypassword} unless param 'SMTPAUTHPROXY_Passwd';
|
||||
%= password_field 'SMTPAUTHPROXY_Passwd', class => 'input'
|
||||
</span></p>
|
||||
|
||||
|
||||
%# ....
|
||||
%# Probably finally by a submit.
|
||||
%= submit_button $btn, class => 'action'
|
||||
%end
|
||||
</div>
|
@@ -0,0 +1,98 @@
|
||||
%#
|
||||
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
|
||||
%#
|
||||
<div id="Emailsettings-FIL" class="partial Emailsettings-FIL">
|
||||
%# <script>
|
||||
%# window.onload = function() {
|
||||
%# SelectInput();
|
||||
%# };
|
||||
%# </script>
|
||||
% if (config->{debug} == 1) {
|
||||
<pre>
|
||||
%= dumper $mai_data
|
||||
</pre>
|
||||
% }
|
||||
% my $btn = l('SAVE');
|
||||
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
|
||||
|
||||
<h2><%= $c->l('mai_DESC_STATE_FILTERING_BUTTON') %></h2><br>
|
||||
%= form_for "emailsettingsu" => (method => 'POST') => begin
|
||||
% param 'trt' => $mai_data->{trt} unless param 'trt';
|
||||
%= hidden_field 'trt' => $mai_data->{trt}
|
||||
%# Inputs etc in here.
|
||||
%=l 'mai_DESC_VIRUS_SCAN'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_VIRUS_SCAN'
|
||||
</span><span class=input>
|
||||
% param 'VirusStatus' => $mai_data->{virusstatus} unless param 'VirusStatus';
|
||||
%= select_field 'VirusStatus' => [[(l 'DISABLED') => 'disabled'], [ (l 'ENABLED') => 'enabled']], class => 'input'
|
||||
</span><br></p>
|
||||
|
||||
%=l 'mai_DESC_SPAM_SCAN'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SPAM_SCAN'
|
||||
</span><span class=input>
|
||||
% param 'Spamstatus' => $mai_data->{spamstatus} unless param 'Spamstatus';
|
||||
%= select_field 'Spamstatus' => [[(l 'DISABLED') => 'disabled'], [ (l 'ENABLED') => 'enabled']], class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SPAM_SENSITIVITY'
|
||||
</span><span class=input>
|
||||
% param 'SpamSensitivity' => $mai_data->{spamsensitivity} unless param 'SpamSensitivity';
|
||||
%= select_field 'SpamSensitivity' => $c->get_spam_sensitivity_opt(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SPAM_TAGLEVEL'
|
||||
</span><span class=input>
|
||||
% param 'SpamTagLevel' => $mai_data->{spamtaglevel} unless param 'SpamTagLevel';
|
||||
%= select_field 'SpamTagLevel' => $c->get_spam_level_options(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SPAM_REJECTLEVEL'
|
||||
</span><span class=input>
|
||||
% param 'SpamRejectLevel' => $mai_data->{spamrejectlevel} unless param 'SpamRejectLevel';
|
||||
%= select_field 'SpamRejectLevel' => $c->get_spam_level_options(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SORTSPAM'
|
||||
</span><span class=input>
|
||||
% param 'SpamSortSpam' => $mai_data->{spamsortspam} unless param 'SpamSortSpam';
|
||||
%= select_field 'SpamSortSpam' => [[(l 'DISABLED') => 'disabled'], [ (l 'ENABLED') => 'enabled']], class => 'input'
|
||||
</span></p>
|
||||
|
||||
%=l 'mai_DESC_SPAM_SUBJECT'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SPAM_SUBJECTTAG'
|
||||
</span><span class=input>
|
||||
% param 'SpamSubjectTag' => $mai_data->{spamsubjecttag} unless param 'SpamSubjectTag';
|
||||
%= select_field 'SpamSubjectTag' => [[(l 'DISABLED') => 'disabled'], [ (l 'ENABLED') => 'enabled']], class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SPAM_SUBJECT'
|
||||
</span><span class=input>
|
||||
% param 'SpamSubject' => $mai_data->{spamsubject} unless param 'SpamSubject';
|
||||
%= text_field 'SpamSubject' => class => 'input'
|
||||
</span></p>
|
||||
|
||||
%=l 'mai_DESC_BLOCK_EXECUTABLE_CONTENT'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_CONTENT_TO_BLOCK'
|
||||
</span><span class=input>
|
||||
% param 'BlockExecutableContent' => $c->get_patterns_current_opt() unless param 'BlockExecutableContent';
|
||||
%= select_field 'BlockExecutableContent' => $c->get_patterns_opt(), class => 'input', multiple => "1"
|
||||
</span></p>
|
||||
|
||||
%# ....
|
||||
%# Probably finally by a submit.
|
||||
%= submit_button $btn, class => 'action'
|
||||
%end
|
||||
</div>
|
@@ -0,0 +1,152 @@
|
||||
%#
|
||||
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
|
||||
%#
|
||||
<div id="Emailsettings-FRONT" class="partial Emailsettings-FRONT">
|
||||
%# <script>
|
||||
%# window.onload = function() {
|
||||
%# SelectInput();
|
||||
%# };
|
||||
%# </script>
|
||||
% if (config->{debug} == 1) {
|
||||
<pre>
|
||||
%= dumper $mai_data
|
||||
<br>
|
||||
</pre>
|
||||
% }
|
||||
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
|
||||
% my $btn = l('Modify');
|
||||
<fieldset>
|
||||
<legend><%= $c->l('mai_DESC_STATE_ACCESS_BUTTON') %></legend>
|
||||
%= form_for 'emailsettings' => (method => 'POST') => begin
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_POP_ACCESS_CONTROL'
|
||||
</span><span class=data2>
|
||||
%= $c->get_current_pop3_access( TRUE )
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_IMAP_ACCESS_CONTROL'
|
||||
</span><span class=data2>
|
||||
%= $c->get_current_imap_access( TRUE )
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_WEBMAIL'
|
||||
</span><span class=data2>
|
||||
%= $c->get_current_webmail_status( TRUE )
|
||||
</span></p>
|
||||
|
||||
<br>
|
||||
<div class='center'>
|
||||
%= submit_button "$btn", class => 'action'
|
||||
</div>
|
||||
|
||||
%= hidden_field 'trt' => 'ACC'
|
||||
% end
|
||||
</fieldset>
|
||||
<br>
|
||||
|
||||
|
||||
<fieldset>
|
||||
<legend><%= $c->l('mai_DESC_STATE_FILTERING_BUTTON') %></legend>
|
||||
%= form_for 'emailsettings' => (method => 'POST') => begin
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_VIRUS_SCAN'
|
||||
</span><span class=data2>
|
||||
%= $c->get_virus_status(TRUE)
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SPAM_SCAN'
|
||||
</span><span class=data2>
|
||||
%= $c->get_spam_status(TRUE)
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_BLOCK_EXECUTABLE_CONTENT'
|
||||
</span><span class=data2>
|
||||
%= $c->get_patterns_status(TRUE)
|
||||
</span></p>
|
||||
|
||||
<br>
|
||||
<div class='center'>
|
||||
%= submit_button "$btn", class => 'action'
|
||||
</div>
|
||||
|
||||
%= hidden_field 'trt' => 'FIL'
|
||||
% end
|
||||
</fieldset>
|
||||
<br>
|
||||
|
||||
<fieldset>
|
||||
<legend><%= $c->l('mai_DESC_STATE_RECEPTION_BUTTON') %></legend>
|
||||
%= form_for 'emailsettings' => (method => 'POST') => begin
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_MODE'
|
||||
</span><span class=data2>
|
||||
%= $mai_data->{fetchmailmethod}
|
||||
</span></p>
|
||||
|
||||
% my $smtp_mesg;
|
||||
|
||||
% $smtp_mesg=l('mai_SMTP_port_authenticate');
|
||||
<p><span class=label>
|
||||
%= sprintf($smtp_mesg,$c->get_db_prop('qpsmtpd','TCPPort',25));
|
||||
</span><span class=data2>
|
||||
%= $c->get_current_smtp_auth( TRUE )
|
||||
</span></p>
|
||||
|
||||
% $smtp_mesg=l('mai_SMTPS_SSL/TLS');
|
||||
<p><span class=label>
|
||||
%= sprintf($smtp_mesg,$c->get_db_prop('sqpsmtpd','TCPPort',465));
|
||||
</span><span class=data2>
|
||||
%= $c->get_current_smtp_ssl_auth( TRUE, 's', FALSE )
|
||||
</span></p>
|
||||
|
||||
% $smtp_mesg=l 'mai_Submission_port';
|
||||
<p><span class=label>
|
||||
%= sprintf($smtp_mesg,$c->get_db_prop('uqpsmtpd','TCPPort',587));
|
||||
</span><span class=data2>
|
||||
%= $c->get_current_smtp_ssl_auth( TRUE,'u', FALSE )
|
||||
</span></p>
|
||||
<br />
|
||||
|
||||
<div class='center'>
|
||||
%= submit_button "$btn", class => 'action'
|
||||
</div>
|
||||
|
||||
%= hidden_field 'trt' => 'REC'
|
||||
% end
|
||||
</fieldset>
|
||||
<br>
|
||||
|
||||
<fieldset>
|
||||
<legend><%= $c->l('mai_DESC_STATE_DELIVERY_BUTTON') %></legend>
|
||||
%= form_for 'emailsettings' => (method => 'POST') => begin
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_UNKNOWN'
|
||||
</span><span class=data2>
|
||||
%= $c->get_emailunknownuser_status( TRUE )
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_DELEGATE'
|
||||
</span><span class=data2>
|
||||
%= $c->get_value('DelegateMailServer')
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SMARTHOST'
|
||||
</span><span class=data2>
|
||||
%= $c->get_value('SMTPSmartHost')
|
||||
</span></p>
|
||||
|
||||
<br>
|
||||
<div class='center'>
|
||||
%= submit_button "$btn", class => 'action'
|
||||
</div>
|
||||
|
||||
%= hidden_field 'trt' => 'DEL'
|
||||
% end
|
||||
</fieldset>
|
||||
</div>
|
@@ -0,0 +1,159 @@
|
||||
%#
|
||||
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-06-29 08:53:20
|
||||
%#
|
||||
<div id="Emailsettings-REC" class="partial Emailsettings-REC">
|
||||
%# <script>
|
||||
%# window.onload = function() {
|
||||
%# SelectInput();
|
||||
%# };
|
||||
%# </script>
|
||||
% if (config->{debug} == 1) {
|
||||
<pre>
|
||||
%= dumper $mai_data
|
||||
</pre>
|
||||
% }
|
||||
% my $btn = l('SAVE');
|
||||
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
|
||||
|
||||
<h2><%= $c->l('mai_DESC_STATE_RECEPTION_BUTTON') %></h2><br>
|
||||
%= form_for "emailsettingsu" => (method => 'POST') => begin
|
||||
% param 'trt' => $mai_data->{trt} unless param 'trt';
|
||||
%= hidden_field 'trt' => $mai_data->{trt}
|
||||
%# Inputs etc in here.
|
||||
%=l 'mai_DESC_MODE'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_MODE'
|
||||
</span><span class=input>
|
||||
% param 'FetchmailMethod' => $mai_data->{fetchmailmethod} unless param 'FetchmailMethod';
|
||||
<!--
|
||||
<pre>
|
||||
%= dumper $mai_data->{fetchmailmethod}
|
||||
%= dumper $c->get_retrieval_opt()
|
||||
%= param 'FetchmailMethod'
|
||||
</pre>
|
||||
-->
|
||||
%= select_field 'FetchmailMethod' => $c->get_retrieval_opt(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
%#=l 'mai_DESC_SMTP_AUTH_CONTROL'
|
||||
<br />
|
||||
%= l "mai_SMTP_port_(25)"
|
||||
<br />
|
||||
%= l "mai_SMTPS_port_(465)"
|
||||
<br />
|
||||
%= l "mai_SMTP_Submission"
|
||||
<br />
|
||||
|
||||
% my $smtp_mesg=l('mai_SMTP_port_authenticate');
|
||||
<p><span class=label>
|
||||
%= sprintf($smtp_mesg,$c->get_db_prop('qpsmtpd','TCPPort',25));
|
||||
</span><span class=input>
|
||||
% param 'SMTPAuth' => $c->get_current_smtp_auth( FALSE ) unless param 'SMTPAuth';
|
||||
<!--
|
||||
<pre>
|
||||
%= dumper $c->get_smtp_auth_opt()
|
||||
%= dumper $c->get_current_smtp_auth(FALSE)
|
||||
%= dumper $c->get_db_prop("qpsmtpd","Authentication")
|
||||
%= param 'SMTPAuth'
|
||||
</pre>
|
||||
-->
|
||||
%= select_field 'SMTPAuth' => $c->get_smtp_auth_opt(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
% my $smtp_mesg=l('SMTPS SSL/TLS auth: port %u status:');
|
||||
<p><span class=label>
|
||||
%= sprintf($smtp_mesg,$c->get_db_prop('sqpsmtpd','TCPPort',465));
|
||||
</span><span class=input>
|
||||
% param 'sSMTPAuth' => $c->get_current_smtp_ssl_auth(FALSE,'s', TRUE) unless param 'sSMTPAuth';
|
||||
|
||||
%= select_field 'sSMTPAuth' => $c->get_smtp_ssl_auth_opt(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
%my $smtp_mesg=l('Submission port %u status:');
|
||||
<p><span class=label>
|
||||
%= sprintf($smtp_mesg,$c->get_db_prop('uqpsmtpd','TCPPort',587));
|
||||
</span><span class=input>
|
||||
% param 'uSMTPAuth' => $c->get_current_smtp_ssl_auth(FALSE,'u', TRUE) unless param 'uSMTPAuth';
|
||||
<!--
|
||||
<pre>
|
||||
%= dumper $c->get_smtp_ssl_auth_opt()
|
||||
%= dumper $c->get_current_smtp_ssl_auth(FALSE,'s', TRUE)
|
||||
%= dumper $c->get_current_smtp_ssl_auth(FALSE,'u', TRUE)
|
||||
%= dumper $c->get_db_prop("uqpsmtpd","access")
|
||||
%= param 'uSMTPAuth'
|
||||
</pre>
|
||||
-->
|
||||
%= select_field 'uSMTPAuth' => $c->get_smtp_ssl_auth_opt(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
<!--<hr class="sectionbar" />-->
|
||||
<h2>
|
||||
%=l 'mai_TITLE_SECONDARY'
|
||||
</h2><br>
|
||||
|
||||
%=l 'mai_DESC_SECONDARY'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SECONDARY'
|
||||
</span><span class=input>
|
||||
% param 'SecondaryMailServer' => $mai_data->{secondarymailserver} unless param 'SecondaryMailServer';
|
||||
%= text_field 'SecondaryMailServer', class => 'input'
|
||||
</span></p>
|
||||
|
||||
%=l 'mai_DESC_FETCH_PERIOD'
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_FETCH_PERIOD'
|
||||
</span><span class=input>
|
||||
% param 'FreqOffice' => $mai_data->{freqoffice} unless param 'FreqOffice';
|
||||
%= select_field 'FreqOffice' => $c->fetchmail_freq(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_FETCH_PERIOD_NIGHTS'
|
||||
</span><span class=input>
|
||||
% param 'FreqOutside' => $mai_data->{freqoutside} unless param 'FreqOutside';
|
||||
%= select_field 'FreqOutside' => $c->fetchmail_freq(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_FETCH_PERIOD_WEEKENDS'
|
||||
</span><span class=input>
|
||||
% param 'FreqWeekend' => $mai_data->{freqweekend} unless param 'FreqWeekend';
|
||||
%= select_field 'FreqWeekend' => $c->fetchmail_freq(), class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_POP_ACCOUNT'
|
||||
</span><span class=input>
|
||||
% param 'SecondaryMailAccount' => $mai_data->{secondarymailaccount} unless param 'SecondaryMailAccount';
|
||||
%= text_field 'SecondaryMailAccount', class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_POP_PASS'
|
||||
</span><span class=input>
|
||||
% param 'SecondaryMailPassword' => $mai_data->{secondarymailpassword} unless param 'SecondaryMailPassword';
|
||||
%= password_field 'SecondaryMailPassword', class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SORT_METHOD'
|
||||
</span><span class=input>
|
||||
% param 'SpecifyHeader' => $mai_data->{specifyheader} unless param 'SpecifyHeader';
|
||||
%= select_field 'SpecifyHeader' => [[(l 'mai_DEFAULT') => 'off'], [(l 'mai_SPECIFY_BELOW') => 'on']], class => 'input'
|
||||
</span></p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l 'mai_LABEL_SORT_HEADER'
|
||||
</span><span class=input>
|
||||
% param 'SecondaryMailEnvelope' => $mai_data->{secondarymailenvelope} unless param 'SecondaryMailEnvelope';
|
||||
%= text_field 'SecondaryMailEnvelope', class => 'input'
|
||||
</span></p>
|
||||
|
||||
%# ....
|
||||
%# Probably finally by a submit.
|
||||
%= submit_button $btn, class => 'action'
|
||||
%end
|
||||
</div>
|
@@ -1,40 +1,37 @@
|
||||
<div id='pf_add'>
|
||||
|
||||
% my $retref= $c->stash("ret");
|
||||
% my %ret;
|
||||
% unless (length($retref)) {%ret = (ret=>"");}
|
||||
% else {%ret = %$retref;}
|
||||
|
||||
% my @vars = split(",",$ret{vars});
|
||||
% my $var1 = @vars[0];
|
||||
% my $var2 = @vars[1];
|
||||
% my $var3 = @vars[2];
|
||||
% my $var4 = @vars[3];
|
||||
% my $var5 = @vars[4];
|
||||
% my $var6 = @vars[5];
|
||||
% my %ret = $retref ? %$retref : (ret => "");
|
||||
% my @vars = split(/,/, $ret{vars} // '');
|
||||
% my ($var1, $var2, $var3, $var4, $var5, $var6, $var7) = @vars;
|
||||
|
||||
% if ($c->app->config->{debug}) {
|
||||
<pre>
|
||||
%= dumper { ret_data => \%ret }
|
||||
</pre>
|
||||
% }
|
||||
|
||||
% if ($ret{ret} eq "") {
|
||||
|
||||
% } elsif (index($ret{ret},"SUCCESS") != -1) {
|
||||
<br>
|
||||
%if ($ret{'ret'} eq "") {
|
||||
|
||||
%} elsif (index($ret{ret},"SUCCESS") != -1) {
|
||||
<div class='success'>
|
||||
<!--<h2> Operation Status Report</h2>-->
|
||||
%= $c->l($ret{ret},$var1,$var2,$var3,$var4,$var5,$var6);
|
||||
</div>
|
||||
%} else {
|
||||
<div class='sme-error'>
|
||||
<!--<h2> Operation Status Report - Error</h2>-->
|
||||
%= $c->l($ret{ret},$var1,$var2,$var3,$var4,$var5,$var6);
|
||||
</div>
|
||||
%}
|
||||
<div class='success'>
|
||||
%= $c->render_to_string(inline => l($ret{ret}, @vars[0..6]))
|
||||
</div>
|
||||
% } else {
|
||||
<br>
|
||||
<div class='sme-error'>
|
||||
%= $c->render_to_string(inline => l($ret{ret}, @vars[0..6]))
|
||||
</div>
|
||||
% }
|
||||
<br />
|
||||
% my $btn = l('ADD');
|
||||
|
||||
% if (config->{debug} == 1) {
|
||||
<p>
|
||||
</pre>
|
||||
%= dumper $c->current_route
|
||||
%= dumper $c->stash("ret")
|
||||
</p>
|
||||
</pre>
|
||||
% }
|
||||
|
||||
%= form_for '/portforwardingb' => (method => 'POST') => begin
|
||||
|
@@ -9,11 +9,11 @@
|
||||
% my $allow = $pf_datas->{allow};
|
||||
|
||||
% if (config->{debug} == 1) {
|
||||
<p>
|
||||
<pre>
|
||||
%= dumper $c->current_route
|
||||
%= dumper $c->stash("ret")
|
||||
%= dumper %$pf_datas
|
||||
</p>
|
||||
</pre>
|
||||
% }
|
||||
|
||||
%= form_for '/portforwardinge' => (method => 'POST') => begin
|
||||
@@ -63,4 +63,4 @@
|
||||
|
||||
%end
|
||||
|
||||
</div>
|
||||
</div>
|
@@ -2,37 +2,35 @@
|
||||
% my $btn = l('pf_CREATE_RULE');
|
||||
%= form_for '/portforwardinga' => (method => 'POST') => begin
|
||||
|
||||
% my $retref= $c->stash("ret");
|
||||
% my %ret;
|
||||
% unless (length($retref)) {%ret = (ret=>"");}
|
||||
% else {%ret = %$retref;}
|
||||
|
||||
% my $numtcpforwards = @$tcpforwards;
|
||||
% my $numudpforwards = @$udpforwards;
|
||||
|
||||
% my @vars = split(",",$ret{vars});
|
||||
% my $var1 = @vars[0];
|
||||
% my $var2 = @vars[1];
|
||||
% my $var3 = @vars[2];
|
||||
% my $var4 = @vars[3];
|
||||
% my $var5 = @vars[4];
|
||||
% my $var6 = @vars[5];
|
||||
% my $retref= $c->stash("ret");
|
||||
% my %ret = $retref ? %$retref : (ret => "");
|
||||
% my @vars = split(/,/, $ret{vars} // '');
|
||||
% my ($var1, $var2, $var3, $var4, $var5, $var6, $var7) = @vars;
|
||||
|
||||
% if ($c->app->config->{debug}) {
|
||||
<pre>
|
||||
%= dumper { ret_data => \%ret }
|
||||
</pre>
|
||||
% }
|
||||
|
||||
% if ($ret{ret} eq "") {
|
||||
%=l "pf_FIRST_PAGE_DESCRIPTION"
|
||||
% } elsif (index($ret{ret},"SUCCESS") != -1) {
|
||||
<br>
|
||||
<div class='success'>
|
||||
%= $c->render_to_string(inline => l($ret{ret}, @vars[0..6]))
|
||||
</div>
|
||||
% } else {
|
||||
<br>
|
||||
<div class='sme-error'>
|
||||
%= $c->render_to_string(inline => l($ret{ret}, @vars[0..6]))
|
||||
</div>
|
||||
% }
|
||||
<br />
|
||||
|
||||
%if ($ret{ret} eq "") {
|
||||
%= $c->render_to_string(inline => l('pf_FIRST_PAGE_DESCRIPTION'));
|
||||
%} elsif (index($ret{ret},"SUCCESS") != -1) {
|
||||
<br>
|
||||
<div class='success'>
|
||||
<!--<h2> Operation Status Report</h2>-->
|
||||
%= $c->l($ret{ret},$var1,$var2,$var3,$var4,$var5,$var6);
|
||||
</div>
|
||||
%} else {
|
||||
<br>
|
||||
<div class='sme-error'>
|
||||
<!--<h2> Operation Status Report - Error</h2>-->
|
||||
%= $c->l($ret{ret},$var1,$var2,$var3,$var4,$var5,$var6);
|
||||
</div>
|
||||
%}
|
||||
|
||||
<p>
|
||||
<br>
|
||||
@@ -69,7 +67,7 @@
|
||||
<th class='sme-border'>
|
||||
%=l 'pf_RULE_COMMENT'
|
||||
</th>
|
||||
<th class='sme-border' '>
|
||||
<th class='sme-border'>
|
||||
%=l 'ACTION'
|
||||
</th>
|
||||
</tr>
|
||||
|
@@ -1,6 +1,5 @@
|
||||
% layout 'default', title => "Sme server 2 - qmailanalog";
|
||||
% content_for 'module' => begin
|
||||
%= javascript '/js/qmailanalog.js'
|
||||
<div id='module' class='module qmailanalog-panel'>
|
||||
%if (config->{debug} == 1) {
|
||||
<p>
|
||||
|
@@ -25,6 +25,12 @@
|
||||
% my $btn = l('pwd_PASSWORD_CHANGE');
|
||||
% my $url = '/userpassword';
|
||||
%= $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' ) {
|
||||
% $btn = l('pwd_PASSWORD_RESET');
|
||||
% $url = '/userpasswordr';
|
||||
|
@@ -2,7 +2,7 @@ Summary: Sme server navigation module : manager 2
|
||||
%define name smeserver-manager
|
||||
Name: %{name}
|
||||
%define version 11.0.0
|
||||
%define release 90
|
||||
%define release 109
|
||||
Version: %{version}
|
||||
Release: %{release}%{?dist}
|
||||
License: GPL
|
||||
@@ -36,6 +36,7 @@ Requires: perl(Net::Netmask) >= 1.9
|
||||
Requires: perl(DBM::Deep) >= 2.0011-1
|
||||
Requires: perl(Mojo::JWT) >= 0.08-1
|
||||
#Requires: perl(Time::TAI64) >= 2.11
|
||||
Requires: perl(Data::Validate::IP)
|
||||
Requires: mutt >= 1.5.21
|
||||
Requires: smeserver-manager-jsquery >= 1.0
|
||||
Requires: smeserver-certificates >= 11.0
|
||||
@@ -138,15 +139,79 @@ then
|
||||
[ -h %{dir_mngr}/themes/default/public/js/jquery.min.map ] ||
|
||||
ln -s /usr/share/javascript/jquery/latest/jquery.min.map %{dir_mngr}/themes/default/public/js/jquery.min.map
|
||||
fi
|
||||
find %{dir_mngr}/lib/SrvMngr/I18N/Modules -type f -name '*.pm' -exec rm '{}' \;
|
||||
true
|
||||
|
||||
%files -f %{name}-%{version}-%{release}-filelist
|
||||
%defattr(-,root,root)
|
||||
|
||||
%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
|
||||
- Email Settings panel: Fix lex strings with long names and no prefix [SME: 13080]
|
||||
|
||||
* Mon Jul 14 2025 Brian Read <brianr@koozali.org> 11.0.0-106.sme
|
||||
- Datetime panel: Typo in error message - missing _ [SME: 13078]
|
||||
- ditto user accounts panel [SME: 13078]
|
||||
- ditto groups panel [SME: 13078]
|
||||
|
||||
* Mon Jul 14 2025 Brian Read <brianr@koozali.org> 11.0.0-105.sme
|
||||
- Adjust db opening in Software install panel [SME: 13077]
|
||||
|
||||
* Mon Jul 07 2025 Brian Read <brianr@koozali.org> 11.0.0-104.sme
|
||||
- Fix DB not open in Workgrouyp panel sometimes. [SME: 13070]
|
||||
|
||||
* Thu Jul 03 2025 Brian Read <brianr@koozali.org> 11.0.0-103.sme
|
||||
- Fix a couple of typos [SME: 13065]
|
||||
|
||||
* Thu Jul 03 2025 Brian Read <brianr@koozali.org> 11.0.0-102.sme
|
||||
- Local Network panel: Make DEL and ADD robust even if called more than once by browser [SME: 13065]
|
||||
|
||||
* Wed Jul 02 2025 Brian Read <brianr@koozali.org> 11.0.0-101.sme
|
||||
- Fix busy cursor, csp intervened. [SME: 13064]
|
||||
|
||||
* Tue Jul 01 2025 Brian Read <brianr@koozali.org> 11.0.0-100.sme
|
||||
- Add code in top template default.html.ep to incorporate any panel specific js and css [SME: 13062]
|
||||
|
||||
* Mon Jun 30 2025 Brian Read <brianr@koozali.org> 11.0.0-99.sme
|
||||
- Directory panel - Add in open for config db as required by cacheing [SME: 13059]
|
||||
|
||||
* Sun Jun 29 2025 Brian Read <brianr@koozali.org> 11.0.0-98.sme
|
||||
- Re-factor email settings panel as error handling not working as expected. [SME: 12973]
|
||||
|
||||
* Sat Jun 28 2025 Brian Read <brianr@koozali.org> 11.0.0-97.sme
|
||||
- fix error handling in emailsettings panel [SME: 12973]
|
||||
|
||||
* Fri Jun 27 2025 Brian Read <brianr@koozali.org> 11.0.0-96.sme
|
||||
- Remove *.en files on install in spec file [SME: 13061]
|
||||
|
||||
* Tue Jun 24 2025 Brian Read <brianr@koozali.org> 11.0.0-95.sme
|
||||
- Add clock ticker to datetime panel [SME: 13054]
|
||||
- Add Test Server button for ntp server [SME: 13048]
|
||||
- Add checking that date is fully valid [SME: 13055]
|
||||
|
||||
* Thu Jun 19 2025 Brian Read <brianr@koozali.org> 11.0.0-94.sme
|
||||
- re-instate datetime routes in SrvMngr.pm - removed by mistake [SME: 13053]
|
||||
|
||||
* Thu Jun 19 2025 Brian Read <brianr@koozali.org> 11.0.0-93.sme
|
||||
- Sort out case of first letter of ctlact in routes added in from header on controller file [SME: 13053]
|
||||
|
||||
* Sun Jun 15 2025 Brian Read <brianr@koozali.org> 11.0.0-92.sme
|
||||
- rework datetime panel [SME: 13020]
|
||||
- Fix errors in error messages for local networks panel [SME: 13044]
|
||||
- Add in Config Db open in Proxy.pm needed after UTF8 change [SME: 13046]
|
||||
|
||||
* Fri Jun 13 2025 Brian Read <brianr@koozali.org> 11.0.0-91.sme
|
||||
- Port Forwarding - Same error as in local networking [SME: 13043]
|
||||
|
||||
* Thu Jun 12 2025 Brian Read <brianr@koozali.org> 11.0.0-90.sme
|
||||
- Error on empty extra chars for success message [SME: 13041]
|
||||
- Needed extra open for network-db after add
|
||||
- Local Networks - Error on empty extra chars for success message [SME: 13041]
|
||||
Needed extra open for network-db after add
|
||||
|
||||
* Thu Jun 12 2025 Brian Read <brianr@koozali.org> 11.0.0-89.sme
|
||||
- rework navigation weights to avoid duplicates [SME: 12996]
|
||||
@@ -161,7 +226,7 @@ true
|
||||
|
||||
* Mon Jun 09 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.0.0-85.sme
|
||||
- fix ln_add templates for UTF8 [SME: 13030]
|
||||
- remove extraneous require line in spec file
|
||||
remove extraneous require line in spec file
|
||||
|
||||
* Mon Jun 09 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-84.sme
|
||||
- fix Directory caching issue [SME: 13026]
|
||||
@@ -181,11 +246,11 @@ true
|
||||
|
||||
* Thu Apr 17 2025 Brian Read <brianr@koozali.org> 11.0.0-78.sme
|
||||
- typo in remoteaccess panel
|
||||
- Fix crash in veiwlogfiles if viewlogfiles key not in DB
|
||||
Fix crash in veiwlogfiles if viewlogfiles key not in DB
|
||||
|
||||
* Sat Apr 12 2025 Brian Read <brianr@koozali.org> 11.0.0-77.sme
|
||||
- Sort out local and pulic access setting in remote panel [SME: 12988]
|
||||
- caching problem, plus confusion between normal and public setting in sshd / access in DB
|
||||
caching problem, plus confusion between normal and public setting in sshd / access in DB
|
||||
|
||||
* Fri Apr 11 2025 Brian Read <brianr@koozali.org> 11.0.0-76.sme
|
||||
- Restore css for roundcube embedded [SME: 12987]
|
||||
@@ -198,36 +263,36 @@ true
|
||||
- Fix error message and success message format in Local Networking panel [SME: 12969]
|
||||
|
||||
* Tue Mar 25 2025 Brian Read <brianr@koozali.org> 11.0.0-73.sme
|
||||
- Some changes to error message format in css.
|
||||
Some changes to error message format in css.
|
||||
- Fix DB Cache problem with port forwarding panel [SME: 12970]
|
||||
- Fix error and success message display for port forwarding panel [SME: 12969]
|
||||
|
||||
* Mon Mar 24 2025 Brian Read <brianr@koozali.org> 11.0.0-72.sme
|
||||
- Remove css files from template structure [SME: 12967]
|
||||
- Rationalise and merge css files
|
||||
- Adjust some gaps around panels
|
||||
- Remove HR lines
|
||||
Rationalise and merge css files
|
||||
Adjust some gaps around panels
|
||||
Remove HR lines
|
||||
|
||||
* Thu Mar 20 2025 Brian Read <brianr@koozali.org> 11.0.0-71.sme
|
||||
- Sort out navigation menu error on startup [SME: 12946]
|
||||
- More places where floating panel needed
|
||||
- Adjust floating panel to make space around it the same
|
||||
- clean up some css
|
||||
More places where floating panel needed
|
||||
Adjust floating panel to make space around it the same
|
||||
clean up some css
|
||||
|
||||
* Wed Mar 19 2025 Brian Read <brianr@koozali.org> 11.0.0-70.sme
|
||||
- Re-cast the default theme - use proper koozali logo image, unwind multiple divs
|
||||
- Enhance responsiveness
|
||||
- Revert Ibay menu name to Ibays
|
||||
- Remove legacy SM1 button on header
|
||||
- Remove "?" access to wiki help on header
|
||||
Re-cast the default theme - use proper koozali logo image, unwind multiple divs
|
||||
Enhance responsiveness
|
||||
Revert Ibay menu name to Ibays
|
||||
Remove legacy SM1 button on header
|
||||
Remove "?" access to wiki help on header
|
||||
|
||||
* Mon Mar 17 2025 Brian Read <brianr@koozali.org> 11.0.0-69.sme
|
||||
- Add a total summary report across all existing logs [SME: 12951]
|
||||
|
||||
* Mon Mar 17 2025 Brian Read <brianr@koozali.org> 11.0.0-68.sme
|
||||
- re-write qmailanalog for postfix [SME: 12951]
|
||||
- Clean up backup.pm
|
||||
- Enhance module panel - used by mail log analysis and Licence display
|
||||
Clean up backup.pm
|
||||
Enhance module panel - used by mail log analysis and Licence display
|
||||
|
||||
* Tue Mar 11 2025 Brian Read <brianr@koozali.org> 11.0.0-66.sme
|
||||
- Move the button for each backup panel to the left to conform to all the other panels.
|
||||
@@ -240,8 +305,8 @@ true
|
||||
|
||||
* Thu Mar 06 2025 Brian Read <brianr@koozali.org> 11.0.0-63.sme
|
||||
- Add boot.svg image to Bug Report panel [SME: 12953]
|
||||
- Move report template to inside smanager tree
|
||||
- Add one-off systemd task to create boot.svg run from panel
|
||||
Move report template to inside smanager tree
|
||||
Add one-off systemd task to create boot.svg run from panel
|
||||
|
||||
* Tue Mar 04 2025 Brian Read <brianr@koozali.org> 11.0.0-62.sme
|
||||
- Update *_en.lex files to conform to standard english punctuation [SME: 11809]
|
||||
@@ -278,16 +343,16 @@ true
|
||||
|
||||
* Mon Feb 10 2025 Brian Read <brianr@koozali.org> 11.0.0-51.sme
|
||||
- Replace url in call to webmail by browser url rather than system host and domain [SME: 12910]
|
||||
- Fix up CSS so not inline
|
||||
Fix up CSS so not inline
|
||||
- Sort out reveiw panel missing routines from FormMagic [SME: 12907].
|
||||
|
||||
* Sun Feb 09 2025 Brian Read <brianr@koozali.org> 11.0.0-50.sme
|
||||
- Move all routines from FormMagic still called by SM2 panels to SM2 [SME: 12906]
|
||||
- delete all references to FormMagic
|
||||
delete all references to FormMagic
|
||||
|
||||
* 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
|
||||
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]
|
||||
|
||||
* Wed Jan 29 2025 Brian Read <brianr@koozali.org> 11.0.0-48.sme
|
||||
@@ -295,11 +360,11 @@ true
|
||||
|
||||
* Tue Jan 28 2025 Brian Read <brianr@koozali.org> 11.0.0-47.sme
|
||||
- Temp (we hope) remove CSRF protection plugin [SME: ]
|
||||
- Fix comparison in footer with config->mode
|
||||
Fix comparison in footer with config->mode
|
||||
|
||||
* Tue Jan 28 2025 Brian Read <brianr@koozali.org> 11.0.0-46.sme
|
||||
- Adjust conditions for showing "Reconfigure required" to only check UnSavedChanges DB entry [SME: 12891]
|
||||
- Add indication of development mode in footer
|
||||
Add indication of development mode in footer
|
||||
|
||||
* Sat Jan 25 2025 Brian Read <brianr@koozali.org> 11.0.0-45.sme
|
||||
- Add some space in the reboot/reconf/shutdown panel [SME: ]
|
||||
@@ -313,7 +378,7 @@ true
|
||||
|
||||
* Thu Jan 23 2025 Brian Read <brianr@koozali.org> 11.0.0-43.sme
|
||||
- fix access to config file though config plugin for mojo 9.39 [SME: 12885]
|
||||
- Fix password setting for useraccounts and also adjust DB opens
|
||||
Fix password setting for useraccounts and also adjust DB opens
|
||||
- Add mojo version to footer for logged in [SME: 12886]
|
||||
- Fix up css for red error message when multiline [SME: 12802]
|
||||
|
||||
@@ -353,7 +418,7 @@ true
|
||||
|
||||
* Wed Dec 18 2024 Brian Read <brianr@koozali.org> 11.0.0-32.sme
|
||||
- Fix for User and localnetwork panel [SME: 6278]
|
||||
- Fix menu entry for proxy to stop it moving
|
||||
Fix menu entry for proxy to stop it moving
|
||||
|
||||
* Tue Dec 17 2024 Brian Read <brianr@koozali.org> 11.0.0-31.sme
|
||||
- Edit html to avoid w3c html validation warnings [SME: 6278]
|
||||
@@ -388,7 +453,7 @@ true
|
||||
|
||||
* Mon Sep 23 2024 Brian Read <brianr@koozali.org> 11.0.0-21.sme
|
||||
- Remove both option for webmail [SME: 12744]
|
||||
- Add in re-open DB for portforwarding and email settings.
|
||||
Add in re-open DB for portforwarding and email settings.
|
||||
|
||||
* Mon Sep 23 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-20.sme
|
||||
- webmail switch panel to use roundcube [SME: 12742]
|
||||
@@ -405,7 +470,7 @@ true
|
||||
|
||||
* Wed Aug 21 2024 Brian Read <brianr@koozali.org> 11.0.0-16.sme
|
||||
- Typo uc DNF changed to lc dnf in Yum.pm [SME: 127245]
|
||||
- Monitor dnf running using dnf status file
|
||||
Monitor dnf running using dnf status file
|
||||
|
||||
* Wed Aug 21 2024 Brian Read <brianr@koozali.org> 11.0.0-15.sme
|
||||
- Migrate SM2 Software installer panel from use of yum to dnf [SME: 12718]
|
||||
@@ -415,7 +480,7 @@ true
|
||||
|
||||
* Sun Jul 28 2024 Brian Read <brianr@koozali.org> 11.0.0-13.sme
|
||||
- Fix sysles.css template - overwrote it by mistake [SME: 12706]
|
||||
- Also re-organised login and Legacy SM menus and help on top
|
||||
Also re-organised login and Legacy SM menus and help on top
|
||||
|
||||
* Sun Jul 28 2024 Brian Read <brianr@koozali.org> 11.0.0-12.sme
|
||||
- correct positio of flag-icon [SME: 12706]
|
||||
@@ -428,7 +493,7 @@ true
|
||||
|
||||
* Thu May 09 2024 Brian Read <brianr@koozali.org> 11.0.0-9.sme
|
||||
- Add mojo logo to footer [SME: 12679]
|
||||
- Fix default for HeaderWeight to avoid noise in logs if no Nav header in file
|
||||
Fix default for HeaderWeight to avoid noise in logs if no Nav header in file
|
||||
- Align buttons consistently [SME: 12680]
|
||||
|
||||
* Tue Apr 30 2024 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-8.sme
|
||||
@@ -470,7 +535,7 @@ true
|
||||
|
||||
* Tue Feb 27 2024 Brian Read <brianr@koozali.org> 0.1.4-31.sme
|
||||
- Sort options in mail log anaysis [SME: 11821]
|
||||
- Take out qmail-q options as need to run as root or qmail - see bug:12491
|
||||
Take out qmail-q options as need to run as root or qmail - see bug:12491
|
||||
|
||||
* Sat Feb 24 2024 Brian Read <brianr@koozali.org> 0.1.4-30.sme
|
||||
- Bring user menus into line with new menu structure [SME: 12482]
|
||||
@@ -497,17 +562,17 @@ true
|
||||
|
||||
* Tue Jan 30 2024 Brian Read <brianr@koozali.org> 0.1.4-23.sme
|
||||
- Arrange that jquery etc is local and from rpm smeserver-manager-jsquery [SME: 12459]
|
||||
- Correct position of % end in partial .html.ep files with tables in.
|
||||
- Make smeserver-mananger-jsquery a requirement
|
||||
- Move jquery overrides to jsquery rpm
|
||||
Correct position of % end in partial .html.ep files with tables in.
|
||||
Make smeserver-mananger-jsquery a requirement
|
||||
Move jquery overrides to jsquery rpm
|
||||
|
||||
* Sat Jan 27 2024 Brian Read <brianr@koozali.org> 0.1.4-22.sme
|
||||
- Update to use jquery plugin dataTables [SME: 12458]
|
||||
- Update Copyright footer to 2024
|
||||
- Edit tables to have TableSort in class
|
||||
- Fix up tables tbody and thead correctly
|
||||
- Sort out action column to make compatible with dataTable
|
||||
- Change action links to icons
|
||||
Update Copyright footer to 2024
|
||||
Edit tables to have TableSort in class
|
||||
Fix up tables tbody and thead correctly
|
||||
Sort out action column to make compatible with dataTable
|
||||
Change action links to icons
|
||||
|
||||
* Sun Dec 03 2023 Brian Read <brianr@koozali.org> 0.1.4-21.sme
|
||||
- Update CSS to provide feedback to hover and click on panel submit button [SME: 12442]
|
||||
@@ -515,7 +580,7 @@ true
|
||||
* Tue Apr 25 2023 Michel Begue <mab974@misouk.com> 0.1.4-20.sme
|
||||
- general locales for awstats [SME:12324b]
|
||||
- fix reconfigure asked when not needed [SME: 12171b]
|
||||
- remove unSafe status from session data
|
||||
remove unSafe status from session data
|
||||
|
||||
* Wed Dec 28 2022 Brian Read <brianr@bjsystems.co.uk> 0.1.4-19.sme
|
||||
- Fix requires in systemd smanager.server file [SME:12294]
|
||||
@@ -526,8 +591,8 @@ true
|
||||
* Mon Jul 18 2022 Michel Begue <mab974@misouk.com> 0.1.4-17.sme
|
||||
- add forgotten password link to login panel [SME: 11816]
|
||||
- update to httpd 2.4 syntax [SME: 12112]
|
||||
- enable backup of /usr/share/smanager/data
|
||||
- fix target in link to 'Previous SM'
|
||||
enable backup of /usr/share/smanager/data
|
||||
fix target in link to 'Previous SM'
|
||||
|
||||
* Sun Jul 17 2022 Jean-Philippe Pialasse <tests@pialasse.com> 0.1.4-16.sme
|
||||
- untainting datetime [SME: 12111]
|
||||
@@ -536,17 +601,17 @@ true
|
||||
- untainting printer [SME: 12110]
|
||||
|
||||
* Fri Jan 21 2022 Michel Begue <mab974@misouk.com> 0.1.4-14.sme
|
||||
- Fix jquery map link missing
|
||||
- Fix jquery link deleted during update
|
||||
- Remove generated file during remove
|
||||
Fix jquery map link missing
|
||||
Fix jquery link deleted during update
|
||||
Remove generated file during remove
|
||||
|
||||
* Wed Jan 05 2022 Brian Read <brianr@bjsystems.co.uk> 0.1.4-13.sme
|
||||
- Update-format-for-datetime-and-reboot [SME: 11830]
|
||||
|
||||
* Mon Jan 03 2022 Michel Begue <mab974@misouk.com> 0.1.4-12.sme
|
||||
- Add show password icon to login panel (requires jquery)
|
||||
- Extend toggle hide to section menu (requires jquery)
|
||||
- Set layout according to jquery presence
|
||||
Extend toggle hide to section menu (requires jquery)
|
||||
Set layout according to jquery presence
|
||||
- Set CSRF less strict for GET method. Only if csrftoken param exists [SME: 11789]
|
||||
|
||||
* Mon Dec 27 2021 Michel Begue <mab974@misouk.com> 0.1.4-10.sme
|
||||
@@ -572,22 +637,22 @@ true
|
||||
|
||||
* Mon Nov 15 2021 Michel Begue <mab974@misouk.com> 0.1.4-3.sme
|
||||
- Fix error message when linking, unlinking jquery in spec
|
||||
- Correct the 'review' panel presentation
|
||||
- Modify CSRFDefender plugin to take into account GET method
|
||||
- Add TOKEN param where the GET method is used in templates
|
||||
- Remove smanager from local url address
|
||||
Correct the 'review' panel presentation
|
||||
Modify CSRFDefender plugin to take into account GET method
|
||||
Add TOKEN param where the GET method is used in templates
|
||||
Remove smanager from local url address
|
||||
|
||||
* Mon Oct 11 2021 Michel Begue <mab974@protonmail.com> 0.1.4-2.sme
|
||||
- Fix incorrect list order (users, ibays, ...)
|
||||
- Add external private access (remote management)
|
||||
- Change CSRF error message
|
||||
Fix incorrect list order (users, ibays, ...)
|
||||
Add external private access (remote management)
|
||||
Change CSRF error message
|
||||
|
||||
* Mon Jun 21 2021 Michel Begue <mab974@gmail.com> 0.1.4-1.sme
|
||||
- New version: smeserver-manager-0.1.4-1 (= 0.1.2-13)
|
||||
|
||||
* Sat Jun 19 2021 Michel Begue <mab974@gmail.com> 0.1.2-13.sme
|
||||
- Remove non english locale files (move to smeserver-manager-locale)
|
||||
- Fix error in 'locale2-conf' action
|
||||
Fix error in 'locale2-conf' action
|
||||
|
||||
* Tue Jun 15 2021 Michel Begue <mab974@gmail.com> 0.1.2-12.sme
|
||||
- Fix errors in daily script
|
||||
|
Reference in New Issue
Block a user