From 43f790de99f16987d64037be0a7cf6e1fa265f06 Mon Sep 17 00:00:00 2001 From: John Crisp Date: Thu, 1 May 2025 18:11:13 +0200 Subject: [PATCH] More cleanup with _usr_list --- .../templates/partials/_usr_list.html.ep | 69 ++++++++++--------- smeserver-manager-AdminLTE.spec | 6 +- 2 files changed, 43 insertions(+), 32 deletions(-) diff --git a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_usr_list.html.ep b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_usr_list.html.ep index d0b1e95..21a91de 100644 --- a/root/usr/share/smanager/themes/AdminLTE/templates/partials/_usr_list.html.ep +++ b/root/usr/share/smanager/themes/AdminLTE/templates/partials/_usr_list.html.ep @@ -49,29 +49,32 @@ % foreach my $user (@$users) { - % my $username = $user->key(); - % my $first = $user->prop('FirstName'); - % my $last = $user->prop('LastName'); - % my $lockable = $user->prop('Lockable') || 'yes'; - % my $removable = $user->prop('Removable') || 'yes'; - % my $fwd = (($user->prop('EmailForward') || 'local') =~ m/^forward|both$/) ? - % $user->prop('ForwardAddress') : ''; - % my $vpnaccess = $user->prop('VPNClientAccess') || 'no'; - % $vpnaccess = $vpnaccess eq 'yes' ? $c->l('YES') : $c->l('NO'); - % my $password_set = $user->prop('PasswordSet'); - + % my $username = $user->key(); + % my $first = $user->prop('FirstName'); + % my $last = $user->prop('LastName'); + % my $lockable = $user->prop('Lockable') || 'yes'; + % my $removable = $user->prop('Removable') || 'yes'; + % my $fwd = (($user->prop('EmailForward') || 'local') =~ m/^forward|both$/) ? + % $user->prop('ForwardAddress') : ''; + % my $vpnaccess = $user->prop('VPNClientAccess') || 'no'; + % $vpnaccess = $vpnaccess eq 'yes' ? $c->l('YES') : $c->l('NO'); + % my $password_set = $user->prop('PasswordSet'); + % my $useraccounts_user_name = $user->key; # useraccountss_entry name extracted from the data structure + % my $csrf_token = "TOKEN"; # CSRF token for security + % my $modify_text = l('MODIFY'); # Localized text + % my $remove_text = l('REMOVE'); # Localized text + % my $password_text = l("PASSWORD_RESET"); + % my $lock_text = l('usr_LOCK'); # Localized text + % my $roundcube_text = l('Webmail'); # Localized text + % my ($actionModify, $actionLock, $actionResetPw, $actionRemove,$actionroundcube) = ' '; + % my $thisdomain = $c->req->url->to_abs->host; + <%= $username %> <%=$first %> <%=$last %> <%= $vpnaccess %> <%= $fwd %> - % my ($actionModify, $actionLock, $actionResetPw, $actionRemove,$actionroundcube) = ' '; - % 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 ($useraccounts_user_name eq 'admin') { %$actionModify = qq{ % @@ -99,18 +102,26 @@ % if ($password_set ne 'yes') { - %$actionLock = l('ACCOUNT_LOCKED'); - %$actionResetPw = qq{ + + + %#$actionLock = l('ACCOUNT_LOCKED'); + + %$actionLock = qq{ % - % % - %}; + %}; + %$actionResetPw = qq{ + % + % + % + %}; + % } elsif ($useraccounts_user_name ne 'admin') { - % my $lock_text = l('usr_LOCK'); # Localized text - % my $csrf_token = "TOKEN"; # CSRF token for security - % my $useraccounts_user_name = $user->key; # useraccountss_entry name extracted from the data structure %$actionLock = qq{ % % % %}; + <%= $c->render_to_string(inline => $actionModify) %> <%= $c->render_to_string(inline => $actionResetPw) %> <%= $c->render_to_string(inline => $actionLock) %> diff --git a/smeserver-manager-AdminLTE.spec b/smeserver-manager-AdminLTE.spec index 8d8d3b8..fe5ba50 100644 --- a/smeserver-manager-AdminLTE.spec +++ b/smeserver-manager-AdminLTE.spec @@ -1,6 +1,6 @@ %define name smeserver-manager-AdminLTE %define version 11.0.0 -%define release 17 +%define release 18 Summary: AdminLTE is an html framework for admin consoles - this rpm adds it to smeserver manager2 Name: %{name} Version: %{version} @@ -26,6 +26,10 @@ AdminLTE is an html framework for admin consoles wget https://github.com/ColorlibHQ/AdminLTE/archive/master.zip %changelog +* Thu May 01 2025 John Crisp 11.0.0-18.sme +- Trying to make _user_list more logical. Needs 'UNLOCK' translation +- Big cleanup of dupplicate % my= but needs more work + * Thu May 01 2025 John Crisp 11.0.0-17.sme - Convert tabs to spaces for consistency - Fix group update container