Compare commits
	
		
			13 Commits
		
	
	
		
			11_0_0-81_
			...
			11_0_0-91_
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 0733537064 | |||
| dcc098b206 | |||
| 1a8f935431 | |||
| e8d6d39583 | |||
| 91201b7b02 | |||
| c85022c49e | |||
| fd076895ba | |||
| 
						 | 
					d993bd9d19 | ||
| 
						 | 
					a31806f205 | ||
| b44f1c5000 | |||
| 2538ac9ea0 | |||
| dbfeaa18a3 | |||
| ced08b28d4 | 
@@ -4,6 +4,7 @@ package SrvMngr;
 | 
			
		||||
use strict;
 | 
			
		||||
use warnings;
 | 
			
		||||
use utf8;
 | 
			
		||||
binmode(STDOUT);
 | 
			
		||||
 | 
			
		||||
use Mojo::Base 'Mojolicious';
 | 
			
		||||
 | 
			
		||||
@@ -29,6 +30,8 @@ use SrvMngr::Model::Main;
 | 
			
		||||
use SrvMngr::Plugin::WithoutCache;
 | 
			
		||||
 | 
			
		||||
use esmith::I18N;
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
use esmith::NavigationDB; # no UTF8 raw is ok for ASCII only flat file
 | 
			
		||||
 | 
			
		||||
# Import the function(s) you need
 | 
			
		||||
use SrvMngr_Auth qw(check_admin_access);
 | 
			
		||||
@@ -550,9 +553,6 @@ sub theme_list {
 | 
			
		||||
#------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
sub getNavigation {
 | 
			
		||||
 | 
			
		||||
    use esmith::NavigationDB;
 | 
			
		||||
 | 
			
		||||
    my $class  = shift; #not the controller as it is called as an external, not part of the controller.
 | 
			
		||||
    my $lang = shift || 'en-us';
 | 
			
		||||
    my $menu = shift || 'N';
 | 
			
		||||
@@ -573,7 +573,7 @@ sub getNavigation {
 | 
			
		||||
    # Added: Check if user is non-admin and get their allowed panels
 | 
			
		||||
    if ($username ne '') {
 | 
			
		||||
        # Get the AccountsDB to check user permissions
 | 
			
		||||
        my $accountsdb = esmith::AccountsDB->open_ro() or
 | 
			
		||||
        my $accountsdb = esmith::AccountsDB::UTF8->open_ro() or
 | 
			
		||||
            die "Couldn't open AccountsDB\n";
 | 
			
		||||
            
 | 
			
		||||
        # Check if user has AdminPanels property
 | 
			
		||||
@@ -646,8 +646,7 @@ sub getNavigation {
 | 
			
		||||
 | 
			
		||||
    my $navinfo = NAVIGATIONDIR . "/navigation.$lang";
 | 
			
		||||
 | 
			
		||||
    my $navdb = esmith::NavigationDB->open_ro( $navinfo ) or
 | 
			
		||||
	die "Couldn't open $navinfo\n";
 | 
			
		||||
    my $navdb = esmith::NavigationDB->open_ro( $navinfo ) or die "Couldn't open $navinfo\n"; # no UTF8
 | 
			
		||||
 | 
			
		||||
    # Check the navdb for anything with a UrlPath, which means that it doesn't
 | 
			
		||||
    # have a cgi file to be picked up by the above code. Ideally, only pages
 | 
			
		||||
@@ -814,7 +813,7 @@ sub get_routes_list {
 | 
			
		||||
 | 
			
		||||
    my $c  = shift;
 | 
			
		||||
 | 
			
		||||
    my $rtdb = esmith::ConfigDB->open_ro('routes') || die 'Cannot open Routes db';
 | 
			
		||||
    my $rtdb = esmith::ConfigDB::UTF8->open_ro('routes') || die 'Cannot open Routes db';
 | 
			
		||||
    my @routes = $rtdb->get_all();
 | 
			
		||||
    my @rt;
 | 
			
		||||
 | 
			
		||||
@@ -896,7 +895,7 @@ sub gen_locale_date_string
 | 
			
		||||
sub get_public_ip_address
 | 
			
		||||
{
 | 
			
		||||
    my $self = shift;
 | 
			
		||||
	my $cdb = esmith::ConfigDB->open() || die "Couldn't open config db";
 | 
			
		||||
	my $cdb = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
 | 
			
		||||
    my $sysconfig = $cdb->get('sysconfig');
 | 
			
		||||
    if ($sysconfig)
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ package SrvMngr::Controller::Backup;
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
# heading     : System
 | 
			
		||||
# description : Backup or restore
 | 
			
		||||
# navigation  : 4000 200
 | 
			
		||||
# navigation  : 4000 100
 | 
			
		||||
# Copyright (C) 2002 Mitel Networks Corporation
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
# routes : end
 | 
			
		||||
@@ -20,14 +20,14 @@ use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw(theme_list init_session ip_number_or_blank);
 | 
			
		||||
use Quota;
 | 
			
		||||
use esmith::ConfigDB;
 | 
			
		||||
use esmith::AccountsDB;
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
use esmith::AccountsDB::UTF8;
 | 
			
		||||
use esmith::util;
 | 
			
		||||
use File::Basename;
 | 
			
		||||
use File::Find;
 | 
			
		||||
use File::Path qw(make_path remove_tree);
 | 
			
		||||
use esmith::Backup;
 | 
			
		||||
use esmith::BackupHistoryDB;
 | 
			
		||||
use esmith::BackupHistoryDB; #no UTF8 and not in use 
 | 
			
		||||
use esmith::util;
 | 
			
		||||
use esmith::lockfile;
 | 
			
		||||
use esmith::BlockDevices;
 | 
			
		||||
@@ -36,9 +36,6 @@ use constant DEBUG => $ENV{MOJO_SMANAGER_DEBUG} || 0;
 | 
			
		||||
use constant FALSE => 0;
 | 
			
		||||
use constant TRUE  => 1;
 | 
			
		||||
 | 
			
		||||
#our $cdb = esmith::ConfigDB->open   || die "Couldn't open config db"; #remove as cached gives problems
 | 
			
		||||
#our $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
#our $rdb = esmith::ConfigDB->open('/etc/e-smith/restore') || die "Couldn't open restore db";
 | 
			
		||||
my ($cdb,$adb,$rdb);
 | 
			
		||||
my $es_backup = new esmith::Backup or die "Couldn't create Backup object\n";
 | 
			
		||||
my @directories = $es_backup->restore_list;
 | 
			
		||||
@@ -56,9 +53,9 @@ sub main {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
    $c->app->log->info($c->log_req);
 | 
			
		||||
    my %bac_datas = ();
 | 
			
		||||
	$cdb = esmith::ConfigDB->open   || die "Couldn't open config db";
 | 
			
		||||
	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
	$rdb = esmith::ConfigDB->open('/etc/e-smith/restore');
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open   || die "Couldn't open config db";
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
    $rdb = esmith::ConfigDB::UTF8->open('/etc/e-smith/restore');
 | 
			
		||||
    my $title     = $c->l('bac_BACKUP_TITLE');
 | 
			
		||||
    my $notif;
 | 
			
		||||
    $bac_datas{'function'} = 'desktop_backup';
 | 
			
		||||
@@ -115,9 +112,9 @@ sub do_display {
 | 
			
		||||
    my $rt = $c->current_route;
 | 
			
		||||
    my ($res, $result) = '';
 | 
			
		||||
    my $function = $c->param('Function');
 | 
			
		||||
	$cdb = esmith::ConfigDB->open   || die "Couldn't open config db";
 | 
			
		||||
	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
	$rdb = esmith::ConfigDB->open('/etc/e-smith/restore');
 | 
			
		||||
   $cdb = esmith::ConfigDB::UTF8->open   || die "Couldn't open config db";
 | 
			
		||||
   $adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
   $rdb = esmith::ConfigDB::UTF8->open('/etc/e-smith/restore');
 | 
			
		||||
 | 
			
		||||
    if ($function =~ /^(\S+)$/) {
 | 
			
		||||
        $function = $1;
 | 
			
		||||
@@ -142,7 +139,7 @@ sub do_display {
 | 
			
		||||
        $c->render(template=>"backdown");
 | 
			
		||||
        #sleep(30);
 | 
			
		||||
        # Redirect to the front page
 | 
			
		||||
		#$c->redirect_to('/backup');
 | 
			
		||||
        #$c->redirect_to('/backup');
 | 
			
		||||
        return ""
 | 
			
		||||
    } ## end if ($function eq 'desktop_backup')
 | 
			
		||||
 | 
			
		||||
@@ -279,9 +276,9 @@ sub do_update {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
    $c->app->log->info($c->log_req);
 | 
			
		||||
    my $rt       = $c->current_route;
 | 
			
		||||
	$cdb = esmith::ConfigDB->open   || die "Couldn't open config db";
 | 
			
		||||
	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
	$rdb = esmith::ConfigDB->open('/etc/e-smith/restore');
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open   || die "Couldn't open config db";
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
    $rdb = esmith::ConfigDB::UTF8->open('/etc/e-smith/restore');
 | 
			
		||||
    my $function = $c->param('Function');
 | 
			
		||||
    DEBUG && warn("do_update $function");
 | 
			
		||||
    my %bac_datas = ();
 | 
			
		||||
@@ -2132,4 +2129,4 @@ sub vmount {
 | 
			
		||||
        return (qx(/bin/mount -t nfs -o nolock,timeo=30,retrans=1,retry=0 "$host:/$share" $mountdir 2>&1));
 | 
			
		||||
    }
 | 
			
		||||
} ## end sub vmount
 | 
			
		||||
1;
 | 
			
		||||
1;
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ package SrvMngr::Controller::Bugreport;
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
# heading     : Investigation
 | 
			
		||||
# description : Report a bug
 | 
			
		||||
# navigation  : 7000 500
 | 
			
		||||
# navigation  : 7000 300
 | 
			
		||||
# routes : end
 | 
			
		||||
#------------------------------
 | 
			
		||||
use strict;
 | 
			
		||||
@@ -15,7 +15,8 @@ use SrvMngr qw(theme_list init_session);
 | 
			
		||||
use Text::Template;
 | 
			
		||||
use File::Basename;
 | 
			
		||||
use SrvMngr qw( gen_locale_date_string );
 | 
			
		||||
our $cdb = esmith::ConfigDB->open or die "Couldn't open ConfigDB\n";
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
our $cdb = esmith::ConfigDB::UTF8->open or die "Couldn't open ConfigDB\n";
 | 
			
		||||
 | 
			
		||||
use constant FALSE => 0;
 | 
			
		||||
use constant TRUE  => 1;
 | 
			
		||||
@@ -173,4 +174,4 @@ sub download_config_report {
 | 
			
		||||
        'cleanup'             => 1,
 | 
			
		||||
    );
 | 
			
		||||
} ## end sub download_config_report
 | 
			
		||||
1;
 | 
			
		||||
1;
 | 
			
		||||
 
 | 
			
		||||
@@ -13,9 +13,9 @@ use Mojo::Base 'Mojolicious::Controller';
 | 
			
		||||
use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw(theme_list init_session);
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
 | 
			
		||||
#package esmith::FormMagick::Panel::clamav;
 | 
			
		||||
our $db = esmith::ConfigDB->open() || die "Couldn't open config db";
 | 
			
		||||
our $db;
 | 
			
		||||
 | 
			
		||||
sub main {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
@@ -23,6 +23,7 @@ sub main {
 | 
			
		||||
    my %clm_datas = ();
 | 
			
		||||
    my $title     = $c->l('clm_FORM_TITLE');
 | 
			
		||||
    my $modul     = $c->render_to_string(inline => $c->l('clm_DESC_FILESYSTEM_SCAN_PERIOD'));
 | 
			
		||||
    $db = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
 | 
			
		||||
    $clm_datas{'FilesystemScan'} = ($db->get_prop('clamav', 'FilesystemScan')) || 'disabled';
 | 
			
		||||
    $clm_datas{'Quarantine'}     = ($db->get_prop('clamav', 'Quarantine'))     || 'disabled';
 | 
			
		||||
    $clm_datas{'clam_versions'}  = get_clam_versions();
 | 
			
		||||
@@ -53,6 +54,7 @@ sub do_update {
 | 
			
		||||
 | 
			
		||||
sub change_settings {
 | 
			
		||||
    my $c                  = shift;
 | 
			
		||||
    $db = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
 | 
			
		||||
    my $status             = $c->param('status');
 | 
			
		||||
    my $FilesystemScan     = ($c->param('FilesystemScan') || 'disabled');
 | 
			
		||||
    my $Quarantine         = ($c->param('Quarantine') || 'disabled');
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ package SrvMngr::Controller::Datetime;
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
# heading     : System
 | 
			
		||||
# description : Date and time
 | 
			
		||||
# navigation  : 4000 400
 | 
			
		||||
# navigation  : 4000 300
 | 
			
		||||
# routes : end
 | 
			
		||||
#------------------------------
 | 
			
		||||
use strict;
 | 
			
		||||
@@ -14,7 +14,8 @@ use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw(theme_list init_session);
 | 
			
		||||
use esmith::util;
 | 
			
		||||
use SrvMngr qw( gen_locale_date_string );
 | 
			
		||||
our $cdb = esmith::ConfigDB->open() || die "Couldn't open config db";
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
our $cdb ;
 | 
			
		||||
 | 
			
		||||
sub main {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
@@ -23,6 +24,7 @@ sub main {
 | 
			
		||||
    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) {
 | 
			
		||||
@@ -54,6 +56,7 @@ sub do_update {
 | 
			
		||||
    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) {
 | 
			
		||||
@@ -70,7 +73,7 @@ sub do_update {
 | 
			
		||||
        } else {
 | 
			
		||||
            $dat_datas{ntpserver} = ($cdb->get_prop('ntpd', 'NTPServer')) || '';
 | 
			
		||||
        }
 | 
			
		||||
        $dat_datas{now_string} = esmith::FormMagick->gen_locale_date_string();
 | 
			
		||||
        $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...})
 | 
			
		||||
@@ -125,6 +128,7 @@ sub do_update {
 | 
			
		||||
 | 
			
		||||
sub validate_change_datetime {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
 | 
			
		||||
 | 
			
		||||
    #--------------------------------------------------
 | 
			
		||||
    # Untaint parameters and check for validity
 | 
			
		||||
@@ -220,15 +224,14 @@ sub validate_change_datetime {
 | 
			
		||||
    #--------------------------------------------------
 | 
			
		||||
    # Store time zone in configuration database
 | 
			
		||||
    #--------------------------------------------------
 | 
			
		||||
    my $conf = esmith::ConfigDB->open();
 | 
			
		||||
    my $old  = $conf->get('UnsavedChanges')->value;
 | 
			
		||||
    my $rec  = $conf->get('TimeZone');
 | 
			
		||||
    my $old  = $cdb->get('UnsavedChanges')->value;
 | 
			
		||||
    my $rec  = $cdb->get('TimeZone');
 | 
			
		||||
 | 
			
		||||
    unless ($rec) {
 | 
			
		||||
        $rec = $conf->new_record('TimeZone', undef);
 | 
			
		||||
        $rec = $cdb->new_record('TimeZone', undef);
 | 
			
		||||
    }
 | 
			
		||||
    $rec->set_value($timezone);
 | 
			
		||||
    $conf->get('UnsavedChanges')->set_value($old);
 | 
			
		||||
    $cdb->get('UnsavedChanges')->set_value($old);
 | 
			
		||||
 | 
			
		||||
    #--------------------------------------------------
 | 
			
		||||
    # Signal event to change time zone, system time
 | 
			
		||||
@@ -353,4 +356,20 @@ sub getMonth_list {
 | 
			
		||||
        [ $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;
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ package SrvMngr::Controller::Directory;
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
# heading     : User management
 | 
			
		||||
# description : Directory
 | 
			
		||||
# navigation  : 2000 300
 | 
			
		||||
# navigation  : 2000 400
 | 
			
		||||
#
 | 
			
		||||
# routes : end
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
@@ -12,13 +12,16 @@ use warnings;
 | 
			
		||||
use Mojo::Base 'Mojolicious::Controller';
 | 
			
		||||
use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
use esmith::AccountsDB::UTF8;
 | 
			
		||||
use SrvMngr qw(theme_list init_session);
 | 
			
		||||
 | 
			
		||||
our $db = esmith::ConfigDB->open() || die "Couldn't open config db";
 | 
			
		||||
our $db; 
 | 
			
		||||
 | 
			
		||||
sub main {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
    $c->app->log->info($c->log_req);
 | 
			
		||||
    $db = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
 | 
			
		||||
    my %dir_datas = ();
 | 
			
		||||
    my $title     = $c->l('dir_FORM_TITLE');
 | 
			
		||||
    my $modul     = $c->render_to_string(inline => $c->l('dir_DESCRIPTION'));
 | 
			
		||||
@@ -52,7 +55,7 @@ sub do_update {
 | 
			
		||||
    $db->get('ldap')->set_prop('defaultPhoneNumber', $phonenumber);
 | 
			
		||||
 | 
			
		||||
    if ($existing eq 'update') {
 | 
			
		||||
        my $ac = esmith::AccountsDB->open() || die "Couldn't open accounts db";
 | 
			
		||||
        my $ac = esmith::AccountsDB::UTF8->open() || die "Couldn't open accounts db";
 | 
			
		||||
        my @users = $ac->users();
 | 
			
		||||
 | 
			
		||||
        foreach my $user (@users) {
 | 
			
		||||
 
 | 
			
		||||
@@ -13,16 +13,10 @@ use Mojo::Base 'Mojolicious::Controller';
 | 
			
		||||
use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw(theme_list init_session);
 | 
			
		||||
use esmith::DomainsDB::UTF8;
 | 
			
		||||
use esmith::AccountsDB::UTF8;
 | 
			
		||||
 | 
			
		||||
#use Data::Dumper;
 | 
			
		||||
#use esmith::FormMagick::Panel::domains;
 | 
			
		||||
use esmith::DomainsDB;
 | 
			
		||||
use esmith::AccountsDB;
 | 
			
		||||
 | 
			
		||||
#use URI::Escape;
 | 
			
		||||
my ($ddb,$cdb,$adb);
 | 
			
		||||
#our $cdb = esmith::ConfigDB->open   || die "Couldn't open configuration db";
 | 
			
		||||
#our $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
our ($ddb,$cdb,$adb);
 | 
			
		||||
our $REGEXP_DOMAIN = qq([a-zA-Z0-9\-\.]+);
 | 
			
		||||
 | 
			
		||||
sub main {
 | 
			
		||||
@@ -30,9 +24,9 @@ sub main {
 | 
			
		||||
    $c->app->log->info($c->log_req);
 | 
			
		||||
    my %dom_datas = ();
 | 
			
		||||
    my $title     = $c->l('dom_FORM_TITLE');
 | 
			
		||||
	$ddb = esmith::DomainsDB->open  || die "Couldn't open domains db";
 | 
			
		||||
	$cdb = esmith::ConfigDB->open   || die "Couldn't open configuration db";
 | 
			
		||||
	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
    $ddb = esmith::DomainsDB::UTF8->open  || die "Couldn't open domains db";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open   || die "Couldn't open configuration db";
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
    $dom_datas{trt} = 'LST';
 | 
			
		||||
    my @domains;
 | 
			
		||||
 | 
			
		||||
@@ -57,9 +51,9 @@ sub do_display {
 | 
			
		||||
    my $rt     = $c->current_route;
 | 
			
		||||
    my $trt    = $c->param('trt');
 | 
			
		||||
    my $domain = $c->param('Domain') || '';
 | 
			
		||||
	$ddb = esmith::DomainsDB->open  || die "Couldn't open domains db";
 | 
			
		||||
	$cdb = esmith::ConfigDB->open   || die "Couldn't open configuration db";
 | 
			
		||||
	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
    $ddb = esmith::DomainsDB::UTF8->open  || die "Couldn't open domains db";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open   || die "Couldn't open configuration db";
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
 | 
			
		||||
    #$trt = 'DEL' if ( $rt eq 'domaindel1' );
 | 
			
		||||
    #$trt = 'UPD' if ( $rt eq 'domainupd1' );
 | 
			
		||||
@@ -127,9 +121,9 @@ sub do_update {
 | 
			
		||||
    $c->app->log->info($c->log_req);
 | 
			
		||||
    my $rt        = $c->current_route;
 | 
			
		||||
    my $trt       = $c->param('trt');
 | 
			
		||||
	$ddb = esmith::DomainsDB->open  || die "Couldn't open domains db";
 | 
			
		||||
	$cdb = esmith::ConfigDB->open   || die "Couldn't open configuration db";
 | 
			
		||||
	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
    $ddb = esmith::DomainsDB::UTF8->open  || die "Couldn't open domains db";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open   || die "Couldn't open configuration db";
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
    my %dom_datas = ();
 | 
			
		||||
    my ($res, $result) = '';
 | 
			
		||||
 | 
			
		||||
@@ -246,6 +240,7 @@ sub create_modify_domain {
 | 
			
		||||
                . ' Ctl'
 | 
			
		||||
        );
 | 
			
		||||
    } ## end unless ($domain)
 | 
			
		||||
    $ddb = esmith::DomainsDB::UTF8->open  || die "Couldn't open domains db";
 | 
			
		||||
    my $rec = $ddb->get($domain);
 | 
			
		||||
 | 
			
		||||
    if ($rec and $action eq 'create') {
 | 
			
		||||
@@ -375,6 +370,7 @@ sub nameserver_options_list {
 | 
			
		||||
 | 
			
		||||
sub get_nameserver_value {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
    $ddb = esmith::DomainsDB::UTF8->open  || die "Couldn't open domains db";
 | 
			
		||||
    my $domain = $c->param('Domain') || undef;
 | 
			
		||||
    return ($ddb->get_prop($domain, 'Nameservers') || 'internet');
 | 
			
		||||
} ## end sub get_nameserver_value
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ package SrvMngr::Controller::Emailsettings;
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
# heading     : System
 | 
			
		||||
# description : E-mail
 | 
			
		||||
# navigation  : 4000 500
 | 
			
		||||
# navigation  : 4000 400
 | 
			
		||||
#
 | 
			
		||||
#
 | 
			
		||||
# routes : end
 | 
			
		||||
@@ -16,16 +16,18 @@ use constant TRUE  => 1;
 | 
			
		||||
use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw(theme_list init_session ip_number_or_blank);
 | 
			
		||||
use esmith::ConfigDB;
 | 
			
		||||
use esmith::AccountsDB;
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
use esmith::AccountsDB::UTF8;
 | 
			
		||||
use esmith::util;
 | 
			
		||||
use File::Basename;
 | 
			
		||||
our $pattern_db = esmith::ConfigDB->open("mailpatterns");
 | 
			
		||||
our $cdb = esmith::ConfigDB->open || die "Couldn't open config db";
 | 
			
		||||
our $pattern_db;
 | 
			
		||||
our $cdb;
 | 
			
		||||
 | 
			
		||||
sub main {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
    $c->app->log->info($c->log_req);
 | 
			
		||||
    $pattern_db = esmith::ConfigDB::UTF8->open("mailpatterns");
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open || die "Couldn't open config db";
 | 
			
		||||
    my %mai_datas = ();
 | 
			
		||||
    my $title     = $c->l('mai_FORM_TITLE');
 | 
			
		||||
    $mai_datas{'trt'} = 'LIST';
 | 
			
		||||
@@ -42,7 +44,7 @@ sub do_display {
 | 
			
		||||
    my $title     = $c->l('mai_FORM_TITLE');
 | 
			
		||||
    my ($notif, $dest) = '';
 | 
			
		||||
    $mai_datas{'trt'} = $trt;
 | 
			
		||||
    $cdb = esmith::ConfigDB->open || die "Couldn't open config db";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open || die "Couldn't open config db";
 | 
			
		||||
 | 
			
		||||
    if ($trt eq 'ACC') {
 | 
			
		||||
        $dest = 'emailaccess';
 | 
			
		||||
@@ -94,7 +96,7 @@ sub do_update {
 | 
			
		||||
    my $trt       = $c->param('trt');
 | 
			
		||||
    my %mai_datas = ();
 | 
			
		||||
    $mai_datas{trt} = $trt;
 | 
			
		||||
    $cdb = esmith::ConfigDB->open || die "Couldn't open config db";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open || die "Couldn't open config db";
 | 
			
		||||
    my $title = $c->l('mai_FORM_TITLE');
 | 
			
		||||
    my ($dest, $res, $result) = '';
 | 
			
		||||
 | 
			
		||||
@@ -231,7 +233,7 @@ sub get_patterns_status {
 | 
			
		||||
sub adjust_patterns {
 | 
			
		||||
    my $c        = shift;
 | 
			
		||||
    my @selected = @{ $c->every_param('BlockExecutableContent') };
 | 
			
		||||
 | 
			
		||||
    $pattern_db = esmith::ConfigDB::UTF8->open("mailpatterns");
 | 
			
		||||
    foreach my $pattern ($pattern_db->get_all_by_prop(type => "pattern")) {
 | 
			
		||||
        my $status
 | 
			
		||||
            = (grep $pattern->key eq $_, @selected)
 | 
			
		||||
@@ -284,7 +286,7 @@ sub get_current_imap_access {
 | 
			
		||||
sub get_current_smtp_ssl_auth {
 | 
			
		||||
    my ($c, $localise, $soru, $debug) = @_;
 | 
			
		||||
    die "Error: \$soru must be either 's' or 'u':$soru.\n" unless $soru eq 's' || $soru eq 'u';
 | 
			
		||||
    $cdb = esmith::ConfigDB->open || die "Couldn't open config db";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open || die "Couldn't open config db";
 | 
			
		||||
 | 
			
		||||
    # Initialize variables with default values
 | 
			
		||||
    my $smtpStatus = 'none';
 | 
			
		||||
@@ -485,7 +487,7 @@ sub get_retrieval_opt {
 | 
			
		||||
 | 
			
		||||
sub get_emailunknownuser_options {
 | 
			
		||||
    my $c                = shift;
 | 
			
		||||
    my $accounts         = esmith::AccountsDB->open_ro();
 | 
			
		||||
    my $accounts         = esmith::AccountsDB::UTF8->open_ro();
 | 
			
		||||
    my %existingAccounts = (
 | 
			
		||||
        'admin'          => $c->l("mai_FORWARD_TO_ADMIN"),
 | 
			
		||||
        'returntosender' => $c->l("mai_RETURN_TO_SENDER")
 | 
			
		||||
@@ -503,7 +505,7 @@ sub get_emailunknownuser_options {
 | 
			
		||||
 | 
			
		||||
sub get_emailunknownuser_opt {
 | 
			
		||||
    my $c        = shift;
 | 
			
		||||
    my $accounts = esmith::AccountsDB->open_ro();
 | 
			
		||||
    my $accounts = esmith::AccountsDB::UTF8->open_ro();
 | 
			
		||||
    my @existingAccounts
 | 
			
		||||
        = ([ $c->l("mai_FORWARD_TO_ADMIN") => 'admin' ], [ $c->l("mai_RETURN_TO_SENDER") => 'returntosender' ]);
 | 
			
		||||
 | 
			
		||||
@@ -580,14 +582,13 @@ sub display_multidrop {
 | 
			
		||||
 | 
			
		||||
sub change_settings_reception {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
    $cdb = esmith::ConfigDB->open || die "Couldn't open config db";
 | 
			
		||||
    $cdb = esmith::ConfigDBi::UTF8->open || die "Couldn't open config db";
 | 
			
		||||
    my $FetchmailMethod      = ($c->param('FetchmailMethod') || 'standard');
 | 
			
		||||
    my $FetchmailFreqOffice  = ($c->param('FreqOffice')      || 'every15min');
 | 
			
		||||
    my $FetchmailFreqOutside = ($c->param('FreqOutside')     || 'everyhour');
 | 
			
		||||
    my $FetchmailFreqWeekend = ($c->param('FreqWeekend')     || 'everyhour');
 | 
			
		||||
    my $SpecifyHeader        = ($c->param('SpecifyHeader')   || 'off');
 | 
			
		||||
    my $fetchmail
 | 
			
		||||
        = $cdb->get('fetchmail') || $cdb->new_record("fetchmail", { type => "service", status => "disabled" });
 | 
			
		||||
    my $fetchmail = $cdb->get('fetchmail') || $cdb->new_record("fetchmail", { type => "service", status => "disabled" });
 | 
			
		||||
 | 
			
		||||
    if ($FetchmailMethod eq 'standard') {
 | 
			
		||||
        $fetchmail->set_prop('status', 'disabled');
 | 
			
		||||
@@ -662,7 +663,7 @@ sub change_settings_reception {
 | 
			
		||||
 | 
			
		||||
sub change_settings_delivery {
 | 
			
		||||
    my ($c) = shift;
 | 
			
		||||
    $cdb = esmith::ConfigDB->open || die "Couldn't open config db";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open || die "Couldn't open config db";
 | 
			
		||||
    my $EmailUnknownUser = ($c->param('EmailUnknownUser') || 'returntosender');
 | 
			
		||||
    $cdb->set_value('SMTPSmartHost',      $c->param('SMTPSmartHost'));
 | 
			
		||||
    $cdb->set_value('DelegateMailServer', $c->param('DelegateMailServer'));
 | 
			
		||||
@@ -683,7 +684,7 @@ sub change_settings_delivery {
 | 
			
		||||
 | 
			
		||||
sub change_settings_access {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
    $cdb = esmith::ConfigDB->open || die "Couldn't open config db";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open || die "Couldn't open config db";
 | 
			
		||||
    my $pop3Access = ($c->param('POPAccess') || 'private');
 | 
			
		||||
 | 
			
		||||
    if ($pop3Access eq 'disabled') {
 | 
			
		||||
@@ -757,7 +758,7 @@ sub change_settings_access {
 | 
			
		||||
 | 
			
		||||
sub change_settings_filtering {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
    $cdb = esmith::ConfigDB->open || die "Couldn't open config db";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open || die "Couldn't open config db";
 | 
			
		||||
    my $virus_status = ($c->param('VirusStatus') || 'disabled');
 | 
			
		||||
    $cdb->set_prop("qpsmtpd", 'VirusScan', $virus_status);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -14,21 +14,18 @@ use Mojo::Base 'Mojolicious::Controller';
 | 
			
		||||
use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw(theme_list init_session);
 | 
			
		||||
use esmith::AccountsDB::UTF8;
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
 | 
			
		||||
#use Data::Dumper;
 | 
			
		||||
#use esmith::FormMagick::Panel::groups;
 | 
			
		||||
use esmith::AccountsDB;
 | 
			
		||||
#our $cdb = esmith::ConfigDB->open   || die "Couldn't open configuration db";
 | 
			
		||||
#our $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
my ($cdb,$adb);
 | 
			
		||||
our ($cdb,$adb);
 | 
			
		||||
 | 
			
		||||
sub main {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
    $c->app->log->info($c->log_req);
 | 
			
		||||
    my %grp_datas = ();
 | 
			
		||||
    my $title     = $c->l('grp_FORM_TITLE');
 | 
			
		||||
	$cdb = esmith::ConfigDB->open   || die "Couldn't open configuration db";
 | 
			
		||||
	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open   || die "Couldn't open configuration db";
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
    $grp_datas{trt} = 'LST';
 | 
			
		||||
    my @groups;
 | 
			
		||||
 | 
			
		||||
@@ -47,8 +44,8 @@ sub do_display {
 | 
			
		||||
    my $group     = $c->param('group');
 | 
			
		||||
    my %grp_datas = ();
 | 
			
		||||
    my $title     = $c->l('grp_FORM_TITLE');
 | 
			
		||||
	$cdb = esmith::ConfigDB->open   || die "Couldn't open configuration db";
 | 
			
		||||
	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open   || die "Couldn't open configuration db";
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
    $grp_datas{'trt'} = $trt;
 | 
			
		||||
 | 
			
		||||
    if ($trt eq 'ADD') {
 | 
			
		||||
@@ -104,8 +101,8 @@ sub do_update {
 | 
			
		||||
    my $title     = $c->l('grp_FORM_TITLE');
 | 
			
		||||
    my ($res, $result) = '';
 | 
			
		||||
    my %grp_datas = ();
 | 
			
		||||
	$cdb = esmith::ConfigDB->open   || die "Couldn't open configuration db";
 | 
			
		||||
	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open   || die "Couldn't open configuration db";
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
    $grp_datas{'trt'}   = $trt;
 | 
			
		||||
    $grp_datas{'group'} = $groupName;
 | 
			
		||||
    my @members = ();
 | 
			
		||||
 
 | 
			
		||||
@@ -14,22 +14,14 @@ use Mojo::Base 'Mojolicious::Controller';
 | 
			
		||||
use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw(theme_list init_session);
 | 
			
		||||
 | 
			
		||||
#use Data::Dumper;
 | 
			
		||||
#use esmith::FormMagick::Panel::hostentries;
 | 
			
		||||
use esmith::DomainsDB;
 | 
			
		||||
use esmith::AccountsDB;
 | 
			
		||||
use esmith::HostsDB;
 | 
			
		||||
use esmith::NetworksDB;
 | 
			
		||||
use HTML::Entities;
 | 
			
		||||
use Net::IPv4Addr qw(ipv4_in_network);
 | 
			
		||||
use esmith::DomainsDB::UTF8;
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
use esmith::HostsDB::UTF8;
 | 
			
		||||
use esmith::NetworksDB::UTF8;
 | 
			
		||||
 | 
			
		||||
#use URI::Escape;
 | 
			
		||||
#our $ddb = esmith::DomainsDB->open  || die "Couldn't open hostentries db";
 | 
			
		||||
#our $cdb = esmith::ConfigDB->open   || die "Couldn't open configuration db";
 | 
			
		||||
#our $hdb = esmith::HostsDB->open    || die "Couldn't open hosts db";
 | 
			
		||||
#our $ndb = esmith::NetworksDB->open || die "Couldn't open networks db";
 | 
			
		||||
my ($ddb,$cdb,$hdb,$ndb);
 | 
			
		||||
our ($ddb,$cdb,$hdb,$ndb);
 | 
			
		||||
 | 
			
		||||
sub main {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
@@ -37,10 +29,9 @@ sub main {
 | 
			
		||||
    my %hos_datas = ();
 | 
			
		||||
    my $title     = $c->l('hos_FORM_TITLE');
 | 
			
		||||
    my $notif     = '';
 | 
			
		||||
	#my $ddb = esmith::DomainsDB->open  || die "Couldn't open hostentries db";
 | 
			
		||||
	$cdb = esmith::ConfigDB->open   || die "Couldn't open configuration db";
 | 
			
		||||
	$hdb = esmith::HostsDB->open    || die "Couldn't open hosts db";
 | 
			
		||||
	$ndb = esmith::NetworksDB->open || die "Couldn't open networks db";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open   || die "Couldn't open configuration db";
 | 
			
		||||
    $hdb = esmith::HostsDB::UTF8->open    || die "Couldn't open hosts db";
 | 
			
		||||
    $ndb = esmith::NetworksDB::UTF8->open || die "Couldn't open networks db";
 | 
			
		||||
    $hos_datas{trt} = 'LIST';
 | 
			
		||||
    my %dom_hosts = ();
 | 
			
		||||
 | 
			
		||||
@@ -73,9 +64,9 @@ sub do_display {
 | 
			
		||||
    $trt = 'LST' if ($trt ne 'DEL' && $trt ne 'UPD' && $trt ne 'ADD');
 | 
			
		||||
    my %hos_datas = ();
 | 
			
		||||
    my $title     = $c->l('hos_FORM_TITLE');
 | 
			
		||||
	$cdb = esmith::ConfigDB->open   || die "Couldn't open configuration db";
 | 
			
		||||
	$hdb = esmith::HostsDB->open    || die "Couldn't open hosts db";
 | 
			
		||||
	$ndb = esmith::NetworksDB->open || die "Couldn't open networks db";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open   || die "Couldn't open configuration db";
 | 
			
		||||
    $hdb = esmith::HostsDB::UTF8->open    || die "Couldn't open hosts db";
 | 
			
		||||
    $ndb = esmith::NetworksDB::UTF8->open || die "Couldn't open networks db";
 | 
			
		||||
    my $notif     = '';
 | 
			
		||||
    $hos_datas{'trt'} = $trt;
 | 
			
		||||
 | 
			
		||||
@@ -120,9 +111,9 @@ sub do_update {
 | 
			
		||||
    my $trt       = ($c->param('trt') || 'LIST');
 | 
			
		||||
    my %hos_datas = ();
 | 
			
		||||
    my $title     = $c->l('hos_FORM_TITLE');
 | 
			
		||||
	$cdb = esmith::ConfigDB->open   || die "Couldn't open configuration db";
 | 
			
		||||
	$hdb = esmith::HostsDB->open    || die "Couldn't open hosts db";
 | 
			
		||||
	$ndb = esmith::NetworksDB->open || die "Couldn't open networks db";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open   || die "Couldn't open configuration db";
 | 
			
		||||
    $hdb = esmith::HostsDB::UTF8->open    || die "Couldn't open hosts db";
 | 
			
		||||
    $ndb = esmith::NetworksDB::UTF8->open || die "Couldn't open networks db";
 | 
			
		||||
    my $notif     = '';
 | 
			
		||||
    my $result    = '';
 | 
			
		||||
    $hos_datas{'name'}       = lc $c->param('Name');
 | 
			
		||||
@@ -379,10 +370,10 @@ sub delete_hostentry {
 | 
			
		||||
} ## end sub delete_hostentry
 | 
			
		||||
 | 
			
		||||
sub domains_list {
 | 
			
		||||
    my $d = esmith::DomainsDB->open_ro() or die "Couldn't open DomainsDB";
 | 
			
		||||
    $ddb = esmith::DomainsDB::UTF8->open_ro() or die "Couldn't open DomainsDB";
 | 
			
		||||
    my @domains;
 | 
			
		||||
 | 
			
		||||
    for ($d->domains) {
 | 
			
		||||
    for ($ddb->domains) {
 | 
			
		||||
        my $ns = $_->prop("Nameservers") || 'localhost';
 | 
			
		||||
        push @domains, $_->key if ($ns eq 'localhost');
 | 
			
		||||
    }
 | 
			
		||||
@@ -516,7 +507,7 @@ sub must_be_local {
 | 
			
		||||
    my $localip = shift;
 | 
			
		||||
 | 
			
		||||
    # Make sure that the IP is indeed local.
 | 
			
		||||
    #my $ndb = esmith::NetworksDB->open_ro;
 | 
			
		||||
    #$ndb = esmith::NetworksDB::UTF8->open_ro;
 | 
			
		||||
    my @local_list = $ndb->local_access_spec;
 | 
			
		||||
 | 
			
		||||
    foreach my $spec (@local_list) {
 | 
			
		||||
 
 | 
			
		||||
@@ -14,12 +14,10 @@ use Mojo::Base 'Mojolicious::Controller';
 | 
			
		||||
use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw( theme_list init_session validate_password );
 | 
			
		||||
use esmith::AccountsDB;
 | 
			
		||||
use esmith::ConfigDB;
 | 
			
		||||
use esmith::DomainsDB;
 | 
			
		||||
use esmith::AccountsDB::UTF8;
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
use esmith::DomainsDB::UTF8;
 | 
			
		||||
 | 
			
		||||
#our $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
#our $cdb = esmith::ConfigDB->open() || die "Couldn't open config db";
 | 
			
		||||
my ($adb,$cdb);
 | 
			
		||||
 | 
			
		||||
sub main {
 | 
			
		||||
@@ -27,9 +25,9 @@ sub main {
 | 
			
		||||
    $c->app->log->info($c->log_req);
 | 
			
		||||
    my %iba_datas = ();
 | 
			
		||||
    my $title     = $c->l('iba_FORM_TITLE');
 | 
			
		||||
    $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
	$cdb = esmith::ConfigDB->open() || die "Couldn't open config db";
 | 
			
		||||
	$iba_datas{'trt'} = 'LIST';
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
 | 
			
		||||
    $iba_datas{'trt'} = 'LIST';
 | 
			
		||||
    my @ibays;
 | 
			
		||||
 | 
			
		||||
    if ($adb) {
 | 
			
		||||
@@ -44,8 +42,8 @@ sub do_display {
 | 
			
		||||
    my $rt   = $c->current_route;
 | 
			
		||||
    my $trt  = ($c->param('trt') || 'LIST');
 | 
			
		||||
    my $ibay = $c->param('ibay') || '';
 | 
			
		||||
    $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
	$cdb = esmith::ConfigDB->open() || die "Couldn't open config db";
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
 | 
			
		||||
 | 
			
		||||
    #$trt = 'DEL' if ( $ibay );
 | 
			
		||||
    #$trt = 'ADD' if ( $rt eq 'ibayadd' );
 | 
			
		||||
@@ -99,7 +97,7 @@ sub do_display {
 | 
			
		||||
 | 
			
		||||
    if ($trt eq 'LIST') {
 | 
			
		||||
        my @ibays;
 | 
			
		||||
        $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
        $adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
 | 
			
		||||
        if ($adb) {
 | 
			
		||||
            @ibays = $adb->ibays();
 | 
			
		||||
@@ -120,8 +118,8 @@ sub do_update {
 | 
			
		||||
    $iba_datas{'trt'} = $trt;
 | 
			
		||||
    my $result = '';
 | 
			
		||||
    my $res;
 | 
			
		||||
    $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
	$cdb = esmith::ConfigDB->open() || die "Couldn't open config db";
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
 | 
			
		||||
 | 
			
		||||
    if ($trt eq 'ADD') {
 | 
			
		||||
        my $name = ($c->param('ibay') || '');
 | 
			
		||||
@@ -306,7 +304,7 @@ sub print_vhost_message {
 | 
			
		||||
    my $c              = shift;
 | 
			
		||||
    my $name           = $c->param('ibay');
 | 
			
		||||
    my $result         = '';
 | 
			
		||||
    my $domaindb       = esmith::DomainsDB->open();
 | 
			
		||||
    my $domaindb       = esmith::DomainsDB::UTF8->open();
 | 
			
		||||
    my @domains        = $domaindb->get_all_by_prop(Content => $name);
 | 
			
		||||
    my $vhostListItems = join "\n", (map ($_->key . " " . $_->prop('Description'), @domains));
 | 
			
		||||
 | 
			
		||||
@@ -328,7 +326,7 @@ sub remove_ibay {
 | 
			
		||||
    if (my $acct = $adb->get($name)) {
 | 
			
		||||
        if ($acct->prop('type') eq 'ibay') {
 | 
			
		||||
            $acct->set_prop('type', 'ibay-deleted');
 | 
			
		||||
            my $domains_db = esmith::DomainsDB->open();
 | 
			
		||||
            my $domains_db = esmith::DomainsDB::UTF8->open();
 | 
			
		||||
            my @domains = $domains_db->get_all_by_prop(Content => $name);
 | 
			
		||||
 | 
			
		||||
            foreach my $d (@domains) {
 | 
			
		||||
 
 | 
			
		||||
@@ -13,13 +13,12 @@ use Mojo::Base 'Mojolicious::Controller';
 | 
			
		||||
use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw(theme_list init_session subnet_mask get_reg_mask ip_number);
 | 
			
		||||
 | 
			
		||||
#use Data::Dumper;
 | 
			
		||||
use esmith::util;
 | 
			
		||||
use esmith::HostsDB;
 | 
			
		||||
#my $network_db = esmith::NetworksDB->open() || die("Couldn't open networks db");
 | 
			
		||||
use esmith::HostsDB::UTF8;
 | 
			
		||||
use esmith::NetworksDB::UTF8;
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
my $ret = "OK";
 | 
			
		||||
my ($network_db);
 | 
			
		||||
our ($network_db,$config_db);
 | 
			
		||||
 | 
			
		||||
sub main {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
@@ -27,7 +26,7 @@ sub main {
 | 
			
		||||
    my %ln_datas = ();
 | 
			
		||||
    $ln_datas{return} = "";
 | 
			
		||||
    my $title = $c->l('ln_LOCAL NETWORKS');
 | 
			
		||||
	$network_db = esmith::NetworksDB->open() || die("Couldn't open networks db");
 | 
			
		||||
    $network_db = esmith::NetworksDB::UTF8->open() || die("Couldn't open networks db");
 | 
			
		||||
    my $modul = '';
 | 
			
		||||
    $ln_datas{trt} = 'LIST';
 | 
			
		||||
    my @localnetworks;
 | 
			
		||||
@@ -49,7 +48,7 @@ sub do_display {
 | 
			
		||||
    $c->app->log->info($c->log_req);
 | 
			
		||||
    my $rt = $c->current_route;
 | 
			
		||||
    my $trt = ($c->param('trt') || 'LIST');
 | 
			
		||||
	$network_db = esmith::NetworksDB->open() || die("Couldn't open networks db");
 | 
			
		||||
    $network_db = esmith::NetworksDB::UTF8->open() || die("Couldn't open networks db");
 | 
			
		||||
    $trt = 'DEL'  if ($rt eq 'localnetworksdel');
 | 
			
		||||
    $trt = 'ADD'  if ($rt eq 'localnetworksadd');
 | 
			
		||||
    $trt = 'ADD1' if ($rt eq 'localnetworksadd1');
 | 
			
		||||
@@ -68,6 +67,7 @@ sub do_display {
 | 
			
		||||
 | 
			
		||||
        #Add a network - called after new network details filled in
 | 
			
		||||
        my %ret = add_network($c);
 | 
			
		||||
        $network_db   = esmith::NetworksDB::UTF8->open();
 | 
			
		||||
 | 
			
		||||
        #Return to list page if success
 | 
			
		||||
        if ((index($ret{ret}, "SUCCESS") != -1)) {
 | 
			
		||||
@@ -77,14 +77,14 @@ sub do_display {
 | 
			
		||||
            #Error - return to Add page
 | 
			
		||||
            $trt = "ADD";
 | 
			
		||||
        }
 | 
			
		||||
        $network_db = esmith::NetworksDB->open() || die("Failed to open Networkdb-3");    #Refresh the network DB
 | 
			
		||||
	#$network_db = esmith::NetworksDB::UTF8->open() || die("Failed to open Networkdb-3");    #Refresh the network DB
 | 
			
		||||
        $c->stash(ret => \%ret);    #stash it away for the template
 | 
			
		||||
    } ## end if ($trt eq 'ADD1')
 | 
			
		||||
 | 
			
		||||
    if ($trt eq 'DEL1') {
 | 
			
		||||
 | 
			
		||||
        #After Remove clicked on Delete network panel
 | 
			
		||||
        $network_db   = esmith::NetworksDB->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");
 | 
			
		||||
@@ -93,7 +93,7 @@ sub do_display {
 | 
			
		||||
            $ln_datas{localnetwork} = $localnetwork;
 | 
			
		||||
        }
 | 
			
		||||
        my %ret = remove_network($localnetwork, $delete_hosts);
 | 
			
		||||
        $network_db = esmith::NetworksDB->open() || die("Failed to open Networkdb-2");        #Refresh the network DB
 | 
			
		||||
	#$network_db = esmith::NetworksDB::UTF8->open() || die("Failed to open Networkdb-2");        #Refresh the network DB
 | 
			
		||||
        my @localnetworks;
 | 
			
		||||
 | 
			
		||||
        if ($network_db) {
 | 
			
		||||
@@ -138,7 +138,7 @@ sub do_display {
 | 
			
		||||
 | 
			
		||||
sub remove_network {
 | 
			
		||||
    my $network      = shift;
 | 
			
		||||
    $network_db   = esmith::NetworksDB->open();
 | 
			
		||||
    $network_db   = esmith::NetworksDB::UTF8->open();
 | 
			
		||||
    my $record       = $network_db->get($network);
 | 
			
		||||
    my $delete_hosts = shift;
 | 
			
		||||
 | 
			
		||||
@@ -174,7 +174,7 @@ sub hosts_on_network {
 | 
			
		||||
    my $netmask = shift;
 | 
			
		||||
    die if not $network and $netmask;
 | 
			
		||||
    my $cidr             = "$network/$netmask";
 | 
			
		||||
    my $hosts            = esmith::HostsDB->open() || die("Couldn't open hosts db");
 | 
			
		||||
    my $hosts            = esmith::HostsDB::UTF8->open() || die("Couldn't open hosts db");
 | 
			
		||||
    my @localhosts       = grep { $_->prop('HostType') eq 'Local' } $hosts->hosts;
 | 
			
		||||
    my @hosts_on_network = ();
 | 
			
		||||
 | 
			
		||||
@@ -207,9 +207,9 @@ sub add_network {
 | 
			
		||||
 | 
			
		||||
    # we transform bit mask to regular mask
 | 
			
		||||
    $networkMask = get_reg_mask($networkAddress, $networkMask);
 | 
			
		||||
    my $network_db = esmith::NetworksDB->open()
 | 
			
		||||
        || esmith::NetworksDB->create();
 | 
			
		||||
    my $config_db    = esmith::ConfigDB->open();
 | 
			
		||||
    my $network_db = esmith::NetworksDB::UTF8->open()
 | 
			
		||||
        || esmith::NetworksDB::UTF8->create();
 | 
			
		||||
    my $config_db    = esmith::ConfigDB::UTF8->open();
 | 
			
		||||
    my $localIP      = $config_db->get('LocalIP');
 | 
			
		||||
    my $localNetmask = $config_db->get('LocalNetmask');
 | 
			
		||||
    my ($localNetwork, $localBroadcast)
 | 
			
		||||
@@ -268,4 +268,4 @@ sub add_network {
 | 
			
		||||
        );
 | 
			
		||||
    } ## end else [ if ($totalHosts == 1) ]
 | 
			
		||||
} ## end sub add_network
 | 
			
		||||
1;
 | 
			
		||||
1;
 | 
			
		||||
@@ -18,7 +18,7 @@ use strict;
 | 
			
		||||
use warnings;
 | 
			
		||||
use Mojo::Base 'Mojolicious::Controller';
 | 
			
		||||
use Locale::gettext;
 | 
			
		||||
use esmith::AccountsDB;
 | 
			
		||||
use esmith::AccountsDB::UTF8;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr::Model::Main;
 | 
			
		||||
use SrvMngr qw( theme_list init_session );
 | 
			
		||||
@@ -26,7 +26,7 @@ my $MAX_LOGIN_ATTEMPTS   = 3;
 | 
			
		||||
my $DURATION_BLOCKED     = 30 * 60;        # access blocked for 30 min
 | 
			
		||||
my $TIMEOUT_FAILED_LOGIN = 1;
 | 
			
		||||
my $RESET_DURATION       = 2 * 60 * 60;    # 2 hours for resetting
 | 
			
		||||
our $adb = esmith::AccountsDB->open() or die "Couldn't open DB Accounts\n";
 | 
			
		||||
our $adb;
 | 
			
		||||
my $allowed_user_re = qr/^\w{5,10}$/;
 | 
			
		||||
my %Login_Attempts;
 | 
			
		||||
 | 
			
		||||
@@ -39,6 +39,7 @@ sub main {
 | 
			
		||||
sub login {
 | 
			
		||||
    my $c   = shift;
 | 
			
		||||
    my $trt = $c->param('Trt');
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open() or die "Couldn't open DB Accounts\n";
 | 
			
		||||
 | 
			
		||||
    # password reset request
 | 
			
		||||
    if ($trt eq 'RESET') {
 | 
			
		||||
@@ -85,13 +86,13 @@ sub login {
 | 
			
		||||
        $c->session(logged_in => 1);        # set the logged_in flag
 | 
			
		||||
        $c->session(username  => $name);    # keep a copy of the username
 | 
			
		||||
 | 
			
		||||
        #    if ( $name eq 'admin' || $adb->is_user_in_group($name, 'AdmiN') )  # for futur use
 | 
			
		||||
        #    if ( $name eq 'admin' || $adb->is_user_in_group($name, 'Admin') )  # for futur use
 | 
			
		||||
        if ($name eq 'admin') {
 | 
			
		||||
            $c->session(is_admin => 1);
 | 
			
		||||
        } else {
 | 
			
		||||
            $c->session(is_admin => 0);
 | 
			
		||||
        }
 | 
			
		||||
        $c->session(expiration => 600);     # expire this session in 10 minutes
 | 
			
		||||
        $c->session(expiration => $c->config->{timeout} );     # expire this session in the time set  in config
 | 
			
		||||
        $c->flash(success => $c->l('use_WELCOME'));
 | 
			
		||||
        record_login_attempt($c, 'SUCCESS');
 | 
			
		||||
    } else {
 | 
			
		||||
@@ -114,6 +115,7 @@ sub mail_rescue {
 | 
			
		||||
    my $c    = shift;
 | 
			
		||||
    my $name = $c->param('Username');
 | 
			
		||||
    my $from = $c->param('From');
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open() or die "Couldn't open DB Accounts\n";
 | 
			
		||||
    my $res;
 | 
			
		||||
    $res .= $c->l('use_TOO_MANY_LOGIN') if (is_denied($c));
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ package SrvMngr::Controller::Logout;
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
# heading     : Current User
 | 
			
		||||
# description : Logout
 | 
			
		||||
# navigation  : 1000 900
 | 
			
		||||
# navigation  : 1000 1000
 | 
			
		||||
# menu        : U
 | 
			
		||||
#
 | 
			
		||||
# routes : end
 | 
			
		||||
 
 | 
			
		||||
@@ -13,14 +13,10 @@ use Mojo::Base 'Mojolicious::Controller';
 | 
			
		||||
use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw(theme_list init_session);
 | 
			
		||||
 | 
			
		||||
#use Regexp::Common qw /net/;
 | 
			
		||||
#use Data::Dumper;
 | 
			
		||||
use esmith::util;
 | 
			
		||||
use esmith::HostsDB;
 | 
			
		||||
#our $db = esmith::ConfigDB->open || die "Can't open configuration database: $!\n";
 | 
			
		||||
#our $tcp_db = esmith::ConfigDB->open('portforward_tcp') || die "Can't open portforward_tcp database: $!\n";
 | 
			
		||||
#our $udp_db = esmith::ConfigDB->open('portforward_udp') || die "Can't open portforward_udp database: $!\n";
 | 
			
		||||
use esmith::ConfigDB::UTF8; 
 | 
			
		||||
 | 
			
		||||
my ($cdb,$tcp_db,$udp_db);
 | 
			
		||||
 | 
			
		||||
my %ret = ();
 | 
			
		||||
@@ -34,9 +30,9 @@ sub main {
 | 
			
		||||
    $pf_datas{return} = "";
 | 
			
		||||
    my $title = $c->l('pf_FORM_TITLE');
 | 
			
		||||
    my $modul = '';
 | 
			
		||||
	$cdb = esmith::ConfigDB->open || die "Can't open configuration database: $!\n";
 | 
			
		||||
	$tcp_db = esmith::ConfigDB->open('portforward_tcp') || die "Can't open portforward_tcp database: $!\n";
 | 
			
		||||
	$udp_db = esmith::ConfigDB->open('portforward_udp') || die "Can't open portforward_udp database: $!\n";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open || die "Can't open configuration database: $!\n";
 | 
			
		||||
    $tcp_db = esmith::ConfigDB::UTF8->open('portforward_tcp') || die "Can't open portforward_tcp database: $!\n";
 | 
			
		||||
    $udp_db = esmith::ConfigDB::UTF8->open('portforward_udp') || die "Can't open portforward_udp database: $!\n";
 | 
			
		||||
    $pf_datas{trt} = 'LIST';
 | 
			
		||||
    my @tcpforwards = $tcp_db->get_all;
 | 
			
		||||
    my @udpforwards = $udp_db->get_all;
 | 
			
		||||
@@ -57,9 +53,9 @@ sub do_display {
 | 
			
		||||
    $c->app->log->info($c->log_req);
 | 
			
		||||
    my $rt = $c->current_route;
 | 
			
		||||
    my $trt = ($c->param('trt') || 'LIST');
 | 
			
		||||
	my $cdb = esmith::ConfigDB->open || die "Can't open configuration database: $!\n";
 | 
			
		||||
	my $tcp_db = esmith::ConfigDB->open('portforward_tcp') || die "Can't open portforward_tcp database: $!\n";
 | 
			
		||||
	my $udp_db = esmith::ConfigDB->open('portforward_udp') || die "Can't open portforward_udp database: $!\n";
 | 
			
		||||
    my $cdb = esmith::ConfigDB::UTF8->open || die "Can't open configuration database: $!\n";
 | 
			
		||||
    my $tcp_db = esmith::ConfigDB::UTF8->open('portforward_tcp') || die "Can't open portforward_tcp database: $!\n";
 | 
			
		||||
    my $udp_db = esmith::ConfigDB::UTF8->open('portforward_udp') || die "Can't open portforward_udp database: $!\n";
 | 
			
		||||
    $trt = 'DEL'  if ($rt eq 'portforwardingdel');
 | 
			
		||||
    $trt = 'ADD'  if ($rt eq 'portforwardingadd');
 | 
			
		||||
    $trt = 'ADD1' if ($rt eq 'portforwardingadd1');
 | 
			
		||||
@@ -143,8 +139,8 @@ sub do_display {
 | 
			
		||||
 | 
			
		||||
        #List all the port forwards
 | 
			
		||||
        # Open them again as maybe written to above 
 | 
			
		||||
        $tcp_db = esmith::ConfigDB->open('portforward_tcp') || die "Can't open portforward_tcp database: $!\n";
 | 
			
		||||
		$udp_db = esmith::ConfigDB->open('portforward_udp') || die "Can't open portforward_udp database: $!\n";
 | 
			
		||||
        $tcp_db = esmith::ConfigDB::UTF8->open('portforward_tcp') || die "Can't open portforward_tcp database: $!\n";
 | 
			
		||||
        $udp_db = esmith::ConfigDB::UTF8->open('portforward_udp') || die "Can't open portforward_udp database: $!\n";
 | 
			
		||||
 | 
			
		||||
        my @tcpforwards = $tcp_db->get_all;
 | 
			
		||||
        my @udpforwards = $udp_db->get_all;
 | 
			
		||||
@@ -172,10 +168,10 @@ sub add_portforward {
 | 
			
		||||
    my $fdb;
 | 
			
		||||
 | 
			
		||||
    if ($proto eq 'TCP') {
 | 
			
		||||
        $tcp_db = esmith::ConfigDB->open('portforward_tcp') || die "Can't open portforward_tcp database: $!\n";
 | 
			
		||||
        $tcp_db = esmith::ConfigDB::UTF8->open('portforward_tcp') || die "Can't open portforward_tcp database: $!\n";
 | 
			
		||||
        $fdb = $tcp_db;
 | 
			
		||||
    } else {
 | 
			
		||||
        $udp_db = esmith::ConfigDB->open('portforward_udp') || die "Can't open portforward_udp database: $!\n";
 | 
			
		||||
        $udp_db = esmith::ConfigDB::UTF8->open('portforward_udp') || die "Can't open portforward_udp database: $!\n";
 | 
			
		||||
        $fdb = $udp_db;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
@@ -215,7 +211,7 @@ sub add_portforward {
 | 
			
		||||
 | 
			
		||||
sub get_destination_host {
 | 
			
		||||
    my $q           = shift;
 | 
			
		||||
	$cdb = esmith::ConfigDB->open || die "Can't open configuration database: $!\n";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open || die "Can't open configuration database: $!\n";
 | 
			
		||||
    my $dhost       = $q->param("dhost");
 | 
			
		||||
    my $localip     = $cdb->get_prop('InternalInterface', 'IPAddress');
 | 
			
		||||
    my $external_ip = $cdb->get_prop('ExternalInterface', 'IPAddress') || $localip;
 | 
			
		||||
@@ -362,7 +358,7 @@ sub isValidPort() {
 | 
			
		||||
 | 
			
		||||
sub validate_destination_host {
 | 
			
		||||
    my $c     = shift;
 | 
			
		||||
	$cdb = esmith::ConfigDB->open || die "Can't open configuration database: $!\n";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open || die "Can't open configuration database: $!\n";
 | 
			
		||||
    my $dhost = $c->param('dhost');
 | 
			
		||||
    $dhost =~ s/^\s+|\s+$//g;
 | 
			
		||||
    my $localip = $cdb->get_prop('InternalInterface', 'IPAddress');
 | 
			
		||||
@@ -401,4 +397,4 @@ sub validate_allowed_hosts {
 | 
			
		||||
    } ## end foreach (split(/[\s,]+/, $ahost...))
 | 
			
		||||
    return %valid_ahost_list;
 | 
			
		||||
} ## end sub validate_allowed_hosts
 | 
			
		||||
1;
 | 
			
		||||
1;
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ package SrvMngr::Controller::Printers;
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
# heading     : System
 | 
			
		||||
# description : Printers
 | 
			
		||||
# navigation  : 4000 900
 | 
			
		||||
# navigation  : 4000 800
 | 
			
		||||
#
 | 
			
		||||
#
 | 
			
		||||
# routes : end
 | 
			
		||||
@@ -14,15 +14,15 @@ use Mojo::Base 'Mojolicious::Controller';
 | 
			
		||||
use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw(theme_list init_session);
 | 
			
		||||
#our $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
my $adb;
 | 
			
		||||
use esmith::AccountsDB::UTF8;
 | 
			
		||||
our $adb;
 | 
			
		||||
 | 
			
		||||
sub main {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
    $c->app->log->info($c->log_req);
 | 
			
		||||
    my %prt_datas = ();
 | 
			
		||||
    my $title     = $c->l('prt_FORM_TITLE');
 | 
			
		||||
	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
    $prt_datas{'trt'} = 'LIST';
 | 
			
		||||
    my @printerDrivers;
 | 
			
		||||
 | 
			
		||||
@@ -38,7 +38,7 @@ sub do_display {
 | 
			
		||||
    my $rt      = $c->current_route;
 | 
			
		||||
    my $trt     = ($c->param('trt') || 'LIST');
 | 
			
		||||
    my $printer = $c->param('printer') || '';
 | 
			
		||||
	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
 | 
			
		||||
    #$trt = 'DEL' if ( $printer );
 | 
			
		||||
    #$trt = 'ADD' if ( $rt eq 'printeradd' );
 | 
			
		||||
@@ -79,7 +79,7 @@ sub do_update {
 | 
			
		||||
    my $trt       = ($c->param('trt') || 'LIST');
 | 
			
		||||
    my %prt_datas = ();
 | 
			
		||||
    my $title     = $c->l('prt_FORM_TITLE');
 | 
			
		||||
   	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
    $prt_datas{'trt'} = $trt;
 | 
			
		||||
    my ($res, $result) = '';
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ package SrvMngr::Controller::Proxy;
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
# heading     : System
 | 
			
		||||
# description : Proxy settings
 | 
			
		||||
# navigation  : 4000 800
 | 
			
		||||
# navigation  : 4000 200
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
#
 | 
			
		||||
# routes : end
 | 
			
		||||
@@ -14,11 +14,14 @@ use Mojo::Base 'Mojolicious::Controller';
 | 
			
		||||
use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw(theme_list init_session);
 | 
			
		||||
our $db = esmith::ConfigDB->open || die "Couldn't open config db";
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
 | 
			
		||||
our $db;
 | 
			
		||||
 | 
			
		||||
sub main {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
    $c->app->log->info($c->log_req);
 | 
			
		||||
    $db = esmith::ConfigDB::UTF8->open || die "Couldn't open config db";
 | 
			
		||||
    my %prx_datas = ();
 | 
			
		||||
    my $title     = $c->l('prx_TITLE');
 | 
			
		||||
    my $modul     = $c->render_to_string(inline => $c->l('prx_FIRST_PAGE_DESCRIPTION'));
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ package SrvMngr::Controller::Pseudonyms;
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
# heading     : User management
 | 
			
		||||
# description : Pseudonyms
 | 
			
		||||
# navigation  : 2000 210
 | 
			
		||||
# navigation  : 2000 300
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
#
 | 
			
		||||
# routes : end
 | 
			
		||||
@@ -14,15 +14,10 @@ use Mojo::Base 'Mojolicious::Controller';
 | 
			
		||||
use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw(theme_list init_session);
 | 
			
		||||
use esmith::AccountsDB::UTF8;
 | 
			
		||||
use esmith::DomainsDB::UTF8;
 | 
			
		||||
 | 
			
		||||
#use Data::Dumper;
 | 
			
		||||
#use esmith::FormMagick::Panel::pseudonyms;
 | 
			
		||||
use esmith::AccountsDB;
 | 
			
		||||
 | 
			
		||||
#use URI::Escape;
 | 
			
		||||
#our $cdb = esmith::ConfigDB->open   || die "Couldn't open configuration db";
 | 
			
		||||
#our $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
my ($cdb,$adb);
 | 
			
		||||
our ($cdb,$adb);
 | 
			
		||||
 | 
			
		||||
sub main {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
@@ -32,8 +27,7 @@ sub main {
 | 
			
		||||
    my $notif     = '';
 | 
			
		||||
    $pse_datas{trt} = 'LST';
 | 
			
		||||
    my @pseudonyms;
 | 
			
		||||
	#$cdb = esmith::ConfigDB->open   || die "Couldn't open configuration db";
 | 
			
		||||
	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
	$adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
 | 
			
		||||
    if ($adb) {
 | 
			
		||||
        @pseudonyms = $adb->pseudonyms();
 | 
			
		||||
@@ -50,8 +44,7 @@ sub do_display {
 | 
			
		||||
    my $pseudonym = $c->param('pseudonym') || '';
 | 
			
		||||
    my $title     = $c->l('pse_FORM_TITLE');
 | 
			
		||||
    my %pse_datas = ();
 | 
			
		||||
 	#$cdb = esmith::ConfigDB->open   || die "Couldn't open configuration db";
 | 
			
		||||
	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
	$adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
	$pse_datas{'trt'} = $trt;
 | 
			
		||||
 | 
			
		||||
    if ($trt eq 'ADD') {
 | 
			
		||||
@@ -97,8 +90,7 @@ sub do_update {
 | 
			
		||||
    my $rt        = $c->current_route;
 | 
			
		||||
    my $trt       = ($c->param('trt') || 'LST');
 | 
			
		||||
    my $title     = $c->l('pse_FORM_TITLE');
 | 
			
		||||
   	#$cdb = esmith::ConfigDB->open   || die "Couldn't open configuration db";
 | 
			
		||||
	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
	$adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
    my %pse_datas = ();
 | 
			
		||||
    $pse_datas{'trt'} = $trt;
 | 
			
		||||
    my ($res, $result) = '';
 | 
			
		||||
@@ -331,8 +323,7 @@ sub validate_new_pseudonym_name {
 | 
			
		||||
    if (defined $acct) {
 | 
			
		||||
        return ($c->l('pse_NAME_IN_USE'));
 | 
			
		||||
    } elsif ($pseudonym =~ /@/) {
 | 
			
		||||
        use esmith::DomainsDB;
 | 
			
		||||
        my $ddb = esmith::DomainsDB->open_ro
 | 
			
		||||
        my $ddb = esmith::DomainsDB::UTF8->open_ro
 | 
			
		||||
            or die "Couldn't open DomainsDB\n";
 | 
			
		||||
        my ($lhs, $rhs) = split /@/, $pseudonym;
 | 
			
		||||
        return ($c->l('pse_PSEUDONYM_INVALID_DOMAIN')) unless ($ddb->get($rhs));
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ package SrvMngr::Controller::Quota;
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
# heading     : User management
 | 
			
		||||
# description : Quotas
 | 
			
		||||
# navigation  : 2000 300
 | 
			
		||||
# navigation  : 2000 500
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
#
 | 
			
		||||
# routes : end
 | 
			
		||||
@@ -16,8 +16,8 @@ use Scalar::Util qw(looks_like_number);
 | 
			
		||||
use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw(theme_list init_session);
 | 
			
		||||
use esmith::AccountsDB::UTF8;
 | 
			
		||||
 | 
			
		||||
#our $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
my $adb;
 | 
			
		||||
 | 
			
		||||
sub main {
 | 
			
		||||
@@ -25,7 +25,7 @@ sub main {
 | 
			
		||||
    $c->app->log->info($c->log_req);
 | 
			
		||||
    my %quo_datas = ();
 | 
			
		||||
    my $title     = $c->l('quo_FORM_TITLE');
 | 
			
		||||
	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
    $quo_datas{'trt'} = 'LIST';
 | 
			
		||||
    my @userAccounts;
 | 
			
		||||
 | 
			
		||||
@@ -44,7 +44,7 @@ sub do_display {
 | 
			
		||||
    $trt = 'UPD' if ($user);
 | 
			
		||||
    my %quo_datas = ();
 | 
			
		||||
    my $title     = $c->l('quo_FORM_TITLE');
 | 
			
		||||
	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
    $quo_datas{'trt'} = $trt;
 | 
			
		||||
 | 
			
		||||
    if ($trt eq 'UPD') {
 | 
			
		||||
@@ -73,7 +73,7 @@ sub do_update {
 | 
			
		||||
    $quo_datas{trt} = $trt;
 | 
			
		||||
    my $result = '';
 | 
			
		||||
    my $res;
 | 
			
		||||
	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
 | 
			
		||||
    if ($trt eq 'UPD') {
 | 
			
		||||
        $quo_datas{user}    = ($c->param('user') || '');
 | 
			
		||||
 
 | 
			
		||||
@@ -14,7 +14,7 @@ use Mojo::Base 'Mojolicious::Controller';
 | 
			
		||||
use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw(theme_list init_session ip_number subnet_mask get_reg_mask);
 | 
			
		||||
use esmith::ConfigDB;
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
use esmith::util;
 | 
			
		||||
use File::Basename;
 | 
			
		||||
use Exporter;
 | 
			
		||||
@@ -30,7 +30,7 @@ our @EXPORT = qw( networkAccess_list passwordLogin_list get_ssh_permit_root_logi
 | 
			
		||||
);
 | 
			
		||||
 | 
			
		||||
#		get_pptp_sessions
 | 
			
		||||
my  $db; # = esmith::ConfigDB->open || warn "Couldn't open configuration database"; 
 | 
			
		||||
our  $db; 
 | 
			
		||||
 | 
			
		||||
sub main {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
@@ -38,7 +38,7 @@ sub main {
 | 
			
		||||
    my $title     = $c->l('rma_FORM_TITLE');
 | 
			
		||||
    my $notif     = '';
 | 
			
		||||
    my %rma_datas = ();
 | 
			
		||||
    $db = esmith::ConfigDB->open || warn "Couldn't open configuration database";
 | 
			
		||||
    $db = esmith::ConfigDB::UTF8->open || warn "Couldn't open configuration database";
 | 
			
		||||
 | 
			
		||||
    #$rma_datas{ipsecrwSess}  = $c->get_ipsecrw_sessions();
 | 
			
		||||
    #$rma_datas{pptpSessions} = $c->get_pptp_sessions();
 | 
			
		||||
@@ -60,7 +60,7 @@ sub do_action {
 | 
			
		||||
    my $title = $c->l('rma_FORM_TITLE');
 | 
			
		||||
    my ($result, $res, $trt) = '';
 | 
			
		||||
    my %rma_datas = ();
 | 
			
		||||
    $db = esmith::ConfigDB->open || warn "Couldn't open configuration database";
 | 
			
		||||
    $db = esmith::ConfigDB::UTF8->open || warn "Couldn't open configuration database";
 | 
			
		||||
    $rma_datas{ipsecrwSess}  = ($c->param('IpsecrwSess')  || '');
 | 
			
		||||
    $rma_datas{ipsecrwReset} = ($c->param('IpsecrwReset') || '');
 | 
			
		||||
 | 
			
		||||
@@ -144,7 +144,7 @@ sub passwordLogin_list {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub get_prop {
 | 
			
		||||
    $db = esmith::ConfigDB->open || warn "Couldn't open configuration database";
 | 
			
		||||
    $db = esmith::ConfigDB::UTF8->open || warn "Couldn't open configuration database";
 | 
			
		||||
    my ($c, $item, $prop) = @_;
 | 
			
		||||
    warn "You must specify a record key"    unless $item;
 | 
			
		||||
    warn "You must specify a property name" unless $prop;
 | 
			
		||||
@@ -155,8 +155,7 @@ sub get_prop {
 | 
			
		||||
sub get_value {
 | 
			
		||||
    my $c    = shift;
 | 
			
		||||
    my $item = shift;
 | 
			
		||||
    $db = esmith::ConfigDB->open || warn "Couldn't open configuration database";
 | 
			
		||||
    $db = esmith::ConfigDB->open || warn "Couldn't open configuration database";
 | 
			
		||||
    $db = esmith::ConfigDB::UTF8->open || warn "Couldn't open configuration database";
 | 
			
		||||
    return ($db->get($item)->value());
 | 
			
		||||
} ## end sub get_value
 | 
			
		||||
 | 
			
		||||
@@ -205,7 +204,7 @@ sub get_ftp_password_login_access {
 | 
			
		||||
} ## end sub get_ftp_password_login_access
 | 
			
		||||
 | 
			
		||||
sub get_telnet_mode {
 | 
			
		||||
    $db = esmith::ConfigDB->open || warn "Couldn't open configuration database";
 | 
			
		||||
    $db = esmith::ConfigDB::UTF8->open || warn "Couldn't open configuration database";
 | 
			
		||||
    my $telnet = $db->get('telnet');
 | 
			
		||||
    return ('off') unless $telnet;
 | 
			
		||||
    my $status = $telnet->prop('status') || 'disabled';
 | 
			
		||||
@@ -215,7 +214,7 @@ sub get_telnet_mode {
 | 
			
		||||
} ## end sub get_telnet_mode
 | 
			
		||||
 | 
			
		||||
sub get_ipsecrw_sessions {
 | 
			
		||||
    $db = esmith::ConfigDB->open || warn "Couldn't open configuration database";
 | 
			
		||||
    $db = esmith::ConfigDB::UTF8->open || warn "Couldn't open configuration database";
 | 
			
		||||
    my $status = $db->get('ipsec')->prop('RoadWarriorStatus');
 | 
			
		||||
    if (defined($status) && ($status eq 'enabled')) {
 | 
			
		||||
        return ($db->get('ipsec')->prop('RoadWarriorSessions') || '0');
 | 
			
		||||
@@ -225,7 +224,7 @@ sub get_ipsecrw_sessions {
 | 
			
		||||
} ## end sub get_ipsecrw_sessions
 | 
			
		||||
 | 
			
		||||
sub get_ipsecrw_status {
 | 
			
		||||
    $db = esmith::ConfigDB->open || warn "Couldn't open configuration database";
 | 
			
		||||
    $db = esmith::ConfigDB::UTF8->open || warn "Couldn't open configuration database";
 | 
			
		||||
    return undef unless ($db->get('ipsec'));
 | 
			
		||||
    return $db->get('ipsec')->prop('RoadWarriorStatus');
 | 
			
		||||
}
 | 
			
		||||
@@ -233,7 +232,7 @@ sub get_ipsecrw_status {
 | 
			
		||||
sub pptp_and_dhcp_range {
 | 
			
		||||
    my $c           = shift;
 | 
			
		||||
    my $val         = shift || 0;
 | 
			
		||||
    $db = esmith::ConfigDB->open || warn "Couldn't open configuration database";
 | 
			
		||||
    $db = esmith::ConfigDB::UTF8->open || warn "Couldn't open configuration database";
 | 
			
		||||
    my $dhcp_status = $db->get_prop('dhcpd', 'status') || 'disabled';
 | 
			
		||||
    my $dhcp_end    = $db->get_prop('dhcpd', 'end') || '';
 | 
			
		||||
    my $dhcp_start  = $db->get_prop('dhcpd', 'start') || '';
 | 
			
		||||
@@ -251,7 +250,7 @@ sub pptp_and_dhcp_range {
 | 
			
		||||
 | 
			
		||||
sub _get_valid_from {
 | 
			
		||||
    my $c   = shift;
 | 
			
		||||
    $db = esmith::ConfigDB->open || warn "Couldn't open configuration database";
 | 
			
		||||
    $db = esmith::ConfigDB::UTF8->open || warn "Couldn't open configuration database";
 | 
			
		||||
    my $rec = $db->get('httpd-admin');
 | 
			
		||||
    return undef unless ($rec);
 | 
			
		||||
    my @vals = (split ',', ($rec->prop('ValidFrom') || ''));
 | 
			
		||||
@@ -294,11 +293,11 @@ sub validate_network_and_mask {
 | 
			
		||||
 | 
			
		||||
sub change_settings {
 | 
			
		||||
    my ($c, %rma_datas) = @_;
 | 
			
		||||
    $db = esmith::ConfigDB->open || warn "Couldn't open configuration database";
 | 
			
		||||
    $db = esmith::ConfigDB::UTF8->open || warn "Couldn't open configuration database";
 | 
			
		||||
    #------------------------------------------------------------
 | 
			
		||||
    # good; go ahead and change the access.
 | 
			
		||||
    #------------------------------------------------------------
 | 
			
		||||
    $db = esmith::ConfigDB->open || warn "Couldn't open configuration database";
 | 
			
		||||
    $db = esmith::ConfigDB::UTF8->open || warn "Couldn't open configuration database";
 | 
			
		||||
    my $rec = $db->get('telnet');
 | 
			
		||||
    if ($rec) {
 | 
			
		||||
        if ($rma_datas{telnetAccess} eq "off") {
 | 
			
		||||
@@ -370,7 +369,7 @@ sub change_settings {
 | 
			
		||||
sub set_ipsecrw_sessions {
 | 
			
		||||
    my $c        = shift;
 | 
			
		||||
    my $sessions = shift;
 | 
			
		||||
    $db = esmith::ConfigDB->open || warn "Couldn't open configuration database";
 | 
			
		||||
    $db = esmith::ConfigDB::UTF8->open || warn "Couldn't open configuration database";
 | 
			
		||||
    if (defined $sessions) {
 | 
			
		||||
        $db->get('ipsec')->set_prop('RoadWarriorSessions', $sessions);
 | 
			
		||||
 | 
			
		||||
@@ -385,7 +384,7 @@ sub add_new_valid_from {
 | 
			
		||||
    my $c    = shift;
 | 
			
		||||
    my $net  = shift;
 | 
			
		||||
    my $mask = shift;
 | 
			
		||||
    $db = esmith::ConfigDB->open || warn "Couldn't open configuration database";
 | 
			
		||||
    $db = esmith::ConfigDB::UTF8->open || warn "Couldn't open configuration database";
 | 
			
		||||
 | 
			
		||||
    # we transform bit mask to regular mask
 | 
			
		||||
    $mask = get_reg_mask($net, $mask);
 | 
			
		||||
@@ -408,7 +407,7 @@ sub remove_valid_from {
 | 
			
		||||
    my $c           = shift;
 | 
			
		||||
    my $remove_nets = shift;
 | 
			
		||||
    my @remove      = split /,/, $remove_nets;
 | 
			
		||||
    $db = esmith::ConfigDB->open || warn "Couldn't open configuration database";
 | 
			
		||||
    $db = esmith::ConfigDB::UTF8->open || warn "Couldn't open configuration database";
 | 
			
		||||
 | 
			
		||||
    #	my @remove = $c->param('Remove_nets');
 | 
			
		||||
    my @vals = $c->_get_valid_from();
 | 
			
		||||
@@ -439,4 +438,4 @@ sub remove_valid_from {
 | 
			
		||||
    $db->get('httpd-admin')->set_prop('ValidFrom', $prop);
 | 
			
		||||
    return 1;
 | 
			
		||||
} ## end sub remove_valid_from
 | 
			
		||||
1;
 | 
			
		||||
1;
 | 
			
		||||
 
 | 
			
		||||
@@ -8,6 +8,8 @@ use Mojo::Base 'Mojolicious::Controller';
 | 
			
		||||
use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw(theme_list init_session);
 | 
			
		||||
use esmith::ConfigDB::UTF8 qw(open_ro);
 | 
			
		||||
use esmith::AccountsDB::UTF8 qw(open_ro);
 | 
			
		||||
 | 
			
		||||
# retrieve a configuration db record
 | 
			
		||||
sub getconfig {
 | 
			
		||||
@@ -16,8 +18,7 @@ sub getconfig {
 | 
			
		||||
    $c->app->log->info($c->log_req . ' ' . $key);
 | 
			
		||||
 | 
			
		||||
    if ($key) {
 | 
			
		||||
        use esmith::ConfigDB qw(open_ro);
 | 
			
		||||
        my $cdb = esmith::ConfigDB->open_ro;
 | 
			
		||||
        my $cdb = esmith::ConfigDB::UTF8->open_ro;
 | 
			
		||||
        return getdb($c, $cdb, $key);
 | 
			
		||||
    } ## end if ($key)
 | 
			
		||||
} ## end sub getconfig
 | 
			
		||||
@@ -29,8 +30,7 @@ sub getaccount {
 | 
			
		||||
    $c->app->log->info($c->log_req . ' ' . $key);
 | 
			
		||||
 | 
			
		||||
    if ($key) {
 | 
			
		||||
        use esmith::AccountsDB qw(open_ro);
 | 
			
		||||
        my $adb = esmith::AccountsDB->open_ro;
 | 
			
		||||
        my $adb = esmith::AccountsDB::UTF8->open_ro;
 | 
			
		||||
        return getdb($c, $adb, $key);
 | 
			
		||||
    } ## end if ($key)
 | 
			
		||||
} ## end sub getaccount
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ package SrvMngr::Controller::Review;
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
# heading     : Investigation
 | 
			
		||||
# description : Review configuration
 | 
			
		||||
# navigation  : 7000 600
 | 
			
		||||
# navigation  : 7000 400
 | 
			
		||||
# routes : end
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
use strict;
 | 
			
		||||
@@ -13,17 +13,20 @@ use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw(theme_list init_session);
 | 
			
		||||
use SrvMngr qw(gen_locale_date_string);
 | 
			
		||||
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
use esmith::DomainsDB::UTF8;
 | 
			
		||||
use esmith::NetworksDB::UTF8;
 | 
			
		||||
 | 
			
		||||
#use SrvMngr::Review_sub qw(print_page);
 | 
			
		||||
#use smeserver::Panel::review;
 | 
			
		||||
our $db       = esmith::ConfigDB->open_ro   || die "Couldn't open config db";
 | 
			
		||||
our $domains  = esmith::DomainsDB->open_ro  || die "Couldn't open domains";
 | 
			
		||||
our $networks = esmith::NetworksDB->open_ro || die "Couldn't open networks";
 | 
			
		||||
our $db;
 | 
			
		||||
our $domains ;
 | 
			
		||||
our $networks;
 | 
			
		||||
 | 
			
		||||
sub main {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
    $c->app->log->info($c->log_req);
 | 
			
		||||
    $db       = esmith::ConfigDB::UTF8->open_ro   || die "Couldn't open config db";
 | 
			
		||||
    my $title     = $c->l('rvw_FORM_TITLE');
 | 
			
		||||
    my $modul     = $c->render_to_string(inline => $c->l('rvw_DESCRIPTION'));
 | 
			
		||||
    my %rvw_datas = ();
 | 
			
		||||
@@ -97,6 +100,7 @@ sub gen2_email_addresses {
 | 
			
		||||
 | 
			
		||||
sub gen2_domains {
 | 
			
		||||
    my $c          = shift;
 | 
			
		||||
    $domains  = esmith::DomainsDB::UTF8->open_ro  || die "Couldn't open domains";
 | 
			
		||||
    my @virtual    = $domains->get_all_by_prop(type => 'domain');
 | 
			
		||||
    my $numvirtual = @virtual;
 | 
			
		||||
 | 
			
		||||
@@ -125,6 +129,7 @@ serving.	(mojo ver)
 | 
			
		||||
 | 
			
		||||
sub get2_local_networks {
 | 
			
		||||
    my $c           = shift;
 | 
			
		||||
    $networks = esmith::NetworksDB::UTF8->open_ro || die "Couldn't open networks";
 | 
			
		||||
    my @nets        = $networks->get_all_by_prop('type' => 'network');
 | 
			
		||||
    my $numNetworks = @nets;
 | 
			
		||||
 | 
			
		||||
@@ -151,7 +156,7 @@ sub get_net_prop {
 | 
			
		||||
  my $fm = shift;
 | 
			
		||||
  my $item = shift;
 | 
			
		||||
  my $prop = shift;
 | 
			
		||||
 | 
			
		||||
  $networks = esmith::NetworksDB::UTF8->open_ro || die "Couldn't open networks";
 | 
			
		||||
  my $record = $networks->get($item);
 | 
			
		||||
  if ($record) {
 | 
			
		||||
    return $record->prop($prop);
 | 
			
		||||
@@ -165,7 +170,7 @@ sub get_net_prop {
 | 
			
		||||
 | 
			
		||||
sub get_local_networks {
 | 
			
		||||
    my $fm = shift;
 | 
			
		||||
 | 
			
		||||
    $networks = esmith::NetworksDB::UTF8->open_ro || die "Couldn't open networks";
 | 
			
		||||
    my @nets = $networks->get_all_by_prop('type' => 'network');
 | 
			
		||||
 | 
			
		||||
    my $numNetworks = @nets;
 | 
			
		||||
@@ -265,6 +270,7 @@ sub print2_dhcp_stanza {
 | 
			
		||||
sub get_value {
 | 
			
		||||
  my $fm = shift;
 | 
			
		||||
  my $item = shift;
 | 
			
		||||
  $db       = esmith::ConfigDB::UTF8->open_ro   || die "Couldn't open config db";
 | 
			
		||||
  my $record = $db->get($item);
 | 
			
		||||
  if ($record) {
 | 
			
		||||
    return $record->value();
 | 
			
		||||
@@ -281,7 +287,7 @@ sub get_prop {
 | 
			
		||||
				 #otherwise, we don't want to grab it
 | 
			
		||||
  my $item = shift;
 | 
			
		||||
  my $prop = shift;
 | 
			
		||||
 | 
			
		||||
  $db       = esmith::ConfigDB::UTF8->open_ro   || die "Couldn't open config db";
 | 
			
		||||
  my $record = $db->get($item);
 | 
			
		||||
  if ($record) {
 | 
			
		||||
    return $record->prop($prop);
 | 
			
		||||
@@ -295,6 +301,7 @@ sub get_prop {
 | 
			
		||||
sub get_public_ip_address
 | 
			
		||||
{
 | 
			
		||||
    my $self = shift;
 | 
			
		||||
    $db       = esmith::ConfigDB::UTF8->open_ro   || die "Couldn't open config db";
 | 
			
		||||
    my $sysconfig = $db->get('sysconfig');
 | 
			
		||||
    if ($sysconfig)
 | 
			
		||||
    {
 | 
			
		||||
@@ -308,4 +315,4 @@ sub get_public_ip_address
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
1;
 | 
			
		||||
1;
 | 
			
		||||
 
 | 
			
		||||
@@ -5,19 +5,18 @@ package SrvMngr::Controller::Swttheme;
 | 
			
		||||
use strict;
 | 
			
		||||
use warnings;
 | 
			
		||||
use Mojo::Base 'Mojolicious::Controller';
 | 
			
		||||
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
#use SrvMngr qw(theme_list init_session);
 | 
			
		||||
our $db = esmith::ConfigDB->open() || die "Couldn't open config db";
 | 
			
		||||
 | 
			
		||||
sub main {
 | 
			
		||||
    my $c     = shift;
 | 
			
		||||
    my $db = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
 | 
			
		||||
    my $from  = $c->param('From') || '/';
 | 
			
		||||
    my $theme = $c->param('Theme');
 | 
			
		||||
    $c->app->log->info(" swt theme '$from'  '$theme' ");
 | 
			
		||||
    my $oldTheme = $c->session->{CurrentTheme};
 | 
			
		||||
 | 
			
		||||
    if ($theme ne $oldTheme) {
 | 
			
		||||
 | 
			
		||||
        #	$c->app->renderer->paths([$c->app->home->rel_file('themes/default/templates')]);
 | 
			
		||||
        #	$c->app->static->paths([$c->app->home->rel_file('themes/default/public')]);
 | 
			
		||||
        #	if ( $theme ne 'default' ) {
 | 
			
		||||
@@ -31,7 +30,7 @@ sub main {
 | 
			
		||||
        system("/sbin/e-smith/signal-event smanager-theme-change") == 0
 | 
			
		||||
            or warn "$c->l('ERROR_UPDATING')";
 | 
			
		||||
    } ## end if ($theme ne $oldTheme)
 | 
			
		||||
## (not sure)     $c->flash( warning => $c->l('swt_LOGIN_AGAIN') );
 | 
			
		||||
    ## (not sure)     $c->flash( warning => $c->l('swt_LOGIN_AGAIN') );
 | 
			
		||||
    $from = '/initial'  if $from eq '/';
 | 
			
		||||
    $from = '/' . $from if ($from !~ m|^\/|);
 | 
			
		||||
    $c->redirect_to($from);
 | 
			
		||||
 
 | 
			
		||||
@@ -15,28 +15,20 @@ use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw(theme_list init_session
 | 
			
		||||
    validate_password email_simple);
 | 
			
		||||
 | 
			
		||||
#use esmith::FormMagick qw( validate_password );
 | 
			
		||||
#use CGI::FormMagick::Validator qw( call_fm_validation );
 | 
			
		||||
use esmith::AccountsDB;
 | 
			
		||||
use esmith::ConfigDB;
 | 
			
		||||
use esmith::AccountsDB::UTF8;
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
use esmith::util;
 | 
			
		||||
 | 
			
		||||
#use esmith::FormMagick;
 | 
			
		||||
#use esmith::cgi;
 | 
			
		||||
#use File::Basename;
 | 
			
		||||
#use Exporter;
 | 
			
		||||
#use Carp qw(verbose);
 | 
			
		||||
#use esmith::FormMagick::Panel::useraccounts;
 | 
			
		||||
#our $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
#our $cdb = esmith::ConfigDB->open() || die "Couldn't open config db";
 | 
			
		||||
my ($cdb,$adb);
 | 
			
		||||
 | 
			
		||||
sub main {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
    $c->app->log->info($c->log_req);
 | 
			
		||||
	$cdb = esmith::ConfigDB->open() || die "Couldn't open config db";
 | 
			
		||||
	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
	$cdb = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
 | 
			
		||||
	$adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
    my $notif     = '';
 | 
			
		||||
    my %usr_datas = ();
 | 
			
		||||
    my $title     = $c->l('usr_FORM_TITLE');
 | 
			
		||||
@@ -55,8 +47,8 @@ sub do_display {
 | 
			
		||||
    my %usr_datas = ();
 | 
			
		||||
    my $title     = $c->l('usr_FORM_TITLE');
 | 
			
		||||
    my ($notif, $modul) = '';
 | 
			
		||||
	$cdb = esmith::ConfigDB->open() || die "Couldn't open config db";
 | 
			
		||||
	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
	$cdb = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
 | 
			
		||||
	$adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
    $usr_datas{'trt'} = $trt;
 | 
			
		||||
 | 
			
		||||
    if ($trt eq 'ADD') {
 | 
			
		||||
@@ -143,8 +135,8 @@ sub do_update {
 | 
			
		||||
    $usr_datas{trt} = $trt;
 | 
			
		||||
    my $title = $c->l('usr_FORM_TITLE');
 | 
			
		||||
    my ($res, $result) = '';
 | 
			
		||||
	$cdb = esmith::ConfigDB->open() || die "Couldn't open config db";
 | 
			
		||||
	$adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
	$cdb = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
 | 
			
		||||
	$adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
 | 
			
		||||
    if ($trt eq 'ADD') {
 | 
			
		||||
 | 
			
		||||
@@ -363,10 +355,10 @@ sub lock_account {
 | 
			
		||||
        $user = $1;
 | 
			
		||||
 | 
			
		||||
        if (system("/sbin/e-smith/signal-event", "user-lock", $user)) {
 | 
			
		||||
            $adb = esmith::AccountsDB->open();
 | 
			
		||||
            $adb = esmith::AccountsDB::UTF8->open();
 | 
			
		||||
            return $c->l("usr_ERR_OCCURRED_LOCKING");
 | 
			
		||||
        }
 | 
			
		||||
        $adb = esmith::AccountsDB->open();
 | 
			
		||||
        $adb = esmith::AccountsDB::UTF8->open();
 | 
			
		||||
        return 'OK';
 | 
			
		||||
    } else {
 | 
			
		||||
        return $c->l('NO_SUCH_USER', $user);
 | 
			
		||||
@@ -387,10 +379,10 @@ sub remove_account {
 | 
			
		||||
        $user = $1;
 | 
			
		||||
 | 
			
		||||
        if (system("/sbin/e-smith/signal-event", "user-delete", $user)) {
 | 
			
		||||
            $adb = esmith::AccountsDB->open();
 | 
			
		||||
            $adb = esmith::AccountsDB::UTF8->open();
 | 
			
		||||
            return $c->l("ERR_OCCURRED_DELETING");
 | 
			
		||||
        }
 | 
			
		||||
        $adb = esmith::AccountsDB->open();
 | 
			
		||||
        $adb = esmith::AccountsDB::UTF8->open();
 | 
			
		||||
        $adb->get($user)->delete;
 | 
			
		||||
        return 'OK';
 | 
			
		||||
    } else {
 | 
			
		||||
@@ -406,7 +398,7 @@ sub reset_password {
 | 
			
		||||
        return $c->l('usr_TAINTED_USER');
 | 
			
		||||
    }
 | 
			
		||||
    $user = $1;
 | 
			
		||||
	my $adb = esmith::AccountsDB->open || die "Couldn't open accounts db";
 | 
			
		||||
	my $adb = esmith::AccountsDB::UTF8->open || die "Couldn't open accounts db";
 | 
			
		||||
    my $acct = $adb->get($user);
 | 
			
		||||
 | 
			
		||||
    if ($acct->prop('type') eq "user") {
 | 
			
		||||
@@ -415,10 +407,10 @@ sub reset_password {
 | 
			
		||||
        undef $adb;
 | 
			
		||||
 | 
			
		||||
        if (system("/sbin/e-smith/signal-event", "password-modify", $user)) {
 | 
			
		||||
            $adb = esmith::AccountsDB->open();
 | 
			
		||||
            $adb = esmith::AccountsDB::UTF8->open();
 | 
			
		||||
            return $c->l("usr_ERR_OCCURRED_MODIFYING_PASSWORD");
 | 
			
		||||
        }
 | 
			
		||||
        $adb = esmith::AccountsDB->open();
 | 
			
		||||
        $adb = esmith::AccountsDB::UTF8->open();
 | 
			
		||||
        return 'OK';
 | 
			
		||||
    } else {
 | 
			
		||||
        return $c->l('NO_SUCH_USER', $user);
 | 
			
		||||
@@ -671,10 +663,10 @@ sub modify_user {
 | 
			
		||||
        undef $adb;
 | 
			
		||||
 | 
			
		||||
        unless (system("/sbin/e-smith/signal-event", "user-modify", $acctName) == 0) {
 | 
			
		||||
            $adb = esmith::AccountsDB->open();
 | 
			
		||||
            $adb = esmith::AccountsDB::UTF8->open();
 | 
			
		||||
            return $c->l('usr_CANNOT_MODIFY_USER');
 | 
			
		||||
        }
 | 
			
		||||
        $adb = esmith::AccountsDB->open();
 | 
			
		||||
        $adb = esmith::AccountsDB::UTF8->open();
 | 
			
		||||
    } ## end if ($acctType eq "user")
 | 
			
		||||
    return 'OK';
 | 
			
		||||
} ## end sub modify_user
 | 
			
		||||
@@ -707,10 +699,10 @@ sub create_user {
 | 
			
		||||
    $acctName = $1;
 | 
			
		||||
 | 
			
		||||
    if (system("/sbin/e-smith/signal-event", "user-create", $acctName)) {
 | 
			
		||||
        $adb = esmith::AccountsDB->open();
 | 
			
		||||
        $adb = esmith::AccountsDB::UTF8->open();
 | 
			
		||||
        return $c->l("usr_ERR_OCCURRED_CREATING");
 | 
			
		||||
    }
 | 
			
		||||
    $adb = esmith::AccountsDB->open();
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open();
 | 
			
		||||
    $c->set_groups();
 | 
			
		||||
    return 'OK';
 | 
			
		||||
} ## end sub create_user
 | 
			
		||||
@@ -735,7 +727,7 @@ sub modify_admin {
 | 
			
		||||
    $acct->merge_props(%newProperties);
 | 
			
		||||
    undef $adb;
 | 
			
		||||
    my $status = system("/sbin/e-smith/signal-event", "user-modify-admin", 'admin');
 | 
			
		||||
    $adb = esmith::AccountsDB->open();
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open();
 | 
			
		||||
 | 
			
		||||
    if ($status == 0) {
 | 
			
		||||
        return 'OK';
 | 
			
		||||
@@ -759,8 +751,7 @@ sub system_validate_password {
 | 
			
		||||
sub system_check_password {
 | 
			
		||||
    my $c     = shift;
 | 
			
		||||
    my $pass1 = shift;
 | 
			
		||||
    use esmith::ConfigDB;
 | 
			
		||||
    my $conf = esmith::ConfigDB->open();
 | 
			
		||||
    my $conf = esmith::ConfigDB::UTF8->open();
 | 
			
		||||
    my ($check_type, $rec);
 | 
			
		||||
 | 
			
		||||
    if ($conf) {
 | 
			
		||||
 
 | 
			
		||||
@@ -12,12 +12,11 @@ use strict;
 | 
			
		||||
use warnings;
 | 
			
		||||
use Mojo::Base 'Mojolicious::Controller';
 | 
			
		||||
use esmith::util;
 | 
			
		||||
use esmith::ConfigDB;
 | 
			
		||||
use esmith::AccountsDB;
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
use esmith::AccountsDB::UTF8;
 | 
			
		||||
use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw( theme_list init_session validate_password );
 | 
			
		||||
#our $cdb = esmith::ConfigDB->open_ro || die "Couldn't open configuration db";
 | 
			
		||||
 | 
			
		||||
sub main {
 | 
			
		||||
    my $c         = shift;
 | 
			
		||||
@@ -161,7 +160,7 @@ sub reset_password {
 | 
			
		||||
    my $ret;
 | 
			
		||||
    return $c->l('usr_TAINTED_USER') unless (($user) = ($user =~ /^(\w[\-\w_\.]*)$/));
 | 
			
		||||
    $user = $1;
 | 
			
		||||
    my $adb  = esmith::AccountsDB->open();
 | 
			
		||||
    my $adb  = esmith::AccountsDB::UTF8->open();
 | 
			
		||||
    my $acct = $adb->get($user);
 | 
			
		||||
    return $c->l('NO_SUCH_USER', $user) unless ($acct->prop('type') eq 'user');
 | 
			
		||||
    $ret = esmith::util::setUserPasswordRequirePrevious($user, $oldpassword, $password) if $trt ne 'RESET';
 | 
			
		||||
@@ -171,10 +170,10 @@ sub reset_password {
 | 
			
		||||
    undef $adb;
 | 
			
		||||
 | 
			
		||||
    if (system("/sbin/e-smith/signal-event", "password-modify", $user)) {
 | 
			
		||||
        $adb = esmith::AccountsDB->open();
 | 
			
		||||
        $adb = esmith::AccountsDB::UTF8->open();
 | 
			
		||||
        return $c->l("usr_ERR_OCCURRED_MODIFYING_PASSWORD");
 | 
			
		||||
    }
 | 
			
		||||
    $adb = esmith::AccountsDB->open();
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open();
 | 
			
		||||
    return 'OK';
 | 
			
		||||
} ## end sub reset_password
 | 
			
		||||
 | 
			
		||||
@@ -194,7 +193,7 @@ sub check_password {
 | 
			
		||||
    my $c        = shift;
 | 
			
		||||
    my $password = shift;
 | 
			
		||||
    my $strength;
 | 
			
		||||
   	my $cdb = esmith::ConfigDB->open_ro || die "Couldn't open configuration db";
 | 
			
		||||
    my $cdb = esmith::ConfigDB::UTF8->open_ro || die "Couldn't open configuration db";
 | 
			
		||||
    my $rec = $cdb->get('passwordstrength');
 | 
			
		||||
    $strength = ($rec ? ($rec->prop('Users') || 'none') : 'none');
 | 
			
		||||
    return validate_password($c, $strength, $password);
 | 
			
		||||
 
 | 
			
		||||
@@ -15,14 +15,15 @@ use Mojo::Base 'Mojolicious::Controller';
 | 
			
		||||
use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw(theme_list init_session);
 | 
			
		||||
use esmith::ConfigDB;
 | 
			
		||||
use File::Basename;
 | 
			
		||||
use HTML::Entities;
 | 
			
		||||
use SrvMngr qw(gen_locale_date_string);
 | 
			
		||||
use File::Temp qw(tempfile);
 | 
			
		||||
use constant TRUE  => 1;
 | 
			
		||||
use constant FALSE => 0;
 | 
			
		||||
our $cdb = esmith::ConfigDB->open() || die "Couldn't open config db";
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
 | 
			
		||||
our $cdb;
 | 
			
		||||
our @logfiles = ();    # with array
 | 
			
		||||
 | 
			
		||||
sub main {
 | 
			
		||||
@@ -31,6 +32,7 @@ sub main {
 | 
			
		||||
    my %log_datas = ();
 | 
			
		||||
    my $title     = $c->l('log_FORM_TITLE');
 | 
			
		||||
    my $notif     = '';
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
 | 
			
		||||
    my $viewlog = $cdb->get('viewlogfiles');
 | 
			
		||||
    $log_datas{default_op} = ($viewlog ? $viewlog->prop('DefaultOperation') : undef) || 'view';
 | 
			
		||||
    $c->stash(title => $title, notif => $notif, log_datas => \%log_datas);
 | 
			
		||||
@@ -231,6 +233,7 @@ sub showlogFile {
 | 
			
		||||
sub download_logFile {
 | 
			
		||||
    my ($c, %log_datas) = @_;
 | 
			
		||||
    my $fullpath = "/var/log/$log_datas{filename}";
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
 | 
			
		||||
 | 
			
		||||
    # Save this information for later.
 | 
			
		||||
    $cdb->get('viewlogfiles')->merge_props('DefaultOperation', $log_datas{operation});
 | 
			
		||||
 
 | 
			
		||||
@@ -13,11 +13,13 @@ use Mojo::Base 'Mojolicious::Controller';
 | 
			
		||||
use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw(theme_list init_session);
 | 
			
		||||
our $db = esmith::ConfigDB->open || die "Couldn't open config db";
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
our $db ;
 | 
			
		||||
 | 
			
		||||
sub main {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
    $c->app->log->info($c->log_req);
 | 
			
		||||
    $db = esmith::ConfigDB::UTF8->open || die "Couldn't open config db";
 | 
			
		||||
    my %wkg_datas = ();
 | 
			
		||||
    my $title     = $c->l('wkg_FORM_TITLE');
 | 
			
		||||
    my $modul     = '';
 | 
			
		||||
 
 | 
			
		||||
@@ -3,7 +3,7 @@ package SrvMngr::Controller::Yum;
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
# heading     : System
 | 
			
		||||
# description : Software installer
 | 
			
		||||
# navigation  : 4000 300
 | 
			
		||||
# navigation  : 4000 500
 | 
			
		||||
#
 | 
			
		||||
# routes : end
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
@@ -13,28 +13,30 @@ use Mojo::Base 'Mojolicious::Controller';
 | 
			
		||||
use Locale::gettext;
 | 
			
		||||
use SrvMngr::I18N;
 | 
			
		||||
use SrvMngr qw(theme_list init_session ip_number_or_blank);
 | 
			
		||||
use esmith::ConfigDB;
 | 
			
		||||
# dnf_* should remain ASCII; yum_repositories do not need to be UTF-8
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
use esmith::util;
 | 
			
		||||
use File::Basename;
 | 
			
		||||
our $cdb = esmith::ConfigDB->open || die "Couldn't open config db";
 | 
			
		||||
our $cdb;
 | 
			
		||||
my $dnf_status_file = '/var/cache/dnf/dnf.status';
 | 
			
		||||
 | 
			
		||||
#use File::stat;
 | 
			
		||||
our %dbs;
 | 
			
		||||
 | 
			
		||||
for (qw(available installed updates)) {
 | 
			
		||||
    $dbs{$_} = esmith::ConfigDB->open_ro("dnf_$_")
 | 
			
		||||
    $dbs{$_} = esmith::ConfigDB::UTF8->open_ro("dnf_$_")
 | 
			
		||||
        or die "Couldn't open dnf_$_ DB\n";
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
for (qw(repositories)) {
 | 
			
		||||
    $dbs{$_} = esmith::ConfigDB->open("yum_$_")
 | 
			
		||||
    $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";
 | 
			
		||||
    my %yum_datas = ();
 | 
			
		||||
    my $title     = $c->l('yum_FORM_TITLE');
 | 
			
		||||
    my $dest      = 'yum';
 | 
			
		||||
@@ -60,6 +62,7 @@ sub do_display {
 | 
			
		||||
    my $c         = shift;
 | 
			
		||||
    my $rt        = $c->current_route;
 | 
			
		||||
    my $trt       = ($c->param('trt') || 'STAT');
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open || die "Couldn't open config db";
 | 
			
		||||
    my %yum_datas = ();
 | 
			
		||||
    my $title     = $c->l('yum_FORM_TITLE');
 | 
			
		||||
    my ($notif, $dest) = '';
 | 
			
		||||
 
 | 
			
		||||
@@ -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.',
 | 
			
		||||
@@ -4,19 +4,19 @@ use strict;
 | 
			
		||||
use warnings;
 | 
			
		||||
use utf8;
 | 
			
		||||
 | 
			
		||||
use esmith::ConfigDB;
 | 
			
		||||
use esmith::AccountsDB;
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
use esmith::AccountsDB::UTF8;
 | 
			
		||||
use esmith::util;
 | 
			
		||||
 | 
			
		||||
use Net::LDAP qw/LDAP_INVALID_CREDENTIALS/;
 | 
			
		||||
 | 
			
		||||
our ($cdb,$adb);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
sub init_data {
 | 
			
		||||
 | 
			
		||||
    my %datas = ();
 | 
			
		||||
 | 
			
		||||
    my $cdb = esmith::ConfigDB->open_ro() or die("can't open Config DB");
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open_ro() or die("can't open Config DB");
 | 
			
		||||
    my $sysconfig = $cdb->get("sysconfig");
 | 
			
		||||
 | 
			
		||||
    $datas{'lang'} = $sysconfig->prop('Language') || 'en_US';
 | 
			
		||||
@@ -42,7 +42,7 @@ sub init_data {
 | 
			
		||||
 | 
			
		||||
sub reconf_needed {
 | 
			
		||||
 | 
			
		||||
    my $cdb = esmith::ConfigDB->open_ro() or die("can't open Config DB");
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open_ro() or die("can't open Config DB");
 | 
			
		||||
    #my $unsafe = ($cdb->get('bootstrap-console') and $cdb->get('bootstrap-console')->prop('Run') eq 'yes') ||
 | 
			
		||||
    #     ($cdb->get('UnsavedChanges') and $cdb->get('UnsavedChanges')->value eq 'yes') || '0';
 | 
			
		||||
	my $unsafe = ($cdb->get('UnsavedChanges') and $cdb->get('UnsavedChanges')->value eq 'yes') || '0';   
 | 
			
		||||
@@ -55,7 +55,7 @@ sub check_credentials {
 | 
			
		||||
    my ($c, $username, $password) = @_;
 | 
			
		||||
    return unless $username || $password;
 | 
			
		||||
 | 
			
		||||
    my $cdb = esmith::ConfigDB->open_ro() or die("can't open Configuration DB");
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open_ro() or die("can't open Configuration DB");
 | 
			
		||||
    my $l = $cdb->get('ldap');
 | 
			
		||||
    my $status = $l->prop('status') || "disabled";
 | 
			
		||||
    unless ($status eq "enabled" ) {
 | 
			
		||||
@@ -88,13 +88,13 @@ sub check_adminalias {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
 | 
			
		||||
    my $alias;
 | 
			
		||||
    my $cdb = esmith::ConfigDB->open_ro() or die("can't open Configuration DB");
 | 
			
		||||
    $cdb = esmith::ConfigDB::UTF8->open_ro() or die("can't open Configuration DB");
 | 
			
		||||
    if (defined $cdb->get('AdminAlias')) {
 | 
			
		||||
	$alias = $cdb->get('AdminAlias')->value;
 | 
			
		||||
    }
 | 
			
		||||
    return undef unless $alias;
 | 
			
		||||
 | 
			
		||||
    my $adb = esmith::AccountsDB->open_ro() or die("can't open Accounts DB");
 | 
			
		||||
    $adb = esmith::AccountsDB::UTF8->open_ro() or die("can't open Accounts DB");
 | 
			
		||||
    my $arec = $adb->get( $alias );
 | 
			
		||||
    return undef unless $arec;
 | 
			
		||||
 | 
			
		||||
@@ -105,4 +105,4 @@ sub check_adminalias {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
1;
 | 
			
		||||
1;
 | 
			
		||||
 
 | 
			
		||||
@@ -5,7 +5,7 @@ package SrvMngr_Auth;
 | 
			
		||||
use strict;
 | 
			
		||||
use warnings;
 | 
			
		||||
use Exporter qw(import); # Import the Exporter module
 | 
			
		||||
use esmith::AccountsDB;
 | 
			
		||||
use esmith::AccountsDB::UTF8;
 | 
			
		||||
 | 
			
		||||
# Define functions to be exported upon request
 | 
			
		||||
our @EXPORT_OK = qw(check_admin_access load_user_auth_info has_panel_access get_panel_from_path);
 | 
			
		||||
@@ -42,7 +42,7 @@ sub load_user_auth_info {
 | 
			
		||||
    
 | 
			
		||||
    # If not admin, get allowed panels
 | 
			
		||||
    if (!$auth_info{is_admin} && $auth_info{username}) {
 | 
			
		||||
        my $accountsdb = esmith::AccountsDB->open_ro();
 | 
			
		||||
        my $accountsdb = esmith::AccountsDB::UTF8->open_ro();
 | 
			
		||||
        if ($accountsdb) {
 | 
			
		||||
            my $user_rec = $accountsdb->get($auth_info{username});
 | 
			
		||||
            # Check if the property exists before trying to get its value
 | 
			
		||||
@@ -69,7 +69,8 @@ sub has_panel_access {
 | 
			
		||||
    
 | 
			
		||||
    # Check if requested panel is in allowed panels
 | 
			
		||||
    foreach my $allowed_panel (@{$auth_info->{allowed_panels}}) {
 | 
			
		||||
        return 1 if $panel eq lc($allowed_panel); #Controller files are capitalised, but that is lost in panel id.
 | 
			
		||||
		return 1 if lc($panel) eq lc($allowed_panel) 
 | 
			
		||||
         || lc(substr($panel, 0, length($allowed_panel))) eq lc($allowed_panel);
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    return 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -5,11 +5,11 @@
 | 
			
		||||
use strict;
 | 
			
		||||
use warnings;
 | 
			
		||||
 | 
			
		||||
use esmith::ConfigDB;
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
 | 
			
		||||
use constant WEBFUNCTIONS => '/usr/share/smanager/lib/SrvMngr/Controller/';
 | 
			
		||||
 | 
			
		||||
my $rtdb = esmith::ConfigDB->open('routes') or
 | 
			
		||||
my $rtdb = esmith::ConfigDB::UTF8->open('routes') or
 | 
			
		||||
        die "Couldn't access Routes database\n";
 | 
			
		||||
 | 
			
		||||
my @routes = $rtdb->get_all_by_prop( type => 'route' );
 | 
			
		||||
 
 | 
			
		||||
@@ -7,7 +7,7 @@
 | 
			
		||||
use strict;
 | 
			
		||||
use warnings;
 | 
			
		||||
 | 
			
		||||
use esmith::ConfigDB;
 | 
			
		||||
use esmith::ConfigDB::UTF8;
 | 
			
		||||
 | 
			
		||||
sub gen_pwd {
 | 
			
		||||
    use MIME::Base64 qw(encode_base64);
 | 
			
		||||
@@ -29,7 +29,7 @@ sub gen_pwd {
 | 
			
		||||
    return $p;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
my $cdb = esmith::ConfigDB->open() || die "Couldn't open config db";
 | 
			
		||||
my $cdb = esmith::ConfigDB::UTF8->open() || die "Couldn't open config db";
 | 
			
		||||
 | 
			
		||||
my $pwds = $cdb->get_prop('smanager','Secrets');
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -14,6 +14,10 @@ BEGIN
 | 
			
		||||
    $ENV{'HOME'} = '/usr/share/smanager';
 | 
			
		||||
    delete $ENV{'ENV'};
 | 
			
		||||
    esmith::util::setRealToEffective();
 | 
			
		||||
    #to help debug UTF8, see perlrun and perlvar -CSAD or -CLSD
 | 
			
		||||
    #print '$ENV{PERL_UNICODE}='.$ENV{'PERL_UNICODE'}."\n" if $ENV{'PERL_UNICODE'};
 | 
			
		||||
    #print '${^UNICODE}='.${^UNICODE}.' ; ${^UTF8LOCALE}='.${^UTF8LOCALE} ."\n";
 | 
			
		||||
    #print '${^OPEN}'.${^OPEN}."\n" if ${^OPEN} ;
 | 
			
		||||
} 
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -6,8 +6,8 @@ use Test::Mojo;
 | 
			
		||||
use FindBin;
 | 
			
		||||
use lib "$FindBin::Bin/../lib";
 | 
			
		||||
 | 
			
		||||
eval "use esmith::ConfigDB";
 | 
			
		||||
plan skip_all => 'esmith::ConfigDB (and others) required for testing 002_basic' if $@;
 | 
			
		||||
eval "use esmith::ConfigDB::UTF8";
 | 
			
		||||
plan skip_all => 'esmith::ConfigDB::UTF8 (and others) required for testing 002_basic' if $@;
 | 
			
		||||
 | 
			
		||||
plan tests => 3;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -6,8 +6,8 @@ use Test::Mojo;
 | 
			
		||||
use FindBin;
 | 
			
		||||
use lib "$FindBin::Bin/../lib";
 | 
			
		||||
 | 
			
		||||
eval "use esmith::ConfigDB";
 | 
			
		||||
plan skip_all => 'esmith::ConfigDB (and others) required for testing 004_panels' if $@;
 | 
			
		||||
eval "use esmith::ConfigDB::UTF8";
 | 
			
		||||
plan skip_all => 'esmith::ConfigDB::UTF8 (and others) required for testing 004_panels' if $@;
 | 
			
		||||
 | 
			
		||||
my $tests;
 | 
			
		||||
plan tests => $tests;
 | 
			
		||||
@@ -17,8 +17,8 @@ BEGIN { $tests += 2 * 3 };
 | 
			
		||||
my $t = Test::Mojo->new('SrvMngr');
 | 
			
		||||
$t->ua->max_redirects(1);
 | 
			
		||||
 | 
			
		||||
$t->get_ok('/')->status_is(200)->content_like(qr/SME Server 10/);
 | 
			
		||||
$t->get_ok('/manual')->status_is(200)->content_like(qr/SME Server 10/);
 | 
			
		||||
$t->get_ok('/')->status_is(200)->content_like(qr/SME Server 11/);
 | 
			
		||||
$t->get_ok('/manual')->status_is(200)->content_like(qr/SME Server 11/);
 | 
			
		||||
 | 
			
		||||
BEGIN { $tests += 5 * 2 };
 | 
			
		||||
my @panels = qw/ Initial Login Manual Support Request /;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,6 @@
 | 
			
		||||
<%
 | 
			
		||||
 | 
			
		||||
    my $backups = esmith::BackupHistoryDB->open;
 | 
			
		||||
    my $backups = esmith::BackupHistoryDB->open; # no UTF8
 | 
			
		||||
    my $now = time();
 | 
			
		||||
    my $backup_rec = $backups->new_record($now, {
 | 
			
		||||
	type => 'backup_record', BackupType => 'desktop',
 | 
			
		||||
@@ -64,4 +64,4 @@
 | 
			
		||||
    $backup_rec->set_prop('Result', "0");
 | 
			
		||||
 | 
			
		||||
%>
 | 
			
		||||
1;
 | 
			
		||||
1;
 | 
			
		||||
 
 | 
			
		||||
@@ -1,43 +1,40 @@
 | 
			
		||||
<div id='ln_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;
 | 
			
		||||
 | 
			
		||||
   <br>
 | 
			
		||||
	%if ($ret{'ret'} eq "") {
 | 
			
		||||
   	
 | 
			
		||||
	%} elsif (index($ret{ret},"SUCCESS") != -1) {
 | 
			
		||||
	   <div class='success'>
 | 
			
		||||
	       <!--<h2> Operation Status Report</h2>-->
 | 
			
		||||
		%= $c->render_to_string(inline => l($ret{ret},$var1,$var2,$var3,$var4,$var5,$var6));
 | 
			
		||||
		</div>
 | 
			
		||||
	   %} else { 
 | 
			
		||||
	   <div class='sme-error'>
 | 
			
		||||
	       <!--<h2> Operation Status Report - Error</h2>-->
 | 
			
		||||
		%= $c->render_to_string(inline => l($ret{ret},$var1,$var2,$var3,$var4,$var5,$var6));
 | 
			
		||||
    	</div>
 | 
			
		||||
	%}
 | 
			
		||||
	% if ($c->app->config->{debug}) {
 | 
			
		||||
	<p>
 | 
			
		||||
		%= dumper { ret_data => \%ret }
 | 
			
		||||
	</p>  
 | 
			
		||||
	% }
 | 
			
		||||
 | 
			
		||||
	% if ($ret{ret} eq "") {
 | 
			
		||||
		%=l "ln_FIRSTPAGE_DESC"
 | 
			
		||||
	% } 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 />
 | 
			
		||||
    % my $btn = l('ADD');
 | 
			
		||||
    % my $network_db = esmith::NetworksDB->open();
 | 
			
		||||
    
 | 
			
		||||
    % my $network_db = esmith::NetworksDB::UTF8->open() || die "Couldn't open NetworksDB db";
 | 
			
		||||
 | 
			
		||||
   % if (config->{debug} == 1) {
 | 
			
		||||
	<p>
 | 
			
		||||
	%= dumper $c->current_route
 | 
			
		||||
	%= dumper $c->stash("ret")
 | 
			
		||||
	</p>
 | 
			
		||||
    % }
 | 
			
		||||
     
 | 
			
		||||
 | 
			
		||||
    %= form_for '/localnetworksb' => (method => 'POST') => begin
 | 
			
		||||
		<h2>
 | 
			
		||||
		%=l "ln_ADD_TITLE"
 | 
			
		||||
 
 | 
			
		||||
@@ -3,41 +3,30 @@
 | 
			
		||||
    %= form_for '/localnetworksa' => (method => 'POST') => begin
 | 
			
		||||
 | 
			
		||||
	% my $retref= $c->stash("ret");
 | 
			
		||||
	% my %ret;
 | 
			
		||||
	% unless (length($retref)) {%ret = (ret=>"");}
 | 
			
		||||
	% else {%ret = %$retref;}
 | 
			
		||||
	% my %ret = $retref ? %$retref : (ret => "");
 | 
			
		||||
	% my @vars = split(/,/, $ret{vars} // '');
 | 
			
		||||
	% my ($var1, $var2, $var3, $var4, $var5, $var6, $var7) = @vars;
 | 
			
		||||
 | 
			
		||||
    % if (config->{debug} == 1) {
 | 
			
		||||
	% if ($c->app->config->{debug}) {
 | 
			
		||||
	<p>
 | 
			
		||||
		%= dumper "Ret:".$ret{ret};
 | 
			
		||||
	</p>	
 | 
			
		||||
	%}
 | 
			
		||||
		%= dumper { ret_data => \%ret }
 | 
			
		||||
	</p>  
 | 
			
		||||
	% }
 | 
			
		||||
 | 
			
		||||
	% 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 $var7 = @vars[6];
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	%if ($ret{ret} eq "") {
 | 
			
		||||
	% if ($ret{ret} eq "") {
 | 
			
		||||
		%=l "ln_FIRSTPAGE_DESC"
 | 
			
		||||
	%} elsif (index($ret{ret},"SUCCESS") != -1) {
 | 
			
		||||
	   <br>
 | 
			
		||||
	   <div class='success'>
 | 
			
		||||
	       <!--<h2> Operation Status Report</h2>-->
 | 
			
		||||
		%= $c->render_to_string(inline => l($ret{ret},$var1,$var2,$var3,$var4,$var5,$var6,$var7));
 | 
			
		||||
		</div>
 | 
			
		||||
	   %} else { 
 | 
			
		||||
	   <br>
 | 
			
		||||
	   <div class='sme-error'>
 | 
			
		||||
	       <!--<h2> Operation Status Report - Error</h2>-->
 | 
			
		||||
		%= $c->render_to_string(inline => l($ret{ret},$var1,$var2,$var3,$var4,$var5,$var6,$var7));
 | 
			
		||||
    	</div>
 | 
			
		||||
	%}
 | 
			
		||||
	% } 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>
 | 
			
		||||
	% }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
	<p>
 | 
			
		||||
	<br>
 | 
			
		||||
 
 | 
			
		||||
@@ -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>
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@ Summary: Sme server  navigation module : manager 2
 | 
			
		||||
%define name smeserver-manager
 | 
			
		||||
Name: %{name}
 | 
			
		||||
%define version 11.0.0
 | 
			
		||||
%define release 80
 | 
			
		||||
%define release 91
 | 
			
		||||
Version: %{version}
 | 
			
		||||
Release: %{release}%{?dist}
 | 
			
		||||
License: GPL
 | 
			
		||||
@@ -22,8 +22,9 @@ BuildRequires: smeserver-devtools
 | 
			
		||||
#BuildRequires:  perl(Net::Netmask) >= 1.9
 | 
			
		||||
#</Build tests>
 | 
			
		||||
 | 
			
		||||
Requires: smeserver-lib >= 1.18.0-26
 | 
			
		||||
Requires: smeserver-manager >= 2.4.0-22
 | 
			
		||||
Requires: smeserver-lib >= 11.0.0-13
 | 
			
		||||
# old manager is needed to handle access (ValidFrom)
 | 
			
		||||
Requires: e-smith-manager >= 2.4.0-22
 | 
			
		||||
Requires: smeserver-apache >= 2.6.0-19
 | 
			
		||||
Requires: smeserver-php >= 3.0.0-43
 | 
			
		||||
#Requires: smeserver-manager-locale >= 11.0.0
 | 
			
		||||
@@ -37,7 +38,6 @@ Requires: perl(Mojo::JWT) >= 0.08-1
 | 
			
		||||
#Requires: perl(Time::TAI64) >= 2.11
 | 
			
		||||
Requires: mutt >= 1.5.21
 | 
			
		||||
Requires: smeserver-manager-jsquery >= 1.0
 | 
			
		||||
Requires: smeserver-lib >= 11.0
 | 
			
		||||
Requires: smeserver-certificates >= 11.0
 | 
			
		||||
#Requires: js-jquery > 2.2.4-3 (optional)
 | 
			
		||||
 | 
			
		||||
@@ -82,7 +82,8 @@ This RPM contributes the navigation bars for the smeserver-manager. New Mojolici
 | 
			
		||||
 | 
			
		||||
#extract the release number and drop it in to the version for SM2 footer.
 | 
			
		||||
sed -i "s/our \$VERSION = '[^']*'/our \$VERSION = '%{release}'/g" root/usr/share/smanager/lib/SrvMngr.pm
 | 
			
		||||
 | 
			
		||||
year=`date +%Y`
 | 
			
		||||
sed -i "s/___YEAR___/$year/g" root/usr/share/smanager/lib/SrvMngr/Controller/Datetime.pm
 | 
			
		||||
 | 
			
		||||
perl createlinks
 | 
			
		||||
 | 
			
		||||
@@ -130,7 +131,7 @@ true
 | 
			
		||||
%post
 | 
			
		||||
if [ -f /usr/share/javascript/jquery/latest/jquery.min.js ]
 | 
			
		||||
then
 | 
			
		||||
    [ -d %{dir_mngr}/themes/default/public/js ] || 
 | 
			
		||||
    [ -d %{dir_mngr}/themes/default/public/js ] ||
 | 
			
		||||
	mkdir %{dir_mngr}/themes/default/public/js
 | 
			
		||||
    [ -h %{dir_mngr}/themes/default/public/js/jquery.min.js ] ||
 | 
			
		||||
	ln -s /usr/share/javascript/jquery/latest/jquery.min.js %{dir_mngr}/themes/default/public/js/jquery.min.js
 | 
			
		||||
@@ -143,19 +144,51 @@ true
 | 
			
		||||
%defattr(-,root,root)
 | 
			
		||||
 | 
			
		||||
%changelog
 | 
			
		||||
* 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
 | 
			
		||||
- 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]
 | 
			
		||||
 | 
			
		||||
* Mon Jun 09 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-88.sme
 | 
			
		||||
- add datetime getYear_list [SME: 13031]
 | 
			
		||||
- use esmith::*DB::UTF8 to access db flat files [SME: 13027]
 | 
			
		||||
- fix typo [SME: 13038]
 | 
			
		||||
 | 
			
		||||
* Mon Jun 09 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.00.0-86.sme
 | 
			
		||||
- Fix datetime gen_locale_date_string reference [SME: 13017]
 | 
			
		||||
 | 
			
		||||
* 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
 | 
			
		||||
 | 
			
		||||
* Mon Jun 09 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-84.sme
 | 
			
		||||
- fix Directory caching issue [SME: 13026]
 | 
			
		||||
- WIP use esmith::*DB::UTF8 to access db flat files [SME: 13027]
 | 
			
		||||
 | 
			
		||||
* Mon May 05 2025 Brian Read <brianr@koozali.org> 11.0.0-83.sme
 | 
			
		||||
- Mod to SrvMngr-Auth to account for partials matching AdminPanels options
 | 
			
		||||
 | 
			
		||||
* Thu May 01 2025 Brian Read <brianr@koozali.org> 11.0.0-82.sme
 | 
			
		||||
- Correct Weights for menus [SME: 12996]
 | 
			
		||||
 | 
			
		||||
* Wed Apr 30 2025 Brian Read <brianr@koozali.org> 11.0.0-80.sme
 | 
			
		||||
- Remove expansion of css files from createlinks [SME: 12989]
 | 
			
		||||
 | 
			
		||||
* Wed Apr 30 2025 Brian Read <brianr@koozali.org> 11.0.0-79.sme
 | 
			
		||||
- Add code in SrvMngr to take note of user panel setting 
 | 
			
		||||
- Add code in SrvMngr to take note of user panel setting
 | 
			
		||||
 | 
			
		||||
* 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]
 | 
			
		||||
@@ -168,36 +201,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.
 | 
			
		||||
@@ -210,8 +243,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]
 | 
			
		||||
@@ -248,16 +281,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
 | 
			
		||||
@@ -265,11 +298,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: ]
 | 
			
		||||
@@ -283,7 +316,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]
 | 
			
		||||
 | 
			
		||||
@@ -323,7 +356,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]
 | 
			
		||||
@@ -358,7 +391,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]
 | 
			
		||||
@@ -375,7 +408,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]
 | 
			
		||||
@@ -385,7 +418,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]
 | 
			
		||||
@@ -398,7 +431,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
 | 
			
		||||
@@ -440,7 +473,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]
 | 
			
		||||
@@ -467,17 +500,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]
 | 
			
		||||
@@ -485,7 +518,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]
 | 
			
		||||
@@ -496,8 +529,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]
 | 
			
		||||
@@ -506,17 +539,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
 | 
			
		||||
@@ -542,22 +575,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
 | 
			
		||||
@@ -778,7 +811,7 @@ true
 | 
			
		||||
* Sun Feb 04 2018 Jean-Philipe Pialasse <tests@pialasse.com> 0.1.0-1.sme
 | 
			
		||||
- first smeserver-manager package [SME: 10506]
 | 
			
		||||
  this is a sandbox to dev the next server-manager based on mojolicious
 | 
			
		||||
  this package is based on part of the old e-smith-manager and needs it 
 | 
			
		||||
  this package is based on part of the old e-smith-manager and needs it
 | 
			
		||||
  to work until we moved the httpd-admin part.
 | 
			
		||||
 | 
			
		||||
* Sun Apr 16 2017 Jean-Philipe Pialasse <tests@pialasse.com> 2.8.0-26.sme
 | 
			
		||||
@@ -810,7 +843,7 @@ true
 | 
			
		||||
 | 
			
		||||
* Tue Jul 19 2016 Jean-Philipe Pialasse <tests@pialasse.com> 2.8.0-12.sme
 | 
			
		||||
- Update server-manager to Koozali branding [SME: 9676]
 | 
			
		||||
- We thanks John Crisp for his wonderful work. 
 | 
			
		||||
- We thanks John Crisp for his wonderful work.
 | 
			
		||||
 | 
			
		||||
* Wed Jun 15 2016 Jean-Philipe Pialasse <tests@pialasse.com> 2.8.0-11.sme
 | 
			
		||||
- change link for donation to koozali.org  [SME: 9599]
 | 
			
		||||
@@ -862,7 +895,7 @@ true
 | 
			
		||||
  [SME: 9163]
 | 
			
		||||
 | 
			
		||||
* Sun Mar 23 2014 Ian Wells <esmith@wellsi.com> 2.6.0-1.sme
 | 
			
		||||
- Roll new stream to remove obsolete images [SME: 7962] 
 | 
			
		||||
- Roll new stream to remove obsolete images [SME: 7962]
 | 
			
		||||
 | 
			
		||||
* Sun Mar 23 2014 Ian Wells <esmith@wellsi.com> 2.4.0-9.sme
 | 
			
		||||
- Remove references to obsolete images, by Stephane de Labrusse [SME: 7962]
 | 
			
		||||
@@ -900,10 +933,10 @@ true
 | 
			
		||||
* Wed Dec  9 2009 Charlie Brady <charlieb@budge.apana.org.au> 2.2.0-4.sme
 | 
			
		||||
- Fix css validation errors. [SME: 5656]
 | 
			
		||||
 | 
			
		||||
* Fri Sep 18 2009 Stephen Noble <support@dungog.net> 2.2.0-4.sme 
 | 
			
		||||
* Fri Sep 18 2009 Stephen Noble <support@dungog.net> 2.2.0-4.sme
 | 
			
		||||
- display reconfigure warning once if UnsavedChanges=yes [SME: 5475]
 | 
			
		||||
 | 
			
		||||
* Fri Sep 18 2009 Stephen Noble <support@dungog.net> 2.2.0-3.sme 
 | 
			
		||||
* Fri Sep 18 2009 Stephen Noble <support@dungog.net> 2.2.0-3.sme
 | 
			
		||||
- display reconfigure warning if UnsavedChanges=yes [SME: 5475]
 | 
			
		||||
 | 
			
		||||
* Sun Apr 26 2009 Jonathan Martens <smeserver-contribs@snetram.nl> 2.2.0-2.sme
 | 
			
		||||
@@ -944,13 +977,13 @@ true
 | 
			
		||||
- Fix UTF-8 encoding in header and nav-conf [SME: 4072]
 | 
			
		||||
 | 
			
		||||
* Tue Jan 08 2008 Stephen Noble <support@dungog.net> 1.14.0-11
 | 
			
		||||
- Fix to remove spaces and newlines in panel headers [SME: 3346] 
 | 
			
		||||
- Fix to remove spaces and newlines in panel headers [SME: 3346]
 | 
			
		||||
 | 
			
		||||
* Tue Jan 08 2008 Stephen Noble <support@dungog.net> 1.14.0-10
 | 
			
		||||
- remove the FormMagick session files [SME: 3723]
 | 
			
		||||
 | 
			
		||||
* Tue Jan 08 2008 Stephen Noble <support@dungog.net> 1.14.0-9
 | 
			
		||||
- Remove spaces and newlines in panel headers [SME: 3346] 
 | 
			
		||||
- Remove spaces and newlines in panel headers [SME: 3346]
 | 
			
		||||
 | 
			
		||||
* Sun Jul 01 2007 Shad L. Lords <slords@mail.com> 1.14.0-8
 | 
			
		||||
- Make login/logout no quite so verbose. [SME: 2660]
 | 
			
		||||
@@ -1243,10 +1276,10 @@ true
 | 
			
		||||
 | 
			
		||||
* Wed Jan  1 2003 Gordon Rowell <gordonr@e-smith.com>
 | 
			
		||||
- [1.9.3-08]
 | 
			
		||||
- Generate navigation.info files (config db format) for each supported 
 | 
			
		||||
- Generate navigation.info files (config db format) for each supported
 | 
			
		||||
  language in /etc/e-smith/locale/{language}/etc/e-smith/web/functions
 | 
			
		||||
- Read the navigation.info file for the preferred language when 
 | 
			
		||||
  displaying the navigation bar 
 | 
			
		||||
- Read the navigation.info file for the preferred language when
 | 
			
		||||
  displaying the navigation bar
 | 
			
		||||
- TODO: Actually select the correct navigation.info file [gordonr 5493]
 | 
			
		||||
 | 
			
		||||
* Tue Dec 31 2002 Gordon Rowell <gordonr@e-smith.com>
 | 
			
		||||
@@ -1287,7 +1320,7 @@ true
 | 
			
		||||
* Fri Nov 22 2002 Gordon Rowell <gordonr@e-smith.com>
 | 
			
		||||
- [1.9.1-02]
 | 
			
		||||
- templated header.htm [miked 5826]
 | 
			
		||||
- modified header.htm template to link to online-manual and blades 
 | 
			
		||||
- modified header.htm template to link to online-manual and blades
 | 
			
		||||
  [gordonr 5826]
 | 
			
		||||
 | 
			
		||||
* Thu Nov 21 2002 Mike Dickson <miked@e-smith.com>
 | 
			
		||||
@@ -1334,7 +1367,7 @@ true
 | 
			
		||||
* Thu May 16 2002 Tony Clayton <apc@e-smith.com>
 | 
			
		||||
- [1.5.8-01]
 | 
			
		||||
- Remove unnecessary <p> tags in navigation html [tonyc 3377]
 | 
			
		||||
- Fix navigation panel to not import symbols from fm subclasses 
 | 
			
		||||
- Fix navigation panel to not import symbols from fm subclasses
 | 
			
		||||
  [tonyc 3109]
 | 
			
		||||
 | 
			
		||||
* Mon May 13 2002 Tony Clayton <apc@e-smith.com>
 | 
			
		||||
@@ -1379,7 +1412,7 @@ true
 | 
			
		||||
 | 
			
		||||
* Thu Mar 14 2002 Gordon Rowell <gordonr@e-smith.com>
 | 
			
		||||
- [1.4.3-01]
 | 
			
		||||
- Fixed regexp for ignoring pleasewait(-.*?). Two each in 
 | 
			
		||||
- Fixed regexp for ignoring pleasewait(-.*?). Two each in
 | 
			
		||||
  pleasewait/noframes. Reduced to one in each [gordonr]
 | 
			
		||||
 | 
			
		||||
* Fri Mar 1 2002 Tony Clayton <tonyc@e-smith.com>
 | 
			
		||||
@@ -1412,7 +1445,7 @@ true
 | 
			
		||||
 | 
			
		||||
* Wed Nov 21 2001 Charlie Brady <charlieb@e-smith.com>
 | 
			
		||||
- [1.3.0-06]
 | 
			
		||||
- Remove troublesome "Requires: e-smith-base". 
 | 
			
		||||
- Remove troublesome "Requires: e-smith-base".
 | 
			
		||||
- Remove obsolete "Requires: e-smith".
 | 
			
		||||
 | 
			
		||||
* Thu Nov 1 2001 Gordon Rowell <gordonr@e-smith.com>
 | 
			
		||||
@@ -1451,7 +1484,7 @@ true
 | 
			
		||||
* Tue Jul 31 2001 Adrian Chung <adrianc@e-smith.com>
 | 
			
		||||
- [1.1.0-03]
 | 
			
		||||
- Adding SSL enabling templates for port 981.
 | 
			
		||||
- Adding 01localAccessString fragment for use in SSL 
 | 
			
		||||
- Adding 01localAccessString fragment for use in SSL
 | 
			
		||||
  enabling templates.
 | 
			
		||||
 | 
			
		||||
* Fri Jul 27 2001 Charlie Brady <charlieb@e-smith.com>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user