From f90583b2853451c5a8b0ff62027a28ce0c63937d Mon Sep 17 00:00:00 2001 From: John Crisp Date: Thu, 15 May 2025 20:32:05 +0200 Subject: [PATCH] More groups pseudonyms clamav and useraccounts work --- .../themes/AdminLTE/templates/clamav.html.ep | 47 +++--- .../themes/AdminLTE/templates/groups.html.ep | 28 ++-- .../templates/partials/_grp_add.html.ep | 30 ++-- .../templates/partials/_grp_del.html.ep | 34 ++--- .../templates/partials/_grp_list.html.ep | 94 ++++++------ .../templates/partials/_pse_add.html.ep | 71 +++++---- .../templates/partials/_pse_del.html.ep | 37 +++-- .../templates/partials/_pse_list.html.ep | 142 ++++++++---------- .../templates/partials/_swt_theme.html.ep | 16 +- .../AdminLTE/templates/pseudonyms.html.ep | 10 +- .../AdminLTE/templates/useraccounts.html.ep | 31 ++-- 11 files changed, 262 insertions(+), 278 deletions(-) diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/clamav.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/clamav.html.ep index ce4ab13..586dcc5 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/clamav.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/clamav.html.ep @@ -11,54 +11,49 @@ (DBG)Quar stat: <%=$clm_datas->{Quarantine} %> % } - +

<%= $title %>


- - <%= $modul %> - - <% my $btn = l('SAVE'); %> -
- %#= form_for 'clamav' => (method => 'POST') => begin -
-
- <%= l 'clm_LABEL_FILESYSTEM_SCAN_PERIOD' %> -
-
- % param 'FilesystemScan' => $clm_datas->{FilesystemScan} unless param 'FilesystemScan'; - <%= select_field 'FilesystemScan' => [[ (l 'clm_DAILY') => 'daily'], [ (l 'clm_NEVER') => 'disabled'], [ (l 'clm_WEEKLY') => 'weekly']] %> + <%= $modul %> + + <% my $btn = l('SAVE'); %> +

+ + +
+
+
<%= l 'clm_LABEL_FILESYSTEM_SCAN_PERIOD' %>:
+ % param 'FilesystemScan' => $clm_datas->{FilesystemScan} unless param 'FilesystemScan'; + <%= select_field 'FilesystemScan' => [[ (l 'clm_DAILY') => 'daily'], [ (l 'clm_NEVER') => 'disabled'], [ (l 'clm_WEEKLY') => 'weekly']], class => "form-select" %>
- -
-
- <%= l 'clm_LABEL_QUARANTINE' %> -
-
+
+
+
+
+
<%= l 'clm_LABEL_QUARANTINE' %>:
% param 'Quarantine' => $clm_datas->{Quarantine} unless param 'Quarantine'; - <%= select_field 'Quarantine' => [[ (l 'ENABLED') => 'enabled'], [ (l 'DISABLED') => 'disabled']] %> + <%= select_field 'Quarantine' => [[ (l 'ENABLED') => 'enabled'], [ (l 'DISABLED') => 'disabled']], class => "form-select" %>
- +
- <%= l 'clm_LABEL_CLAM_VERSIONS' %> +
<%= l 'clm_LABEL_CLAM_VERSIONS' %>:
<%= $clm_datas->{clam_versions} %> -
- +
- %#end
%end diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/groups.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/groups.html.ep index 0fb94fb..0598474 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/groups.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/groups.html.ep @@ -5,29 +5,29 @@
% if (config->{debug} == 1) { -

- %= dumper $c->current_route - %= dumper $grp_datas -

+
+ %= dumper $c->current_route + %= dumper $grp_datas +
% } % if ( stash 'error' ) { -
- %= $c->render_to_string(inline => stash 'error') -
- %} - +
+ <%= $c->render_to_string(inline => stash 'error') %> +
+ % } +

<%= $title%>

% if ($grp_datas->{trt} eq 'ADD') { - %= include 'partials/_grp_add' - %} elsif ($grp_datas->{trt} eq 'DEL') { + %= include 'partials/_grp_add' + % } elsif ($grp_datas->{trt} eq 'DEL') { %= include 'partials/_grp_del' - %} elsif ($grp_datas->{trt} eq 'UPD') { + % } elsif ($grp_datas->{trt} eq 'UPD') { %= include 'partials/_grp_upd' - %} else { + % } else { %= include 'partials/_grp_list' - %} + % }
%end diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_grp_add.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_grp_add.html.ep index ed91e40..b2646b5 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_grp_add.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_grp_add.html.ep @@ -1,4 +1,4 @@ -
+

@@ -7,10 +7,10 @@ <%= l 'grp_GROUP_NAMING' %>

- % my $btn = l('ADD'); + % my $btn = l('ADD');
- +
@@ -24,13 +24,13 @@
- +

- + <%= l 'grp_GROUP_DESC_EXPL' %> - +

- +
@@ -44,30 +44,30 @@
- +
- +
- <%= l 'GROUP_MEMBERS' %> + <%= l 'GROUP_MEMBERS' %>
- +
- %= check_box 'groupMembers' => 'admin' + <%= check_box 'groupMembers' => 'admin' %>  Administrator (admin)
% my $users = $c->gen_users_list(); % foreach my $key ( sort keys %$users ) { %= check_box 'groupMembers' => $key   - %= $users->{$key} + %= $users->{$key} %= " (" . $key . ")"
% }
- +

- +
diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_grp_del.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_grp_del.html.ep index 5bc586a..a18617f 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_grp_del.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_grp_del.html.ep @@ -1,28 +1,28 @@ -
+
% my $btn = l('REMOVE');

- +

<%=l 'REMOVE_USER_GROUP' %>

- +
- + <%=l('grp_DELETE_DESCRIPTION', $grp_datas->{group}) %> - +

- +
- + % my $size = keys %$members; % if ( ! $size ){ %= l 'ACCOUNT_GROUP_NONE' % } else { %= l 'grp_GROUP_HAS_MEMBERS' - +

- +
    % foreach my $key ( keys %$members) {
  • @@ -32,15 +32,15 @@ % }
% } - +
- +

- +
- + % $size = keys %$ibays; - + % if ( $size ) { %=l 'grp_IBAYS_WILL_BE_CHANGED'
@@ -56,16 +56,16 @@ % }
- +
- + %= hidden_field 'trt' => $grp_datas->{trt} %= hidden_field 'groupName' => $grp_datas->{group} - +
diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_grp_list.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_grp_list.html.ep index b2f1667..230ba4d 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_grp_list.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_grp_list.html.ep @@ -6,68 +6,64 @@ %#= form_for '/groups' => (method => 'POST') => begin %= hidden_field 'trt' => 'ADD' - +
- +
- %# end + %# end

<%=l 'grp_CURRENT_LIST' %>



- % my $numGroups = @$groups; + % my $numGroups = @$groups; % if ($numGroups == 0){ - %=l 'ACCOUNT_GROUP_NONE' - % } else { - - - - - - - - - + <%= l 'ACCOUNT_GROUP_NONE' %> + % } else { +
<%= l 'GROUP' %><%= l 'DESCRIPTION' %><%= l 'ACTION' %>
+ + + + + + + + + % foreach my $group ( @$groups ) { + + + - % foreach my $group ( @$groups ) - % { - - - + % my $modify_text = l('MODIFY'); # Localized text + % my $csrf_token = "TOKEN"; # CSRF token for security + % my $group_name = $group->key; # group name extracted from the data structure + % my $actionModify = qq{ + % + % + % + %}; + % my $remove_text = l('REMOVE'); # Localized text + % my $csrf_token = "TOKEN"; # CSRF token for security + % my $group_name = $group->key; # group name extracted from the data structure + % my $actionRemove = qq{ + % + % + % + %}; - %my $modify_text = l('MODIFY'); # Localized text - %my $csrf_token = "TOKEN"; # CSRF token for security - %my $group_name = $group->key; # group name extracted from the data structure - %my $actionModify = qq{ - % - % - % - %}; - %my $remove_text = l('REMOVE'); # Localized text - %my $csrf_token = "TOKEN"; # CSRF token for security - %my $group_name = $group->key; # group name extracted from the data structure - %my $actionRemove = qq{ - % - % - % - %}; - - - - - % } - + + + + % } +
<%= l 'GROUP' %><%= l 'DESCRIPTION' %><%= l 'ACTION' %>
<%= $group->key %><%= $group->prop('Description') %>
<%= $group->key %><%= $group->prop('Description') %><%= $c->render_to_string(inline => $actionModify) %><%= $c->render_to_string(inline => $actionRemove) %>
<%= $c->render_to_string(inline => $actionModify) %><%= $c->render_to_string(inline => $actionRemove) %>
- <%} %> - - + % }
diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_pse_add.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_pse_add.html.ep index c8c9ae6..37104f6 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_pse_add.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_pse_add.html.ep @@ -1,41 +1,48 @@
- % my $btn = l('ADD'); - - %= form_for '/pseudonyms2' => (method => 'POST') => begin -

-

- %=l 'pse_TITLE_CREATE' -

+ % my $btn = l('ADD');
- %= $c->render_to_string(inline => l('pse_VALID_PSEUDONYM_NAMES')); -

+

<%= l 'pse_TITLE_CREATE' %>

+
+
-

- - %=l 'pse_PSEUDONYM_NAME', class => "" - - - %= text_field 'Pseudonym', class => "" - -

+
+
+ <%= $c->render_to_string(inline => l('pse_VALID_PSEUDONYM_NAMES')); %> +
+
+
+
+ +
-

- - %=l 'pse_SELECT_ACCOUNT', class => "" - - - %= select_field 'Account' => $c->existing_accounts_list(), class => "" - -

+
+ +
+
-

-

- %= submit_button "$btn", class => "" -

+

- %= hidden_field 'trt' => $pse_datas->{trt} - - % end +
+
+ <%=l 'pse_SELECT_ACCOUNT' %> +
+ +
+ <%= select_field 'Account' => $c->existing_accounts_list(), class => "form-select" %> +
+
+ +

+ +
+
+ +
+
+ + %= hidden_field 'trt' => $pse_datas->{trt} + +
diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_pse_del.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_pse_del.html.ep index 8776a92..f3e9304 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_pse_del.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_pse_del.html.ep @@ -1,25 +1,30 @@
- % my $btn = l('REMOVE'); - %= form_for '/pseudonyms2' => (method => 'POST') => begin -

-

- %=l 'pse_REMOVE_PSEUDONYM' -

+ % my $btn = l('REMOVE'); -

- %= $c->render_to_string(inline => l('pse_ABOUT_TO_REMOVE', $pse_datas->{pseudonym})); +

+

<%= l 'pse_REMOVE_PSEUDONYM' %>

-

+ <%#= $c->render_to_string(inline => l('pse_ABOUT_TO_REMOVE', $pse_datas->{pseudonym})); %> -

-
- %= submit_button "$btn", class => "" -

+ Thisis the old test that needs fixing in the language files + <%= l('pse_ABOUT_TO_REMOVE') %> + +
+ + You are about to remove the pseudonym: <%= $pse_datas->{pseudonym} %> + +
Are you sure you wish to continue?
+ + +

+
+
+ +
+
%= hidden_field 'trt' => $pse_datas->{trt} %= hidden_field 'Pseudonym' => $pse_datas->{pseudonym} - - % end - +
diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_pse_list.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_pse_list.html.ep index 58971ee..a474b77 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_pse_list.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_pse_list.html.ep @@ -8,91 +8,81 @@ %= hidden_field 'trt' => 'ADD' -


- %= submit_button "$btn", class => "" -

- - % end +
+
+ +
+
+ % end +
+

<%= l 'pse_CURRENT_PSEUDONYMS' %>

+
+ % my $numPseudonyms = @$pseudonyms; + % if ($numPseudonyms == 0) { + <%= l 'pse_ACCOUNT_PSEUDONYM_NONE' %> + % } else { + + + + + + + + + + -

- %=l 'pse_CURRENT_PSEUDONYMS' -


- % my $numPseudonyms = @$pseudonyms; - % if ($numPseudonyms == 0){ - %=l 'pse_ACCOUNT_PSEUDONYM_NONE' - % } else { -
<%= l 'pse_PSEUDONYM' %><%= l 'pse_USER_OR_GROUP' %><%= l 'ACTION' %>
- - - - - + % foreach my $pseudonym ( @$pseudonyms ) { + % my $modifiable = $pseudonym->prop('Changeable') || 'yes'; + % my $removable = $pseudonym->prop('Removable') || 'yes'; - - - - + % my $account = $pseudonym->prop('Account'); + % $account = "Administrator" if ($account eq "admin"); + % $account = $c->l("pse_EVERYONE") if ($account eq "shared"); - % foreach my $pseudonym ( @$pseudonyms ) - % { - % my $modifiable = $pseudonym->prop('Changeable') || 'yes'; - % my $removable = $pseudonym->prop('Removable') || 'yes'; + % my $visible = $pseudonym->prop('Visible'); + % $account .= $c->l("pse_LOCAL_ONLY") + % if (defined $visible && $visible eq "internal"); - % my $account = $pseudonym->prop('Account'); - % $account = "Administrator" if ($account eq "admin"); - % $account = $c->l("pse_EVERYONE") if ($account eq "shared"); + + + - % my $visible = $pseudonym->prop('Visible'); - % $account .= $c->l("pse_LOCAL_ONLY") - % if (defined $visible && $visible eq "internal"); + % my ($actionModify, $actionRemove) = ' '; + % if ($modifiable eq 'yes') { + %my $modify_text = l('MODIFY'); # Localized text + %my $csrf_token = "TOKEN"; # CSRF token for security + %my $pseudonyms_entry_name = $pseudonym->key; # pseudonyms_entry name extracted from the data structure + %$actionModify = qq{ + % + % + % + %}; + % } - - %= t td => (class => "") => $pseudonym->key - %= t td => (class => "") => $account + % if ($removable eq 'yes') { + %my $remove_text = l('REMOVE'); # Localized text + %my $csrf_token = "TOKEN"; # CSRF token for security + %my $pseudonyms_entry_name = $pseudonym->key; # pseudonyms_entry name extracted from the data structure + %$actionRemove = qq{ + % + % + % + %}; + % } - + - %if ($removable eq 'yes') { - %my $remove_text = l('REMOVE'); # Localized text - %my $csrf_token = "TOKEN"; # CSRF token for security - %my $pseudonyms_entry_name = $pseudonym->key; # pseudonyms_entry name extracted from the data structure - %$actionRemove = qq{ - % - % - % - %}; - %} - <%= $c->render_to_string(inline => $actionModify) %> <%= $c->render_to_string(inline => $actionRemove) %> - - - - % } - + + % } +
- %=l 'pse_PSEUDONYM' - - %=l 'pse_USER_OR_GROUP' - - %=l 'ACTION' -
<%= $pseudonym->key%><%= $account%>
- %my ($actionModify, $actionRemove) = ' '; - %if ($modifiable eq 'yes') { - %my $modify_text = l('MODIFY'); # Localized text - %my $csrf_token = "TOKEN"; # CSRF token for security - %my $pseudonyms_entry_name = $pseudonym->key; # pseudonyms_entry name extracted from the data structure - %$actionModify = qq{ - % - % - % - %}; - %} + <%= $c->render_to_string(inline => $actionModify) %><%= $c->render_to_string(inline => $actionRemove) %>
- <%} %> -

- + % }
diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_swt_theme.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_swt_theme.html.ep index e5aa1fa..069cec1 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_swt_theme.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_swt_theme.html.ep @@ -25,17 +25,15 @@
- - - %= select_field 'Theme' => $c->theme_list(), class => "form-select" - + + %= select_field 'Theme' => $c->theme_list(), class => "form-select", id => "Preference" %= hidden_field 'From' => $c->tx->req->url
- -
- -
-
+ +
+ +
+
diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/pseudonyms.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/pseudonyms.html.ep index aa055b2..bbcb9e7 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/pseudonyms.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/pseudonyms.html.ep @@ -10,11 +10,12 @@ %= dumper $pse_datas
% } - + % if ( stash 'error' ) { -
- <%= $c->render_to_string(inline => stash 'error') %> -
+
+
+ <%= $c->render_to_string(inline => stash 'error') %> +
% }

<%= $title%>

@@ -30,4 +31,5 @@ % }
+ %end diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/useraccounts.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/useraccounts.html.ep index 01d096d..c6f75af 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/useraccounts.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/useraccounts.html.ep @@ -2,28 +2,22 @@ % content_for 'module' => begin -%#= include 'partials/_panel_card_top' -%#= include 'partials/_panel_card_header' -
- - % if (config->{debug} == 1) { -

- %= dumper $c->current_route - %= dumper $usr_datas -

+
+ %= dumper $c->current_route + %= dumper $usr_datas +
% } - -

<%= $title%>

- + % if ( $notif ) { -
- - <%= $c->render_to_string(inline => $notif) %> - - %} +
+ <%= $c->render_to_string(inline => $notif) %> +
+ % } + +

<%= $title%>

% if ($usr_datas->{trt} eq 'ADD' or $usr_datas->{trt} eq 'UPD') { %= include 'partials/_usr_upd' @@ -43,8 +37,5 @@
-%#= include 'partials/_panel_card_footer' -%#= include 'partials/_panel_card_bottom' - %end