Compare commits
7 Commits
11_0_0-118
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 8e270ef3fd | |||
| a04097bf5a | |||
| 9437dd792a | |||
| f03d82ebf7 | |||
| de2f78a089 | |||
| b838d9252a | |||
| 9c9ab91869 |
@@ -33,11 +33,13 @@ use esmith::I18N;
|
||||
use esmith::ConfigDB::UTF8;
|
||||
use esmith::NavigationDB; # no UTF8 raw is ok for ASCII only flat file
|
||||
|
||||
use Data::Dumper;
|
||||
|
||||
# Import the function(s) you need
|
||||
use SrvMngr_Auth qw(check_admin_access);
|
||||
|
||||
#this is overwrittrn with the "release" by the spec file - release can be "99.el8.sme"
|
||||
our $VERSION = '94.el8.sme';
|
||||
our $VERSION = '121.el8.sme';
|
||||
#Extract the release value
|
||||
if ($VERSION =~ /^(\d+)/) {
|
||||
$VERSION = $1; # $1 contains the matched numeric digits
|
||||
@@ -607,18 +609,20 @@ sub getNavigation {
|
||||
# Added: Check if user is non-admin and get their allowed panels
|
||||
if ($username ne '') {
|
||||
# Get the AccountsDB to check user permissions
|
||||
$is_admin = 0; # User is non-admin with specific panel access
|
||||
my $accountsdb = esmith::AccountsDB::UTF8->open_ro() or
|
||||
die "Couldn't open AccountsDB\n";
|
||||
|
||||
# Check if user has AdminPanels property
|
||||
my $user_rec = $accountsdb->get($username);
|
||||
if (defined $user_rec && $user_rec->prop('AdminPanels')) {
|
||||
$is_admin = 0; # User is non-admin with specific panel access
|
||||
# Get comma-separated list of allowed admin panels
|
||||
my $admin_panels = $user_rec->prop('AdminPanels');
|
||||
@allowed_admin_panels = split(/,/, $admin_panels);
|
||||
@allowed_admin_panels = $admin_panels eq '' ? () : split(/,/, $admin_panels);
|
||||
#@allowed_admin_panels = split(/,/, $admin_panels);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-----------------------------------------------------
|
||||
# Determine the directory where the functions are kept
|
||||
@@ -720,20 +724,20 @@ sub getNavigation {
|
||||
|
||||
# Added: Check if this is an admin menu item and if user has access
|
||||
if ($menucat eq 'A' && !$is_admin) {
|
||||
# Skip this admin panel if user doesn't have access to it
|
||||
# By default, deny access if no allowed_admin_panels are specified
|
||||
my $has_access = 0;
|
||||
my $file_no_ext = $file;
|
||||
$file_no_ext =~ s/\.pm$//; # Remove .pm extension if present
|
||||
foreach my $allowed_panel (@allowed_admin_panels) {
|
||||
if ($file_no_ext eq lc($allowed_panel)) {
|
||||
#die("Here!!$file $file_no_ext $allowed_panel ");
|
||||
$has_access = 1;
|
||||
last;
|
||||
if (@allowed_admin_panels) {
|
||||
my $file_no_ext = $file;
|
||||
$file_no_ext =~ s/\.pm$//; # Remove .pm extension if present
|
||||
foreach my $allowed_panel (@allowed_admin_panels) {
|
||||
if ($file_no_ext eq lc($allowed_panel)) {
|
||||
$has_access = 1;
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
next if !$has_access;
|
||||
}
|
||||
|
||||
next if $menu ne $menucat;
|
||||
|
||||
#--------------------------------------------------
|
||||
@@ -772,7 +776,7 @@ sub getNavigation {
|
||||
MENUCAT => $menucat
|
||||
};
|
||||
}
|
||||
|
||||
#die(Dumper(\%nav));
|
||||
return \%nav;
|
||||
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ sub get_ftp_access {
|
||||
my $status = get_prop('', 'ftp', 'status') || 'disabled';
|
||||
return 'off' unless $status eq 'enabled';
|
||||
my $access = get_prop('', 'ftp', 'access') || 'private';
|
||||
return ($access eq 'public') ? 'normal' : 'private';
|
||||
return ($access eq 'public') ? 'public' : 'private';
|
||||
} ## end sub get_ftp_access
|
||||
|
||||
#sub get_pptp_sessions {
|
||||
@@ -320,7 +320,7 @@ sub change_settings {
|
||||
$rec->set_prop('status', 'disabled');
|
||||
$rec->set_prop('access', 'private');
|
||||
$rec->set_prop('LoginAccess', 'private');
|
||||
} elsif ($rma_datas{ftpAccess} eq "normal") {
|
||||
} elsif ($rma_datas{ftpAccess} eq "public") {
|
||||
$rec->set_prop('status', 'enabled');
|
||||
$rec->set_prop('access', 'public');
|
||||
$rec->set_prop('LoginAccess', $rma_datas{ftpPasswordAccess});
|
||||
@@ -438,4 +438,4 @@ sub remove_valid_from {
|
||||
$db->get('httpd-admin')->set_prop('ValidFrom', $prop);
|
||||
return 1;
|
||||
} ## end sub remove_valid_from
|
||||
1;
|
||||
1;
|
||||
@@ -502,4 +502,20 @@ div.success, span.success {
|
||||
div.roundcube #roundcube{
|
||||
width:100%;
|
||||
height:600px;
|
||||
}
|
||||
|
||||
.center {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
width: 100%; /* adjust as needed */
|
||||
}
|
||||
|
||||
.left-btn {
|
||||
/* Left aligned */
|
||||
}
|
||||
|
||||
.center-btn {
|
||||
/* Center aligned */
|
||||
margin-left: auto!important;
|
||||
margin-right: auto;
|
||||
}
|
||||
@@ -63,7 +63,7 @@
|
||||
position: absolute;
|
||||
left: 7%;
|
||||
transform: translateX(-50%);
|
||||
background-color: #4caf50b8;
|
||||
background-color: #4caf50;
|
||||
color: white !important;
|
||||
border: none;
|
||||
padding: 8px;
|
||||
|
||||
@@ -30,14 +30,27 @@ $(document).ready(function() {
|
||||
});
|
||||
});
|
||||
|
||||
// and busy cursor
|
||||
$(document).ready(function() {
|
||||
// Handle form submission for any form
|
||||
$('form').on('submit', function(event) {
|
||||
// Disable all submit buttons and update their labels
|
||||
$(this).find('button[type="submit"]').prop('disabled', true).text('Please wait...');
|
||||
$(this).find('input[type="submit"]').prop('disabled', true).val('Please wait...');
|
||||
// Add busy cursor
|
||||
$('body').addClass('busy');
|
||||
});
|
||||
$('form').on('submit', function(event) {
|
||||
// Change submit buttons to look disabled and update their labels without disabling
|
||||
$(this).find('button[type="submit"]').each(function() {
|
||||
$(this).text('Please wait...').addClass('visually-disabled').css({
|
||||
'pointer-events': 'none',
|
||||
'opacity': '0.6',
|
||||
'cursor': 'not-allowed'
|
||||
});
|
||||
});
|
||||
$(this).find('input[type="submit"]').each(function() {
|
||||
$(this).val('Please wait...').addClass('visually-disabled').css({
|
||||
'pointer-events': 'none',
|
||||
'opacity': '0.6',
|
||||
'cursor': 'not-allowed'
|
||||
});
|
||||
});
|
||||
|
||||
// Add busy cursor to body
|
||||
$('body').addClass('busy');
|
||||
|
||||
// Allow form to submit normally without disabling the buttons
|
||||
});
|
||||
});
|
||||
@@ -1 +1 @@
|
||||
<script src='js/jquery.min.js' type='text/javascript'></script>
|
||||
<!--<script src='js/jquery.min.js' type='text/javascript'></script>-->
|
||||
@@ -21,12 +21,12 @@
|
||||
%= javascript '/js/datatables.min.js'
|
||||
%= stylesheet '/js/jquery-ui.min.css'
|
||||
%= javascript '/js/jquery-ui.min.js'
|
||||
%= javascript '/js/dataTables.buttons.min.js'
|
||||
%= javascript '/js/jszip.min.js'
|
||||
%= javascript '/js/pdfmake.min.js'
|
||||
%#= javascript '/js/dataTables.buttons.min.js'
|
||||
%#= javascript '/js/jszip.min.js'
|
||||
%#= javascript '/js/pdfmake.min.js'
|
||||
%= javascript '/js/vfs_fonts.js'
|
||||
%= javascript '/js/buttons.html5.min.js'
|
||||
%= javascript '/js/buttons.print.min.js'
|
||||
%#= javascript '/js/buttons.html5.min.js'
|
||||
%#= javascript '/js/buttons.print.min.js'
|
||||
%= javascript '/js/flag-by-locale.js'
|
||||
%= javascript '/js/sme-password.js'
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
% if ( not defined $c->session->{username} ) {
|
||||
<a class="login-button no-visited-state" target="_parent" href="/smanager/login">Login</a>
|
||||
% } else {
|
||||
<!--><button type='button' class="login-button"><a class = "no-visited-state" target="_parent" href="/smanager/logout">Logout <%= $c->session->{username} %></a></button>-->
|
||||
<!--<button type='button' class="login-button"><a class = "no-visited-state" target="_parent" href="/smanager/logout">Logout <%= $c->session->{username} %></a></button>xxx-->
|
||||
<a class="login-button no-visited-state" target="_parent" href="/smanager/logout">Logout <%= $c->session->{username} %></a>
|
||||
% }
|
||||
<div id="flag-container" class = "flag-style">
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
% my %nav = %{ SrvMngr->getNavigation( $c->languages(), 'N' ) };
|
||||
|
||||
<div id='navmenu'>
|
||||
<!-- <a href='#' id='tognav' class='menu-title'>NAVIGATION</a> -->
|
||||
<!-- <a href='#' id='tognav' class='menu-title'>NAVIGATION</a> ffff-->
|
||||
<div id='menunav'>
|
||||
|
||||
% my $cc = 200;
|
||||
% foreach my $h (sort { ($nav{$a}{'WEIGHT'}/$nav{$a}{'COUNT'})
|
||||
% <=> ($nav{$b}{'WEIGHT'}/$nav{$b}{'COUNT'}) } keys %nav) {
|
||||
%
|
||||
<!-- div class='section section-title'><%= $h %></div -->
|
||||
<!-- div class='section section-title'><%= $h %></div gggg-->
|
||||
<div><a href='#' class='section section-title'><%= $h %></a></div>
|
||||
<div class='togms'>
|
||||
% my ( $classNew, $target, $href ) = '';
|
||||
@@ -33,4 +33,4 @@
|
||||
|
||||
% }
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2,7 +2,7 @@
|
||||
% my %nav = %{ SrvMngr->getNavigation( $c->languages(), 'A' ) };
|
||||
|
||||
<div id='navigat2'>
|
||||
<!-- ><div><a href='#' id='togadm' class='menu-title'>ADMINISTRATION</a></div> -->
|
||||
<!-- <div><a href='#' id='togadm' class='menu-title'>ADMINISTRATION</a></div> dddd-->
|
||||
<div id='menuadm'>
|
||||
|
||||
% my $cc = 100;
|
||||
@@ -35,4 +35,4 @@
|
||||
% }
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -9,7 +9,7 @@
|
||||
% my $cc = 300;
|
||||
% foreach my $h (sort { ($nav{$a}{'WEIGHT'}/$nav{$a}{'COUNT'})
|
||||
% <=> ($nav{$b}{'WEIGHT'}/$nav{$b}{'COUNT'}) } keys %nav) {
|
||||
<!-- div class='section'><%= $h %></div -->
|
||||
<!-- div class='section'><%= $h %></div> nnnn-->
|
||||
% my ( $classNew, $target, $href ) = '';
|
||||
% foreach (sort { $a->{'WEIGHT'} <=> $b->{'WEIGHT'} } @{$nav{$h}{'DESCRIPTIONS'}}) {
|
||||
% next if ( $_->{'MENUCAT'} ne 'A' && $_->{'MENUCAT'} ne 'U' ); # menu User
|
||||
@@ -29,4 +29,4 @@
|
||||
% }
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
0
root/var/log/smanager/.gitignore
vendored
0
root/var/log/smanager/.gitignore
vendored
@@ -2,7 +2,7 @@ Summary: Sme Server Configuration : Manager 2
|
||||
%define name smeserver-manager
|
||||
Name: %{name}
|
||||
%define version 11.0.0
|
||||
%define release 118
|
||||
%define release 124
|
||||
Version: %{version}
|
||||
Release: %{release}%{?dist}
|
||||
License: GPL
|
||||
@@ -39,7 +39,7 @@ Requires: perl(Mojo::JWT) >= 0.08-1
|
||||
#Requires: perl(Time::TAI64) >= 2.11
|
||||
Requires: perl(Data::Validate::IP)
|
||||
Requires: mutt >= 1.5.21
|
||||
Requires: smeserver-manager-jsquery >= 1.0
|
||||
Requires: smeserver-manager-jsquery >= 11.0.0-11
|
||||
Requires: smeserver-certificates >= 11.0
|
||||
#Requires: js-jquery > 2.2.4-3 (optional)
|
||||
|
||||
@@ -147,6 +147,24 @@ true
|
||||
%defattr(-,root,root)
|
||||
|
||||
%changelog
|
||||
* Fri Oct 24 2025 Brian Read <brianr@koozali.org> 11.0.0-124.sme
|
||||
- Adjust CSS for logout button to remove overlap of border and rounding [SME: 13247]
|
||||
|
||||
* Fri Oct 24 2025 Brian Read <brianr@koozali.org> 11.0.0-123.sme
|
||||
- Take out references to js/jquery files now incorporated in the datatables.min.js [SME:13253]
|
||||
|
||||
* Tue Oct 21 2025 Brian Read <brianr@koozali.org> 11.0.0-122.sme
|
||||
- Correct code to only show user panels when AdminPanels property is empty or non existent [SME: 13082]
|
||||
|
||||
* Sat Sep 27 2025 Brian Read <brianr@koozali.org> 11.0.0-121.sme
|
||||
- Sort out ftp public setting [SME: 13194]
|
||||
|
||||
* Thu Sep 25 2025 Brian Read <brianr@koozali.org> 11.0.0-120.sme
|
||||
- Add CSS for multiple result buttons on panel - used by wireguard[SME: 13185]
|
||||
|
||||
* Thu Sep 25 2025 Brian Read <brianr@koozali.org> 11.0.0-119.sme
|
||||
- Change submit button disable/message as method as current method does not send name back as parameter [SME: 13184]
|
||||
|
||||
* Thu Sep 25 2025 Brian Read <brianr@koozali.org> 11.0.0-118.sme
|
||||
- Remove inline style for legacy panel [SME: 13177]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user