From 774b7ab4eec407f607ba40e804c67126867621ee Mon Sep 17 00:00:00 2001 From: Brian Read Date: Wed, 5 Nov 2025 12:15:55 +0000 Subject: [PATCH] * Wed Nov 05 2025 Brian Read 11.0.0-132.sme - Supress webmail option on menu and in user accounts if webmail not enabled [SME: 12997] --- .../Controller/Emailsettings-Custom.pm | 2 + .../Roundcubepanel/roundcubepanel_en.lex | 2 +- .../templates/partials/_usr_list.html.ep | 6 ++- .../default/templates/roundcube.html.ep | 47 +++++++++---------- smeserver-manager.spec | 5 +- 5 files changed, 35 insertions(+), 27 deletions(-) diff --git a/root/usr/share/smanager/lib/SrvMngr/Controller/Emailsettings-Custom.pm b/root/usr/share/smanager/lib/SrvMngr/Controller/Emailsettings-Custom.pm index f43a506..1eaaa0b 100644 --- a/root/usr/share/smanager/lib/SrvMngr/Controller/Emailsettings-Custom.pm +++ b/root/usr/share/smanager/lib/SrvMngr/Controller/Emailsettings-Custom.pm @@ -17,6 +17,8 @@ use Data::Validate::IP qw(is_ipv4 is_ipv6); use constant FALSE => 0; use constant TRUE => 1; +our @EXPORT_OK = qw(get_current_webmail_status); + #The most common ones - open DB when required. our $cdb; diff --git a/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Roundcubepanel/roundcubepanel_en.lex b/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Roundcubepanel/roundcubepanel_en.lex index 8b13789..193a22b 100644 --- a/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Roundcubepanel/roundcubepanel_en.lex +++ b/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Roundcubepanel/roundcubepanel_en.lex @@ -1 +1 @@ - +'rc_WEBMAIL_DISABLED' => 'Webmail is disabled in Email Settings panel', \ No newline at end of file diff --git a/root/usr/share/smanager/themes/default/templates/partials/_usr_list.html.ep b/root/usr/share/smanager/themes/default/templates/partials/_usr_list.html.ep index 52da6f3..987b6db 100644 --- a/root/usr/share/smanager/themes/default/templates/partials/_usr_list.html.ep +++ b/root/usr/share/smanager/themes/default/templates/partials/_usr_list.html.ep @@ -1,5 +1,7 @@
+% use constant FALSE => 0; +% use constant TRUE => 1; % my $btn = l('usr_ADD_USER'); @@ -153,7 +155,9 @@ <%= $c->render_to_string( inline => $actionResetPw ) %> <%= $c->render_to_string( inline => $actionLock ) %> <%= $c->render_to_string( inline => $actionRemove ) %> - <%= $c->render_to_string( inline => $actionroundcube ) %> + % if ($c->SrvMngr::Controller::Emailsettings::get_current_webmail_status(FALSE) ne 'disabled'){ + <%= $c->render_to_string( inline => $actionroundcube ) %> + % } % } diff --git a/root/usr/share/smanager/themes/default/templates/roundcube.html.ep b/root/usr/share/smanager/themes/default/templates/roundcube.html.ep index 78ace4b..04a74d1 100644 --- a/root/usr/share/smanager/themes/default/templates/roundcube.html.ep +++ b/root/usr/share/smanager/themes/default/templates/roundcube.html.ep @@ -1,8 +1,7 @@ % layout 'default', title => "Sme server 2 - roundcube"; - +% use constant FALSE => 0; +% use constant TRUE => 1; % content_for 'module' => begin - -
% if (config->{debug} == 1) {

@@ -15,26 +14,26 @@

% }

<%= $title %>


-

If the Webmail panel does not appear after logging in, then please check your password.


- - % my $thisdomain = $c->req->url->to_abs->host; - % my $url = $c->stash('modul'); - % if (!$url) { - % $url = $thisdomain . "/roundcube"; + % if ($c->SrvMngr::Controller::Emailsettings::get_current_webmail_status(FALSE) eq 'disabled'){ + <%= $c->render_to_string( inline => l('rc_WEBMAIL_DISABLED') ) %> + % } else { +

If the Webmail panel does not appear after logging in, then please check your password.


+ % my $thisdomain = $c->req->url->to_abs->host; + % my $url = $c->stash('modul'); + % if (!$url) { + % $url = $thisdomain . "/roundcube"; + % } + % my $username = 'admin'; + % if ($url =~ /[?&]_user=([^&]+)/) { + % $username = $1; + % } + % if (!($url =~ /https:/)) { + % $url = 'https://' . $url; + % } +
+ roundcube?_user=<%= $username %>"> + <%= $c->stash('title') %> not found +
% } - % my $username = 'admin'; - % if ($url =~ /[?&]_user=([^&]+)/) { - % $username = $1; - % } - % if (!($url =~ /https:/)) { - % $url = 'https://' . $url; - % } - -
- roundcube?_user=<%= $username %>"> - <%= $c->stash('title') %> not found -
- - -% end +% end \ No newline at end of file diff --git a/smeserver-manager.spec b/smeserver-manager.spec index 1e2d8d4..7dd1440 100644 --- a/smeserver-manager.spec +++ b/smeserver-manager.spec @@ -2,7 +2,7 @@ Summary: Sme Server Configuration : Manager 2 %define name smeserver-manager Name: %{name} %define version 11.0.0 -%define release 131 +%define release 132 Version: %{version} Release: %{release}%{?dist} License: GPL @@ -147,6 +147,9 @@ true %defattr(-,root,root) %changelog +* Wed Nov 05 2025 Brian Read 11.0.0-132.sme +- Supress webmail option on menu and in user accounts if webmail not enabled [SME: 12997] + * Tue Nov 04 2025 Brian Read 11.0.0-131.sme - Add fix for IE browser local/language detect [SME: 13039]