Edit template for controller - Refine params copy and bring DB opens up to spec with UTF8
This commit is contained in:
161
output/Useraccounts/AdminLTE/_usr_list.html.new.ep
Normal file
161
output/Useraccounts/AdminLTE/_usr_list.html.new.ep
Normal file
@@ -0,0 +1,161 @@
|
||||
<div>
|
||||
|
||||
% my $btn = l("usr_ADD_USER");
|
||||
|
||||
<form action="/smanager/useraccounts" method="POST">
|
||||
<br>
|
||||
<div>
|
||||
<button type="submit" class="btn btn-primary btn-sm"><%= $btn %> </button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<br>
|
||||
<%= $c->render_to_string(inline => $c->l("usr_FIRSTPAGE_DESC")) %>
|
||||
<br>
|
||||
|
||||
%#= dumper @$users
|
||||
|
||||
% my $numUsers = @$users;
|
||||
% if ($numUsers == 0) {
|
||||
<%=l "usr_NO_USER_ACCOUNTS" %>
|
||||
% } else {
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= l "ACCOUNT" %></th>
|
||||
<th><%= l "USER_NAME" %></th>
|
||||
<th><%= l "usr_VPN_CLIENT_ACCESS" %></th>
|
||||
<th><%= l "usr_FORWARDING_ADDRESS" %></th>
|
||||
<th class="text-center text-center" colspan="5"><%= l "ACTION" %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
% 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 $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("Lock"); # Localized text
|
||||
% my $roundcube_text = l("Webmail"); # Localized text
|
||||
% my ($actionModify, $actionLock, $actionResetPw, $actionRemove,$actionroundcube) = " ";
|
||||
% my $thisdomain = $c->req->url->to_abs->host;
|
||||
|
||||
<tr class="align-middle">
|
||||
<td><%= $username %></td>
|
||||
<td><%= $first %> <%=$last %></td>
|
||||
<td><%= $vpnaccess %></td>
|
||||
<td><%= $fwd %></td>
|
||||
|
||||
% if ($useraccounts_user_name eq "admin") {
|
||||
%$actionModify = qq{
|
||||
%<a href="useraccountsd?CsrfDef=$csrf_token&trt=UPS&user=$useraccounts_user_name">
|
||||
% <button type="button" class="btn btn-primary btn-sm" title="$modify_text">
|
||||
% $modify_text
|
||||
% </button>
|
||||
%</a>
|
||||
%};
|
||||
%$actionResetPw = qq{
|
||||
%<a href="useraccountsd?CsrfDef=$csrf_token&trt=PWS&user=$useraccounts_user_name">
|
||||
% <button type="button" class="btn btn-primary btn-sm" title="$password_text" >
|
||||
% $password_text
|
||||
% </button>
|
||||
%</a>
|
||||
%};
|
||||
% } else {
|
||||
%$actionModify = qq{
|
||||
%<a href="useraccountsd?CsrfDef=$csrf_token&trt=UPD&user=$useraccounts_user_name">
|
||||
% <button type="button" class="btn btn-primary btn-sm" title="$modify_text" >
|
||||
% $modify_text
|
||||
% </button>
|
||||
%</a>
|
||||
%};
|
||||
% }
|
||||
|
||||
|
||||
% if ($password_set ne "yes") {
|
||||
|
||||
<!-- Needs a fix here -->
|
||||
%#$actionLock = l("ACCOUNT_LOCKED");
|
||||
<!-- Sets BOTH columns - possibly leave out Reset Password here?-->
|
||||
%$actionLock = qq{
|
||||
%<a href="useraccountsd?CsrfDef=$csrf_token&trt=PWD&user=$useraccounts_user_name">
|
||||
% <button type="button" class="btn btn-danger btn-sm" title="$password_text - currently unset">
|
||||
% Unlock
|
||||
% </button>
|
||||
%</a>
|
||||
%};
|
||||
%$actionResetPw = qq{
|
||||
%<a href="useraccountsd?CsrfDef=$csrf_token&trt=PWD&user=$useraccounts_user_name">
|
||||
% <button type="button" class="btn btn-primary btn-sm" title="$password_text - currently unset">
|
||||
% $password_text
|
||||
% </button>
|
||||
%</a>
|
||||
%};
|
||||
|
||||
% } elsif ($useraccounts_user_name ne "admin") {
|
||||
%$actionLock = qq{
|
||||
%<a href="useraccountsd?CsrfDef=$csrf_token&trt=LCK&user=$useraccounts_user_name">
|
||||
% <button type="button" class="btn btn-primary btn-sm" title="$lock_text" >
|
||||
% $lock_text
|
||||
% </button>
|
||||
%</a>
|
||||
%};
|
||||
%$actionResetPw = qq{
|
||||
%<a href="useraccountsd?CsrfDef=$csrf_token&trt=PWD&user=$useraccounts_user_name">
|
||||
% <button type="button" class="btn btn-primary btn-sm" title="$password_text" >
|
||||
% $password_text
|
||||
% </button>
|
||||
%</a>
|
||||
%};
|
||||
% }
|
||||
|
||||
% if ( $removable eq "yes" ) {
|
||||
%$actionRemove = qq{
|
||||
%<a href="useraccountsd?CsrfDef=$csrf_token&trt=DEL&user=$useraccounts_user_name">
|
||||
% <button type="button" class="btn btn-primary btn-sm" title="$remove_text" >
|
||||
% $remove_text
|
||||
% </button>
|
||||
%</a>
|
||||
%};
|
||||
% }
|
||||
|
||||
<!-- If webmail disabled??? -->
|
||||
% $actionroundcube = qq{
|
||||
%<a href="roundcubepanel?CsrfDef=$csrf_token&url=https://$thisdomain/roundcube?_user=$useraccounts_user_name&height=600px">
|
||||
% <button type="button" class="btn btn-primary btn-sm" title="$roundcube_text" >
|
||||
% $roundcube_text
|
||||
% </button>
|
||||
%</a>
|
||||
%};
|
||||
|
||||
<td class="text-center"><%= $c->render_to_string(inline => $actionModify) %></td>
|
||||
<td class="text-center"><%= $c->render_to_string(inline => $actionResetPw) %></td>
|
||||
<td class="text-center"><%= $c->render_to_string(inline => $actionLock) %></td>
|
||||
<td class="text-center"><%= $c->render_to_string(inline => $actionRemove) %></td>
|
||||
<td class="text-center"><%= $c->render_to_string(inline => $actionroundcube) %></td>
|
||||
</tr>
|
||||
% }
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
% }
|
||||
|
||||
<%= hidden_field "trt" => $usr_datas->{trt} %>
|
||||
|
||||
</div>
|
||||
|
57
output/Useraccounts/AdminLTE/_usr_lock.html.new.ep
Normal file
57
output/Useraccounts/AdminLTE/_usr_lock.html.new.ep
Normal file
@@ -0,0 +1,57 @@
|
||||
<div>
|
||||
|
||||
% my $btn = l("Lock");
|
||||
|
||||
<form action="/smanager/useraccountsd" method="POST">
|
||||
|
||||
%#= form_for "/useraccountsd" => (method => "POST") => begin
|
||||
|
||||
<div>
|
||||
<h2><%= l "Lock_ACCOUNT_TITLE" %></h2>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
Needs a text change in the Lex files
|
||||
<br>
|
||||
<%= $c->l("Lock_DESC", $usr_datas->{user}, $usr_datas->{name} ) %>
|
||||
</div>
|
||||
|
||||
<br><br>
|
||||
|
||||
<table class="table table-bordered user-table-max-wdith">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-sm">
|
||||
%=l "ACCOUNT"
|
||||
</th>
|
||||
<th class="col-sm">
|
||||
%=l "USER_NAME"
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><%= $usr_datas->{user} %></td>
|
||||
<td><%= $usr_datas->{name} %></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<br>
|
||||
%= $c->render_to_string(inline => $c->l("Lock_DESC2"))
|
||||
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-md-2">
|
||||
<button type="submit" class="btn btn-primary btn-sm"><%= $btn %></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
%= hidden_field "trt" => $usr_datas->{trt}
|
||||
%= hidden_field "user" => $usr_datas->{user}
|
||||
%= hidden_field "name" => $usr_datas->{name}
|
||||
|
||||
</form>
|
||||
%# end
|
||||
|
||||
</div>
|
296
output/Useraccounts/AdminLTE/_usr_upd.html.new.ep
Normal file
296
output/Useraccounts/AdminLTE/_usr_upd.html.new.ep
Normal file
@@ -0,0 +1,296 @@
|
||||
|
||||
<div>
|
||||
<br>
|
||||
<h2><%= l "usr_P2_TITLE" %></h2>
|
||||
<br>
|
||||
<%= $c->render_to_string(inline => l ("usr_CREATE_MODIFY_DESC")) %>
|
||||
<br><br>
|
||||
|
||||
% my $btn = l("ADD");
|
||||
|
||||
<form action="/smanager/useraccountsd" method="POST">
|
||||
%#= form_for "/useraccountsd" => (method => "POST") => begin
|
||||
|
||||
% if ( $usr_datas->{trt} eq "ADD" ) {
|
||||
|
||||
% param "user" => $usr_datas->{user} unless param "user";
|
||||
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-md-2">
|
||||
<label for="inputAccountName" class="col-form-label"><%= l "usr_ACCOUNT_NAME" %></label>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input type="text" name="user" id="inputAccountName" class="form-control" aria-describedby="AccountName" value="<%= $usr_datas->{user} %>" >
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<span id="passwordHelpInline" class="form-text">
|
||||
User
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
% } else {
|
||||
<!-- If not user set Button Save not Add -->
|
||||
% $btn = l("SAVE");
|
||||
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-md-2">
|
||||
<label for="inputLastNAme" class="col-form-label"><%= l "usr_ACCOUNT_NAME" %></label>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input disabled type="text" id="disabledTextInput" class="form-control" placeholder="<%= $usr_datas->{user} %>">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
% }
|
||||
|
||||
<br>
|
||||
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-md-2">
|
||||
<label for="inputFirstName" class="col-form-label"><%= l "usr_FIRSTNAME" %></label>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input type="text" name="FirstName" id="inputFirstName" class="form-control" aria-describedby="FirstName" value="<%= $usr_datas->{firstname} %>" >
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<span id="passwordHelpInline" class="form-text">
|
||||
First Name
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
% param "LastName" => $usr_datas->{lastname} unless param "LastName";
|
||||
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-md-2">
|
||||
<label for="inputLastNAme" class="col-form-label"><%= l "usr_LASTNAME" %></label>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input type="text" name="LastName" id="inputLastName" class="form-control" aria-describedby="LastName" value="<%= $usr_datas->{lastname} %>" >
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<span id="passwordHelpInline" class="form-text">
|
||||
Last Name
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
|
||||
% param "Dept" => $usr_datas->{dept} unless param "Dept";
|
||||
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-md-2">
|
||||
<label for="inputDepartment" class="col-form-label"><%= l "Department" %></label>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input type="text" name="Dept" id="inputEmail" class="form-control" aria-describedby="Dept" value="<%= $usr_datas->{dept} %>" >
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<span id="passwordHelpInline" class="form-text">
|
||||
Department
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
|
||||
% param "Company" => $usr_datas->{company} unless param "Company";
|
||||
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-md-2">
|
||||
<label for="inputCompany" class="col-form-label"><%= l "Company" %></label>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input type="text" name="Company" id="inputCompany" class="form-control" aria-describedby="Company" value="<%= $usr_datas->{company} %>" >
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<span id="passwordHelpInline" class="form-text">
|
||||
Company
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
|
||||
% param "Street" => $usr_datas->{street} unless param "Street";
|
||||
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-md-2">
|
||||
<label for="inputStreet" class="col-form-label"><%= l "usr_STREET_ADDRESS" %></label>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input type="text" name="Street" id="inputCompany" class="form-control" aria-describedby="Street" value="<%= $usr_datas->{street} %>" >
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<span id="passwordHelpInline" class="form-text">
|
||||
Street
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
% param "City" => $usr_datas->{city} unless param "City";
|
||||
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-md-2">
|
||||
<label for="inputCity" class="col-form-label"><%= l "City" %></label>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input type="text" name="City" id="inputCity" class="form-control" aria-describedby="City" value="<%= $usr_datas->{city} %>" >
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<span id="passwordHelpInline" class="form-text">
|
||||
City
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
% param "Phone" => $usr_datas->{phone} unless param "Phone";
|
||||
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-md-2">
|
||||
<label for="inputPhone" class="col-form-label"><%= l "usr_PHONE_NUMBER" %></label>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input type="text" name="Phone" id="inputPhone" class="form-control" aria-describedby="City" value="<%= $usr_datas->{phone} %>" >
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<span id="passwordHelpInline" class="form-text">
|
||||
Phone
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
% param "EmailForward" => $usr_datas->{emailforward} unless param "EmailForward";
|
||||
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-md-2">
|
||||
<label for="inputEmailDelivery" class="col-form-label"><%= l "usr_EMAIL_DELIVERY" %></label>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
%= select_field "EmailForward" => $c->emailForward_list(), class => "form-select"
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
% param "ForwardAddress" => $usr_datas->{forwardaddress} unless param "ForwardAddress";
|
||||
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-md-2">
|
||||
<label for="inputEmail" class="col-form-label"><%= l "usr_FORWARDING_ADDRESS" %></label>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input type="email" name="ForwardAddresss" id="inputEmail" class="form-control" aria-describedby="Email" value=<%= $usr_datas->{forwardaddress} %>>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<span id="passwordHelpInline" class="form-text">
|
||||
Email forwarding address
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
|
||||
% param "VPNClientAccess" => $usr_datas->{vpnclientaccess} unless param "VPNClientAccess";
|
||||
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-md-2">
|
||||
<label for="inputVPNClientAccess" class="col-form-label"><%= l "usr_VPN_CLIENT_ACCESS" %></label>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
%= select_field "VPNClientAccess" => [[ (l "NO") => "no"], [ (l "YES") => "yes"]], class => "form-select"
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<!-- fix from here -->
|
||||
|
||||
|
||||
<!-- Begin if ipsec needs fixing -->
|
||||
% if ( $usr_datas->{trt} eq "UPD" and $c->ipsec_for_acct eq "OK" ) {
|
||||
% my $btn2 = $c->l("DOWNLOAD");
|
||||
%= form_for "/useraccountso" => (method => "POST") => begin
|
||||
%= l "usr_LABEL_IPSECRW_DOWNLOAD"
|
||||
%= submit_button $btn2, class => ""
|
||||
%= hidden_field "trt" => "CRT"
|
||||
%= hidden_field "user" => $usr_datas->{user}
|
||||
% end
|
||||
% }
|
||||
<!-- End if ipsec -->
|
||||
|
||||
|
||||
<!-- Groups begin -->
|
||||
<div>
|
||||
% my @groups = @{$c->get_groups()};
|
||||
|
||||
%#= dumper @groups
|
||||
|
||||
% if ( @groups ) {
|
||||
|
||||
<br><br>
|
||||
|
||||
%=l "usr_GROUP_MEMBERSHIPS"
|
||||
|
||||
<br><br>
|
||||
|
||||
<table class="table table-bordered user-table-max-wdith">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-sm-1"><%= l "usr_MEMBER" %></th>
|
||||
<th class="col-sm-1"><%=l "GROUP" %></th>
|
||||
<th class="col-sm-1"><%=l "DESCRIPTION" %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
% foreach my $g ( @groups) {
|
||||
% my $user = $usr_datas->{user};
|
||||
% my $groupname = $g->key();
|
||||
% my $description = $g->prop("Description");
|
||||
% my $checked = "";
|
||||
% if ( $user and $c->is_user_in_group($user, $groupname) ) {
|
||||
% $checked = "checked";
|
||||
% }
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
% if ( $checked eq "checked" ) {
|
||||
<input type="checkbox" name="groupMemberships" checked value="<%= $groupname %>">
|
||||
%} else {
|
||||
%= check_box "groupMemberships" => $groupname
|
||||
%}
|
||||
</td>
|
||||
<td><%= $groupname %></td>
|
||||
<td><%= $description %></td>
|
||||
</tr>
|
||||
% }
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
% }
|
||||
<!-- Groups End -->
|
||||
</div>
|
||||
|
||||
<div class="row g-3 align-items-center">
|
||||
<div class="col-md-2">
|
||||
<button type="submit" class="btn btn-primary btn-sm"><%= $btn %></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
%= hidden_field "trt" => $usr_datas->{trt}
|
||||
|
||||
% if ( $usr_datas->{trt} eq "UPD" ) {
|
||||
%= hidden_field "user" => $usr_datas->{user}
|
||||
% }
|
||||
|
||||
</form>
|
||||
%#end
|
||||
</div>
|
||||
|
||||
<!-- End of containers-sm -->
|
Reference in New Issue
Block a user