From 1d3d59b5c1d10e59115234f7bec5bbed166eafc7 Mon Sep 17 00:00:00 2001 From: Brian Read Date: Mon, 16 Dec 2024 19:55:15 +0000 Subject: [PATCH] Fix up action commands for user panel --- .../templates/partials/_usr_list.html.ep | 84 ++++++++++++++----- 1 file changed, 61 insertions(+), 23 deletions(-) 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 25bdd35..98c0bf5 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 @@ -59,29 +59,67 @@ %= t td => (class => 'sme-border') => "$first $last" %= t td => (class => 'sme-border') => $vpnaccess %= t td => (class => 'sme-border') => $fwd - % my ($actionModify, $actionLock, $actionResetPw, $actionRemove) = ' '; - % if ($username eq 'admin') { - % $actionModify = "" . ""; - % $actionResetPw = "" . ""; - % } else { - % $actionModify = "" . ""; - % if ($password_set ne 'yes') { - % $actionLock = l('ACCOUNT_LOCKED'); - % $actionResetPw = "" . ""; - % } else { - % $actionLock = "" . ""; - % $actionResetPw = "" . ""; - % } - % if ( $removable eq 'yes' ) { - % $actionRemove = "" . ""; - % } - % } - % - % my $thisdomain = session 'SystemName'; - % $thisdomain .= ".".session 'DomainName'; - %# my $thisdomain = "localhost"; + %my ($actionModify, $actionLock, $actionResetPw, $actionRemove) = ' '; + %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') { + %$actionModify = qq{ + % + %}; + %} else { + %$actionModify = qq{ + % + %}; + %} + %if ($password_set ne 'yes') { + %$actionLock = l('ACCOUNT_LOCKED'); + %$actionResetPw = qq{ + % + %}; + %} else { + %my $lock_text = l('ACCOUNT LOCKED'); # 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{ + % + %}; + %$actionResetPw = qq{ + % + %}; + %} + %if ( $removable eq 'yes' ) { + %my $remove_text = l('REMOVE'); # Localized text + %my $csrf_token = "TOKEN"; # CSRF token for security + %$actionRemove = qq{ + % + %}; + %} - + % my $thisdomain = session 'SystemName'; + % $thisdomain .= ".".session 'DomainName'; + %# my $thisdomain = "localhost"; + + <%= $c->render_to_string(inline => $actionModify) %> <%= $c->render_to_string(inline => $actionResetPw) %> <%= $c->render_to_string(inline => $actionLock) %> @@ -97,4 +135,4 @@ %= hidden_field 'trt' => $usr_datas->{trt} - + \ No newline at end of file