Fix up user and localnetwork panels and stop menu moving betweek proxy and reboot

This commit is contained in:
Brian Read 2024-12-18 12:08:00 +00:00
parent 8db1279a3e
commit b58f82a332
4 changed files with 40 additions and 24 deletions

View File

@ -3,7 +3,7 @@ package SrvMngr::Controller::Proxy;
#----------------------------------------------------------------------
# heading : System
# description : Proxy settings
# navigation : 4000 700
# navigation : 4000 710
#----------------------------------------------------------------------
#
# routes : end
@ -72,4 +72,4 @@ sub do_update {
};
1;
1;

View File

@ -1,7 +1,6 @@
<div id='ln_list'>
% my $btn = l('ln_LOCALNETWORK_ADD');
%= form_for '/localnetworksa' => (method => 'POST') => begin
<p>
% my $retref= $c->stash("ret");
% my %ret;
@ -68,10 +67,10 @@
%=l 'ROUTER'
</th>
<th class='sme-border' '>
<th class='sme-border'>
%=l 'ACTION'
</th>
</tr>
</tr>
</thead><tbody>
% foreach my $localnetwork (@$localnetworks )
% {
@ -84,18 +83,23 @@
%= t td => (class => 'sme-border') => $localnetwork->prop('Mask')
%= t td => (class => 'sme-border') => $num_hosts
%= t td => (class => 'sme-border') => $localnetwork->prop('Router')
% if ($removable eq "yes") {
<td class='sme-border'>
<a href="localnetworksd?CsrfDef=TOKEN&trt=DEL&localnetwork=<%= $localnetwork->key%>"><button class='sme-remove-button' title="<%=l('REMOVE')%>"><%=l('REMOVE') %></button></a></td>
% } else {
<td class='sme-border'> </td>
%}
%my $actionRemove = '&nbsp;';
%if ($removable eq "yes") {
%my $remove_text = l('REMOVE'); # Localized text
%my $local_network_entry = $localnetwork->key;
%my $csrf_token = "TOKEN"; # CSRF token for security
%$actionRemove = qq{
% <button type='button' class='sme-remove-button' title='$remove_text'
% onclick="window.location.href='localnetworksd?CsrfDef=$csrf_token&trt=DEL&localnetwork=$local_network_entry'">
% $remove_text
% </button>
%};
% }
<td class='sme-border'><%= $c->render_to_string(inline => $actionRemove) %></td>
</tr>
% }
</tbody>
</table>
</p>
%= hidden_field 'trt' => $ln_datas->{trt}
%}
</div>
</div>

View File

@ -59,12 +59,12 @@
%= t td => (class => 'sme-border') => "$first $last"
%= t td => (class => 'sme-border') => $vpnaccess
%= t td => (class => 'sme-border') => $fwd
%my ($actionModify, $actionLock, $actionResetPw, $actionRemove) = '&nbsp;';
%my ($actionModify, $actionLock, $actionResetPw, $actionRemove,$actionroundcube) = '&nbsp;';
%my $modify_text = l('MODIFY'); # Localized text
%my $csrf_token = "TOKEN"; # CSRF token for security
%my $useraccounts_user_name = $user->key; # useraccountss_entry name extracted from the data structure
%my $password_text = l("PASSWORD_RESET");
%if ($username eq 'admin') {
%if ($useraccounts_user_name eq 'admin') {
%$actionModify = qq{
% <button type='button' class='sme-modify-button' title='$modify_text'
% onclick="window.location.href='useraccountsd?CsrfDef=$csrf_token&trt=UPS&user=$useraccounts_user_name'">
@ -83,7 +83,7 @@
%$actionLock = l('ACCOUNT_LOCKED');
%$actionResetPw = qq{
% <button type='button' class='sme-password-button unset' title="$password_text - currently unset" style = background:pink;
% onclick="window.location.href='useraccountsd?CsrfDef=$csrf_token&trt=PWD&ibay=$useraccounts_user_name'">
% onclick="window.location.href='useraccountsd?CsrfDef=$csrf_token&trt=PWD&user=$useraccounts_user_name'">
% $password_text
% </button>
%};
@ -114,18 +114,26 @@
% </button>
%};
%}
% my $thisdomain = session 'SystemName';
% $thisdomain .= ".".session 'DomainName';
%# my $thisdomain = "localhost";
%my $thisdomain = session 'SystemName';
%$thisdomain .= ".".session 'DomainName';
%my $roundcube_text = l('Webmail'); # Localized text
%my $csrf_token = "TOKEN"; # CSRF token for security
%my $useraccounts_user_name = $user->key; # useraccountss_entry name extracted from the data structure
%$actionroundcube = qq{
% <button type='button' class='sme-email-button' title='$roundcube_text'
% onclick="window.location.href='roundcubepanel?CsrfDef=$csrf_token&url=https://$thisdomain/roundcube?_user=$useraccounts_user_name'">
% $roundcube_text
% </button>
%};
<td class='sme-border' style="min-width:35em">
<%= $c->render_to_string(inline => $actionModify) %>
<%= $c->render_to_string(inline => $actionResetPw) %>
<%= $c->render_to_string(inline => $actionLock) %>
<%= $c->render_to_string(inline => $actionRemove) %>
<a href="<%= "roundcubepanel/?url=https://".$thisdomain."/" %>roundcube?_user=<%= $username %>"><button class="sme-email-button" title="<%= l('EMAIL') %>"><%= l('EMAIL') %></button></a>
</td>
<%= $c->render_to_string(inline => $actionroundcube) %>
</td>
</tr>
% }
</tbody>

View File

@ -2,7 +2,7 @@ Summary: Sme server navigation module : manager 2
%define name smeserver-manager
Name: %{name}
%define version 11.0.0
%define release 31
%define release 32
Version: %{version}
Release: %{release}%{?dist}
License: GPL
@ -115,6 +115,10 @@ true
%defattr(-,root,root)
%changelog
* 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
* Tue Dec 17 2024 Brian Read <brianr@koozali.org> 11.0.0-31.sme
- Edit html to avoid w3c html validation warnings [SME: 6278]