Compare commits

...

11 Commits

Author SHA1 Message Date
John Crisp
e0dd4db0d9 cleanup group add file 2025-05-01 12:46:01 +02:00
John Crisp
e88cf07647 format group file 2025-05-01 12:43:53 +02:00
John Crisp
77d3e10bce fix user add and update group files 2025-05-01 12:38:55 +02:00
John Crisp
8ab480abfd Updated CSS 2025-04-25 19:12:10 +02:00
John Crisp
295c6b3ff3 User files finished and groups started 2025-04-25 19:01:25 +02:00
John Crisp
dbeacddd96 More tidying user accounts files 2025-04-25 14:30:30 +02:00
John Crisp
1a4c172969 Tidy User list 2025-04-24 11:34:16 +02:00
John Crisp
cd6c752805 Move around and add css/js files 2025-04-23 15:34:07 +02:00
John Crisp
95dedd2f38 Sidebar scrolling 2025-04-23 15:33:16 +02:00
John Crisp
50edcdee9c Move work on forms 2025-04-19 02:18:01 +02:00
John Crisp
0d7f87c6aa Move more code to html and work on forms 2025-04-19 01:39:57 +02:00
37 changed files with 1624 additions and 798 deletions

View File

@@ -0,0 +1 @@
/usr/share/javascript/jquery-ui/jquery-ui.min.css

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
/usr/share/javascript/jquery-ui/jquery-ui.min.js

View File

@@ -0,0 +1 @@
/usr/share/javascript/jquery/jquery.min.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -51,6 +51,7 @@
.login-page {
min-height: 10vh;
vertical-align: top !important;
}
.nav-icon {
@@ -88,3 +89,22 @@
cursor: default; /* Prevent text cursor */
}
/* TD and buttons in user lists */
.user-td-no-right {
border-left-width: 0px;
}
.user-td-no-left {
border-left-width: 0px;
}
.user-valign-center {
text-align: center;
}
.user-table-max-wdith {
max-width: 50%;
}

View File

@@ -0,0 +1,298 @@
document.addEventListener('DOMContentLoaded', () => {
const flagContainer = document.getElementById('flag-container');
// Mapping of language codes to country codes and their names
const languageToCountryMap = {
"af": { code: "NA", name: "Namibia" },
"agq": { code: "CM", name: "Cameroon" },
"ak": { code: "GH", name: "Ghana" },
"am": { code: "ET", name: "Ethiopia" },
"ar": { code: "SA", name: "Saudi Arabia" },
"as": { code: "IN", name: "India" },
"asa": { code: "TZ", name: "Tanzania" },
"ast": { code: "ES", name: "Spain" },
"az": { code: "AZ", name: "Azerbaijan" },
"bas": { code: "CM", name: "Cameroon" },
"be": { code: "BY", name: "Belarus" },
"bem": { code: "ZM", name: "Zambia" },
"bez": { code: "TZ", name: "Tanzania" },
"bg": { code: "BG", name: "Bulgaria" },
"bm": { code: "ML", name: "Mali" },
"bn": { code: "BD", name: "Bangladesh" },
"bo": { code: "CN", name: "China" },
"br": { code: "FR", name: "France" },
"brx": { code: "IN", name: "India" },
"bs": { code: "BA", name: "Bosnia and Herzegovina" },
"ca": { code: "AD", name: "Andorra" },
"ccp": { code: "BD", name: "Bangladesh" },
"ce": { code: "RU", name: "Russia" },
"cgg": { code: "UG", name: "Uganda" },
"chr": { code: "US", name: "United States" },
"ckb": { code: "IQ", name: "Iraq" },
"cs": { code: "CZ", name: "Czech Republic" },
"cy": { code: "GB", name: "United Kingdom" },
"da": { code: "DK", name: "Denmark" },
"dav": { code: "KE", name: "Kenya" },
"de": { code: "DE", name: "Germany" },
"dje": { code: "NE", name: "Niger" },
"dsb": { code: "DE", name: "Germany" },
"dua": { code: "CM", name: "Cameroon" },
"dyo": { code: "SN", name: "Senegal" },
"dz": { code: "BT", name: "Bhutan" },
"ebu": { code: "KE", name: "Kenya" },
"ee": { code: "GH", name: "Ghana" },
"el": { code: "CY", name: "Cyprus" },
"en": { code: "US", name: "United States" }, // Assume US for English if unspecified
"es": { code: "ES", name: "Spain" },
"et": { code: "EE", name: "Estonia" },
"eu": { code: "ES", name: "Spain" },
"ewo": { code: "CM", name: "Cameroon" },
"fa": { code: "AF", name: "Afghanistan" },
"ff": { code: "CM", name: "Cameroon" },
"fi": { code: "FI", name: "Finland" },
"fil": { code: "PH", name: "Philippines" },
"fo": { code: "FO", name: "Faroe Islands" },
"fr": { code: "FR", name: "France" },
"fur": { code: "IT", name: "Italy" },
"fy": { code: "NL", name: "Netherlands" },
"ga": { code: "IE", name: "Ireland" },
"gd": { code: "GB", name: "United Kingdom" },
"gl": { code: "ES", name: "Spain" },
"gsw": { code: "CH", name: "Switzerland" },
"gu": { code: "IN", name: "India" },
"guz": { code: "KE", name: "Kenya" },
"gv": { code: "IM", name: "Isle of Man" },
"ha": { code: "GH", name: "Ghana" },
"haw": { code: "US", name: "United States" },
"he": { code: "IL", name: "Israel" },
"hi": { code: "IN", name: "India" },
"hr": { code: "HR", name: "Croatia" },
"hsb": { code: "DE", name: "Germany" },
"hu": { code: "HU", name: "Hungary" },
"hy": { code: "AM", name: "Armenia" },
"id": { code: "ID", name: "Indonesia" },
"ig": { code: "NG", name: "Nigeria" },
"ii": { code: "CN", name: "China" },
"is": { code: "IS", name: "Iceland" },
"it": { code: "IT", name: "Italy" },
"ja": { code: "JP", name: "Japan" },
"jgo": { code: "CM", name: "Cameroon" },
"jmc": { code: "TZ", name: "Tanzania" },
"ka": { code: "GE", name: "Georgia" },
"kab": { code: "DZ", name: "Algeria" },
"kam": { code: "KE", name: "Kenya" },
"kde": { code: "TZ", name: "Tanzania" },
"kea": { code: "CV", name: "Cabo Verde" },
"khq": { code: "ML", name: "Mali" },
"ki": { code: "KE", name: "Kenya" },
"kk": { code: "KZ", name: "Kazakhstan" },
"kkj": { code: "CM", name: "Cameroon" },
"kl": { code: "GL", name: "Greenland" },
"kln": { code: "KE", name: "Kenya" },
"km": { code: "KH", name: "Cambodia" },
"kn": { code: "IN", name: "India" },
"ko": { code: "KP", name: "North Korea" },
"kok": { code: "IN", name: "India" },
"ks": { code: "IN", name: "India" },
"ksb": { code: "TZ", name: "Tanzania" },
"ksf": { code: "CM", name: "Cameroon" },
"ksh": { code: "DE", name: "Germany" },
"kw": { code: "GB", name: "United Kingdom" },
"ky": { code: "KG", name: "Kyrgyzstan" },
"lag": { code: "TZ", name: "Tanzania" },
"lb": { code: "LU", name: "Luxembourg" },
"lg": { code: "UG", name: "Uganda" },
"lkt": { code: "US", name: "United States" },
"ln": { code: "AO", name: "Angola" },
"lo": { code: "LA", name: "Laos" },
"lrc": { code: "IQ", name: "Iraq" },
"lt": { code: "LT", name: "Lithuania" },
"lu": { code: "CD", name: "Democratic Republic of the Congo" },
"luo": { code: "KE", name: "Kenya" },
"Luo": { code: "KE", name: "Kenya" },
"luy": { code: "KE", name: "Kenya" },
"lv": { code: "LV", name: "Latvia" },
"mas": { code: "KE", name: "Kenya" },
"mer": { code: "KE", name: "Kenya" },
"mfe": { code: "MU", name: "Mauritius" },
"mg": { code: "MG", name: "Madagascar" },
"mgh": { code: "MZ", name: "Mozambique" },
"mgo": { code: "CM", name: "Cameroon" },
"mk": { code: "MK", name: "North Macedonia" },
"ml": { code: "IN", name: "India" },
"mn": { code: "MN", name: "Mongolia" },
"mr": { code: "IN", name: "India" },
"ms": { code: "BN", name: "Brunei" },
"mt": { code: "MT", name: "Malta" },
"mua": { code: "CM", name: "Cameroon" },
"my": { code: "MM", name: "Myanmar" },
"mzn": { code: "IR", name: "Iran" },
"naq": { code: "NA", name: "Namibia" },
"nb": { code: "NO", name: "Norway" },
"nd": { code: "ZW", name: "Zimbabwe" },
"nds": { code: "DE", name: "Germany" },
"ne": { code: "IN", name: "India" },
"nl": { code: "NL", name: "Netherlands" },
"nmg": { code: "CM", name: "Cameroon" },
"nn": { code: "NO", name: "Norway" },
"nnh": { code: "CM", name: "Cameroon" },
"nus": { code: "SS", name: "South Sudan" },
"nyn": { code: "UG", name: "Uganda" },
"om": { code: "ET", name: "Ethiopia" },
"or": { code: "IN", name: "India" },
"os": { code: "GE", name: "Georgia" },
"pa": { code: "PK", name: "Pakistan" },
"pl": { code: "PL", name: "Poland" },
"ps": { code: "AF", name: "Afghanistan" },
"pt": { code: "PT", name: "Portugal" },
"qu": { code: "BO", name: "Bolivia" },
"rm": { code: "CH", name: "Switzerland" },
"rn": { code: "BI", name: "Burundi" },
"ro": { code: "RO", name: "Romania" },
"rof": { code: "TZ", name: "Tanzania" },
"ru": { code: "RU", name: "Russia" },
"rw": { code: "RW", name: "Rwanda" },
"rwk": { code: "TZ", name: "Tanzania" },
"sah": { code: "RU", name: "Russia" },
"saq": { code: "KE", name: "Kenya" },
"sbp": { code: "TZ", name: "Tanzania" },
"se": { code: "SE", name: "Sweden" },
"seh": { code: "MZ", name: "Mozambique" },
"ses": { code: "ML", name: "Mali" },
"sg": { code: "CF", name: "Central African Republic" },
"shi": { code: "TN", name: "Tunisia" },
"si": { code: "LK", name: "Sri Lanka" },
"sk": { code: "SK", name: "Slovakia" },
"sl": { code: "SI", name: "Slovenia" },
"smn": { code: "FI", name: "Finland" },
"sn": { code: "ZW", name: "Zimbabwe" },
"so": { code: "SO", name: "Somalia" },
"sq": { code: "AL", name: "Albania" },
"sr": { code: "RS", name: "Serbia" },
"sv": { code: "SE", name: "Sweden" },
"sw": { code: "CD", name: "Democratic Republic of the Congo" },
"ta": { code: "IN", name: "India" },
"te": { code: "IN", name: "India" },
"teo": { code: "KE", name: "Kenya" },
"tg": { code: "TJ", name: "Tajikistan" },
"th": { code: "TH", name: "Thailand" },
"ti": { code: "ER", name: "Eritrea" },
"to": { code: "TO", name: "Tonga" },
"tr": { code: "TR", name: "Turkey" },
"tt": { code: "RU", name: "Russia" },
"twq": { code: "NE", name: "Niger" },
"tzm": { code: "MA", name: "Morocco" },
"ug": { code: "CN", name: "China" },
"uk": { code: "UA", name: "Ukraine" },
"ur": { code: "IN", name: "India" },
"uz": { code: "UZ", name: "Uzbekistan" },
"vai": { code: "TN", name: "Tunisia" },
"Vai": { code: "TN", name: "Tunisia" },
"vi": { code: "VN", name: "Vietnam" },
"vun": { code: "TZ", name: "Tanzania" },
"wae": { code: "CH", name: "Switzerland" },
"wo": { code: "SN", name: "Senegal" },
"xog": { code: "UG", name: "Uganda" },
"yav": { code: "CM", name: "Cameroon" },
"yi": { code: "01", name: "Unknown" }, // Placeholder for unspecified region
"yo": { code: "BJ", name: "Benin" },
"yue": { code: "CN", name: "China" },
"zgh": { code: "MA", name: "Morocco" },
"zh": { code: "CN", name: "China" },
"zu": { code: "ZA", name: "South Africa" },
};
//async function getCountryName(countryCode) {
//try {
//const response = await fetch(`https://restcountries.com/v3.1/alpha/${countryCode}`);
//if (!response.ok) throw new Error('Country not found');
//const data = await response.json();
//// Return the name in the native language
//return data[0].name.common;
//} catch (error) {
//console.error(error);
//return 'Unknown Country';
//}
//}
function getCountryNameFromLanguage(language) {
return languageToCountryMap[language] ? languageToCountryMap[language].name : null;
}
function getCountryCodeFromLanguage(language) {
return languageToCountryMap[language] ? languageToCountryMap[language].code : null;
}
function getCountryNameFromCountryCode(countryCode) {
//alert(`Country code: ${countryCode}`);
for (const language in languageToCountryMap) {
if (languageToCountryMap.hasOwnProperty(language)) {
if (languageToCountryMap[language].code === countryCode) {
return languageToCountryMap[language].name;
}
}
}
return null; // Return null if country code not found
}
function getFlagEmoji(locale) {
// Split the locale to get the language and country code
const parts = locale.split('-');
let countryCode;
// Handle single subtag (language only) or double subtag (language-country)
if (parts.length === 1) {
countryCode = getCountryCodeFromLanguage(parts[0]);
} else if (parts.length === 2) {
countryCode = parts[1].toLowerCase(); // Use the country code
}
// If country code is not found, set a fallback output
if (!countryCode) {
const fallback = `? ${locale.toUpperCase()}`; // Just a question mark and the full locale
return { flag: fallback, isUnknown: true, countryName: 'Unknown Country' };
}
// Convert the country code to a flag emoji
return {
flag: String.fromCodePoint(...[...countryCode.toUpperCase()].map(char => 0x1F1E6 + char.charCodeAt(0) - 'A'.charCodeAt(0))),
isUnknown: false,
countryCode: countryCode
};
}
function displayLocaleAndFlag() {
// Get the browser locale
const userLocale = navigator.language || navigator.userLanguage;
//alert(`User Locale: ${userLocale}`); // Alert the detected locale
const { flag, isUnknown, countryCode } = getFlagEmoji(userLocale);
//alert(`Country Code: ${countryCode}, Is Unknown: ${isUnknown}`); // Debug country code and unknown flag status
// Display the locale and the corresponding flag (or fallback)
//document.getElementById('locale').textContent = `Your Locale: ${userLocale}`;
if (isUnknown) {
const fallbackDiv = document.createElement('div');
fallbackDiv.className = 'fallback-box';
fallbackDiv.textContent = `? ${userLocale.toUpperCase()}`; // Show ? and locale code inside the box
document.getElementById('flag-container').appendChild(fallbackDiv);
// Tooltip for fallback
fallbackDiv.title = "Unknown Country"; // Tooltip for fallback
//alert('Fallback triggered: Unknown Country'); // Debug fallback
} else {
const countryName = getCountryNameFromCountryCode(countryCode.toUpperCase());
//alert(`Country Name from Country Code: ${countryName}`); // Alert the country name
const flagSpan = document.createElement('span');
flagSpan.textContent = flag; // Use flag emoji
flagSpan.title = countryName; // Tooltip for the flag in country language
document.getElementById('flag-container').appendChild(flagSpan);
//alert(`Flag Emoji: ${flag}`); // Debug flag emoji display
}
}
displayLocaleAndFlag();
});

View File

@@ -0,0 +1,28 @@
$(document).ready(function() {
function toggleUPSClasses() {
var selectedOption = $('#Nutmode_select').val();
$('.masterups').toggle(selectedOption === 'netserver' || selectedOption === 'standalone'); // Show/Hide masterups based on Net Server or Standalone
$('.slaveups').toggle(selectedOption === 'netclient'); // Show/Hide slaveups based on Net Client
// Enable/Disable inputs based on the selected option
$('.masterups input').prop('disabled', !(selectedOption === 'netserver' || selectedOption === 'standalone'));
$('.slaveups input').prop('disabled', selectedOption !== 'netclient');
}
function toggleGenerics() {
var upsModelValue = $('#UPS_Model_select').val().toLowerCase(); // Get the current value from UPS_Model
var isGenericUps = upsModelValue === 'genericups'; // Check if it's 'genericups'
// Show/Hide generics section and enable/disable inputs
$('.generics').toggle(isGenericUps);
$('.generics input').prop('disabled', !isGenericUps); // Enable/Disable inputs based on the value
}
// Event listener for the selections
$('#Nutmode_select').change(toggleUPSClasses);
$('#UPS_Model_select').change(toggleGenerics); // Listen for changes in the UPS_Model dropdown
// Set the initial state based on current selections
toggleGenerics();
toggleUPSClasses();
});

View File

@@ -0,0 +1,51 @@
/*
This should work on class sidebar-wrapper
*/
const SELECTOR_SIDEBAR_WRAPPER = '.sidebar-wrapper';
const Default = {
scrollbarTheme: 'os-theme-light',
scrollbarAutoHide: 'leave',
scrollbarClickScroll: true,
};
document.addEventListener('DOMContentLoaded', function () {
const sidebarWrapper = document.querySelector(SELECTOR_SIDEBAR_WRAPPER);
if (sidebarWrapper && typeof OverlayScrollbarsGlobal?.OverlayScrollbars !== 'undefined') {
OverlayScrollbarsGlobal.OverlayScrollbars(sidebarWrapper, {
scrollbars: {
theme: Default.scrollbarTheme,
autoHide: Default.scrollbarAutoHide,
clickScroll: Default.scrollbarClickScroll,
},
overflow: {
x: 'hidden',
y: 'scroll',
},
});
}
});
/* This should work with class=data-overlayscrollbars-initialize and id=scrolltarget */
/* https://kingsora.github.io/OverlayScrollbars/ */
/* const { OverlayScrollbars, ClickScrollPlugin } = OverlayScrollbarsGlobal;
// optional: use the ClickScrollPlugin to make the option "scrollbars.clickScroll: true" available
OverlayScrollbars.plugin(ClickScrollPlugin);
OverlayScrollbars(document.body, {
scrollbars: {
clickScroll: true,
},
overflow: {
x: 'hidden',
y: 'scroll',
},
});
OverlayScrollbars(document.getElementById('scrollTarget'), {});
*/

View File

@@ -0,0 +1,25 @@
document.addEventListener('DOMContentLoaded', function() {
const analysisType = document.getElementById('analysis_type');
const messageIdGroup = document.getElementById('message_id_group');
const emailAddressGroup = document.getElementById('email_address_group');
// Initially hide both controls
messageIdGroup.style.display = 'none';
emailAddressGroup.style.display = 'none';
analysisType.addEventListener('change', function() {
// Hide both controls first
messageIdGroup.style.display = 'none';
emailAddressGroup.style.display = 'none';
// Show the relevant control based on the selected option
switch(this.value) {
case 'trace_message':
messageIdGroup.style.display = 'block';
break;
case 'user_activity':
emailAddressGroup.style.display = 'block';
break;
}
});
});

View File

@@ -0,0 +1,33 @@
// js/sme-password.js
$(document).ready(function() {
/* // For each password input
$('.sme-password').each(function() {
// Create a new container
//alert("sme-password");
var $inputContainer = $('<div class="input-container"></div>');
// Move the input into the new container
$(this).wrap($inputContainer);
// Create the toggle image
var $togglePassword = $('<img src="images/visible.png" alt="Show Password" class="toggle-password" />');
// Append the toggle image to the container
$(this).after($togglePassword);
}); */
$('.toggle-password').on('click', function() {
// Find the associated password field
var input = $(this).siblings('.sme-password');
// Toggle the type attribute between password and text
var inputType = input.attr('type') === 'password' ? 'text' : 'password';
input.attr('type', inputType);
// Toggle the icon source based on the input type
// Check boostrap colours?
// var iconSrc = inputType === 'password' ? 'images/visible.png' : 'images/visible-slash.png';
// $(this).attr('src', iconSrc);
});
});

View File

@@ -14,7 +14,7 @@
% if ( stash 'error' ) {
<br><div class="">
%= $c->render_to_string(inline => stash 'error')
</div>
</div>
%}
<h1><%= $title%></h1>

View File

@@ -1,7 +1,9 @@
<!-- common_css.html.ep -->
%= stylesheet 'css/sme-jquery-overrides.css'
%= stylesheet 'dist/css/adminlte.min.css'
%= stylesheet 'koozali/css/adminlte.koozali.css'
%= stylesheet 'koozali/css/flag-icon.min.css'
%#= stylesheet 'css/sme-jquery-overrides.css'
%= stylesheet 'dist/css/adminlte.min.css'
%= stylesheet 'dist/icons/font/bootstrap-icons.min.css'
%#= stylesheet 'dist/css/overlayscrollbars.min.css'

View File

@@ -1,6 +1,9 @@
<!-- Include files across the whole site -->
%= javascript 'js/jquery.min.js'
<!-- common_js.html.ep -->
%= javascript 'dist/js/jquery.min.js'
%= javascript 'dist/js/bootstrap.min.js'
%= javascript 'dist/js/popper.min.js'
%= javascript 'dist/js/adminlte.min.js'
%= javascript '/js/flag-by-locale.js'
%= javascript '/js/sme-password.js'
%= javascript 'koozali/js/flag-by-locale.js'
%= javascript 'koozali/js/sme-password.js'

View File

@@ -1,39 +1,43 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- default +jquery -->
<!-- https://icons.getbootstrap.com/ -->
<!-- Nice mojo links -->
<!-- https://en.mojolicious.perlzemi.com/blog/20140414139745.html -->
<!-- https://en.mojolicious.perlzemi.com/blog/20110616130993.html -->
<head>
<title>
<%= $title %>
</title>
<link rel="made" href="mailto:bugs%40koozali.org">
<link rel="icon" type="image/x-icon" href="koozali/assets/img/favicon.ico">
<meta name="copyright" content="(head.tmpl)Copyright 2003-2004 Mitel Corporation">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
%= content_for 'head_contrib'
% if (config 'hasJquery') {
%= include 'partials/_js_imports'
%= include 'common_js'
% }
%= content_for 'refresh'
%= include 'common_js'
%= include 'common_css'
<!-- Custom overrides js/css? -->
<!-- This needs refining - do contribs add in their own stuff?? -->
<!-- This needs refining -->
% if (config 'hasJquery') {
%= include 'partials/_js_imports'
<!-- Custom overrides? -->
% if ($c->current_route eq 'nutups') {
%= include 'partials/_nutups_overrides'
% }
% }
% if ($c->current_route eq 'nutups') {
%= include 'partials/_nutups_overrides'
% }
</head>
<body class="sidebar-expand-lg bg-body-tertiary">
<body class="sidebar-expand-lg bg-body-tertiary app-loaded">
<!-- This is set from the data at the top of the _partials -->
@@ -110,7 +114,7 @@
<!--end::Sidebar Brand-->
<!--begin::Sidebar Wrapper-->
<div class="sidebar-wrapper">
<div class="sidebar-wrapper navbar-nav-scroll">
<nav class="mt-2">
<!--begin::Sidebar Menu-->
<ul class="nav sidebar-menu flex-column" data-lte-toggle="treeview" role="menu" data-accordion="false">
@@ -157,7 +161,7 @@
<!--end::Rows-->
<br>
<!-- <br> -->
<!-- This is the main page content depening on the calling module -->
<!-- nameofpanel.html.ep -->
@@ -167,6 +171,7 @@
%= include 'partials/_panel_card_top'
%= include 'partials/_panel_card_header'
% }
%= content 'module'
% if ($c->current_route ne 'login') {

View File

@@ -77,7 +77,7 @@
<!-- /.col -->
<div class="col-4">
<div class="d-grid gap-2">
<button type="submit" class="btn btn-primary">Sign In</button>
<button type="submit" class="btn btn-primary">Login</button>
</div>
</div>
<!-- /.col -->

View File

@@ -1,7 +1,6 @@
<div>
<!--<HR class="">-->
<a href="https://mojolicious.org" target="_blank"><img src="images/sme-mojo-logo-white.png" style="position:relative;"></a>
<font>
% if ( $c->is_logged_in && $c->is_admin) {
SME Server <%= session 'releaseVersion' %>-<%= $c->app->VERSION %> Manager II
% my $mode;
@@ -10,5 +9,4 @@
% }
<br>Copyright 1999-2006 Mitel Corporation<br>
%= session 'copyRight'
<br>Copyright (c) 2013-2024 Koozali Foundation Inc.<br>
</font>
<br>Copyright (c) 2013-2024 Koozali Foundation Inc.<br>

View File

@@ -1,62 +1,79 @@
<div>
<div class="container-sm">
<br>
<!-- <h2><%#= l 'grp_FORM_TITLE' %></h2> -->
% my $btn = l('ADD');
%= form_for '/groups2' => (method => 'POST') => begin
<p><h2>
%=l 'CREATE_GROUP'
</h2>
<br><br>
%=l 'grp_GROUP_NAMING'
</p>
<p>
<span class="">
%=l 'GROUP_NAME', class => ""
</span>
<span class="">
%= text_field 'groupName', class => ""
</span>
</p>
<p>
%=l 'grp_GROUP_DESC_EXPL'
<br><br>
<span class="">
%=l 'grp_GROUP_DESC', class => ""
</span>
<span class="">
%= text_field 'groupDesc', class => ""
</span>
</p>
<p>
<span class="">
%=l 'GROUP_MEMBERS', class => ""
</span>
<h2><%= l 'CREATE_GROUP' %></h2>
<br>
<span class="">
%= check_box 'groupMembers' => 'admin'
Administrator (admin)
<%= l 'grp_GROUP_NAMING' %>
<br><br>
% my $btn = l('ADD');
<form action="/smanager/groups2" method="POST">
<div class="row g-3 align-items-center">
<div class="col-md-2">
<label for="inputGroupName" class="col-form-label"><%= l 'GROUP_NAME' %></label>
</div>
<div class="col-auto">
<input type="text" name="groupName" id="inputGroupName" class="form-control" aria-describedby="GroupName" >
</div>
<div class="col-auto">
<span id="passwordHelpInline" class="form-text">
Group
</span>
</div>
</div>
<br><br>
<%= l 'grp_GROUP_DESC_EXPL' %>
<br><br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<label for="inputGroupDesc" class="col-form-label"><%= l 'grp_GROUP_DESC' %></label>
</div>
<div class="col-auto">
<input type="text" name="groupDesc" id="inputGroupDesc" class="form-control" aria-describedby="GroupDesc" >
</div>
<div class="col-auto">
<span id="passwordHelpInline" class="form-text">
Group Alias
</span>
</div>
</div>
<br>
<div>
<%= l 'GROUP_MEMBERS' %>
</div>
<br>
% my $users = $c->gen_users_list();
% foreach my $key ( sort keys %$users )
% {
%= check_box 'groupMembers' => $key
%=$users->{$key}
%= "(" . $key . ")"
<div>
%= check_box 'groupMembers' => 'admin'
&nbspAdministrator (admin)
<br>
% my $users = $c->gen_users_list();
% foreach my $key ( sort keys %$users ) {
%= check_box 'groupMembers' => $key
&nbsp
%= $users->{$key}
%= " (" . $key . ")"
<br>
% }
</span>
</p>
<p>
% }
</div>
<br><br>
%= submit_button "$btn", class => ""
</p>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<button type="submit" class="btn btn-primary"><%= $btn %></button>
</div>
</div>
%= hidden_field 'trt' => $grp_datas->{trt}
% end
</div>

View File

@@ -1,63 +1,71 @@
<div>
<div class="container-sm">
% my $btn = l('REMOVE');
%= form_for '/groups2' => (method => 'POST') => begin
<p><h2>
%=l 'REMOVE_USER_GROUP'
</h2>
% my $btn = l('REMOVE');
<p>
%=l('grp_DELETE_DESCRIPTION', $grp_datas->{group})
</p>
<form action="/smanager/groups2" method="POST">
<br><br>
<h2><%=l 'REMOVE_USER_GROUP' %></h2>
<br>
<%=l('grp_DELETE_DESCRIPTION', $grp_datas->{group}) %>
<br><br>
<div>
% my $size = keys %$members;
% if ( ! $size ){
%= l 'ACCOUNT_GROUP_NONE'
% } else {
%= l 'grp_GROUP_HAS_MEMBERS'
<br><br>
<p>
% my $size = keys %$members;
% if ( ! $size ){
%=l 'ACCOUNT_GROUP_NONE'
% } else {
%=l 'grp_GROUP_HAS_MEMBERS'
<br>
<ul>
% foreach my $key ( keys %$members)
% {
<li>
%=$key
(
%=$members->{$key}
)
</li>
% }
</ul>
% }
</p>
% foreach my $key ( keys %$members) {
<li>
%=$key
( <%=$members->{$key} %> )
</li>
% }
</ul>
% }
<p>
% $size = keys %$ibays;
% if ( $size ) {
%=l 'grp_IBAYS_WILL_BE_CHANGED'
</div>
<br><br>
<div>
% $size = keys %$ibays;
% if ( $size ) {
%=l 'grp_IBAYS_WILL_BE_CHANGED'
<br>
<ul>
% foreach my $key (sort ( keys %$ibays ))
% {
<li>
%=$key
(
%=$ibays->{$key}
)
</li>
% }
</ul>
% }
</p>
% foreach my $key (sort ( keys %$ibays )) {
<li>
%=$key
(
%=$ibays->{$key}
)
</li>
% }
</ul>
% }
</div>
<p>
<br>
%= submit_button "$btn", class => ""
</p>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<button type="submit" class="btn btn-primary"><%= $btn %></button>
</div>
</div>
%= hidden_field 'trt' => $grp_datas->{trt}
%= hidden_field 'groupName' => $grp_datas->{group}
%= hidden_field 'trt' => $grp_datas->{trt}
%= hidden_field 'groupName' => $grp_datas->{group}
% end
</div>

View File

@@ -4,32 +4,34 @@
%= form_for '/groups' => (method => 'POST') => begin
%= hidden_field 'trt' => 'ADD'
%= hidden_field 'trt' => 'ADD'
<p> <br>
%= submit_button "$btn", class => ""
</p>
<br>
<div>
<button type="submit" class="btn btn-primary"><%= $btn %> </button>
</div>
% end
<p> <h2>
%=l 'grp_CURRENT_LIST'
</h2><br><br>
<br>
<h2><%=l 'grp_CURRENT_LIST' %></h2>
<br><br>
% my $numGroups = @$groups;
% if ($numGroups == 0){
%=l 'ACCOUNT_GROUP_NONE'
% } else {
<table class="table table-bordered">
<table class="table table-bordered user-table-max-wdith">
<thead>
<tr>
<th class="">
%=l 'GROUP'
<th class="col-sm">
%=l 'GROUP'
</th>
<th class="">
%=l 'DESCRIPTION'
<th class="col-sm">
%=l 'DESCRIPTION'
</th>
<th class="">
%=l 'ACTION'
<th class="user-valign-center col-sm" colspan="2">
%=l 'ACTION'
</th>
</tr>
</thead>
@@ -38,37 +40,38 @@
% foreach my $group ( @$groups )
% {
<tr>
%= t td => (class => "") => $group->key
%= t td => (class => "") => $group->prop('Description')
<td class="" style="min-width:15em">
<td><%= $group->key %></td>
<td><%= $group->prop('Description') %></td>
%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{
% <a href="groups2?CsrfDef=$csrf_token&trt=UPD&group=$group_name">
% <button type='button' class="" title='$modify_text' >
% $modify_text
% </button>
% </a>
%<a href="groups2?CsrfDef=$csrf_token&trt=UPD&group=$group_name">
% <button type='button' class="btn btn-primary" title='$modify_text' >
% $modify_text
% </button>
%</a>
%};
%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{
% <a href="groups2?CsrfDef=$csrf_token&trt=DEL&group=$group_name">
% <button type='button' class="" title='$remove_text' >
%<a href="groups2?CsrfDef=$csrf_token&trt=DEL&group=$group_name">
% <button type='button' class="btn btn-primary" title='$remove_text' >
% $remove_text
% </button>
% </a>
%</a>
%};
<%= $c->render_to_string(inline => $actionModify) %> <%= $c->render_to_string(inline => $actionRemove) %>
</td>
<td class="user-valign-center"><%= $c->render_to_string(inline => $actionModify) %></td>
<td class="user-valign-center"><%= $c->render_to_string(inline => $actionRemove) %></td>
</tr>
% }
</tbody>
</table>
<%} %>
</p>
</div>

View File

@@ -1,71 +1,90 @@
<div>
% my $btn = l('SAVE');
% my $btn = l('SAVE');
%= form_for '/groups2' => (method => 'POST') => begin
<p><h2>
%=l 'MODIFY_USER_GROUP'
</h2><br></p>
<p>
<span class="">
%=l 'GROUP_NAME', class => ""
</span>
<span class="">
%= $grp_datas->{group}, class => ""
</span>
</p>
<p>
%=l 'grp_GROUP_DESC_EXPL'
<form action="/smanager/groups2" method="POST">
<br><br>
<span class="">
%=l 'grp_GROUP_DESC', class => ""
</span>
<span class="">
% param 'groupDesc' => $grp_datas->{description} unless param 'groupDesc';
%= text_field 'groupDesc', class => ""
</span>
</p>
<h2><%= l 'MODIFY_USER_GROUP' %></h2>
<br><br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<label for="inputLastNAme" class="col-form-label"><%= l 'GROUP_NAME' %></label>
</div>
<div class="col-auto">
<input disabled type="text" id="disabledTextInput" class="form-control" placeholder="<%= $grp_datas->{group} %>">
</div>
</div>
<br><br>
<%=l 'grp_GROUP_DESC_EXPL'%>
<br><br>
% param 'groupDesc' => $grp_datas->{description} unless param 'groupDesc';
<div class="row g-3 align-items-center">
<div class="col-md-2">
<label for="inputGroupDesc" class="col-form-label"><%= l 'grp_GROUP_DESC' %></label>
</div>
<div class="col-auto">
<input type="text" name="groupDesc" id="inputGroupDesc" class="form-control" aria-describedby="GroupDesc" value="<%= $grp_datas->{description} %>">
</div>
<div class="col-auto">
<span id="passwordHelpInline" class="form-text">
Group Alias
</span>
</div>
</div>
<br><br>
<div>
<%=l 'GROUP_MEMBERS' %>
</div>
<p>
<span class="">
%=l 'GROUP_MEMBERS', class => ""
</span>
<br>
<span class="">
<div>
% if ( $members->{'admin'} ) {
%= check_box 'groupMembers', value => 'admin', checked => undef
%} else {
% } else {
%= check_box 'groupMembers' => 'admin'
%}
Administrator (admin)
% }
&nbspAdministrator (admin)
</div>
<br>
% my $users = $c->gen_users_list();
% foreach my $key ( sort keys %$users )
% {
% my $users = $c->gen_users_list();
% foreach my $key ( sort keys %$users ) {
% if ( $members->{ $key } ) {
<!-- % = check_box 'groupMembers', value => $key, checked => 'checked' -->
<input type='checkbox' name='groupMembers' checked value='<%= $key %>'>
%} else {
%= check_box 'groupMembers' => $key
%}
%=$users->{$key} . " (" . $key . ")"
<br>
% }
</span>
</p>
<input type='checkbox' name='groupMembers' checked value='<%= $key %>'>
% } else {
%= check_box 'groupMembers' => $key
&nbsp
% }
%= $users->{$key}
%= " (" . $key . ")"
<br>
% }
<p>
<br><br>
%= submit_button "$btn", class => ""
</p>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<button type="submit" class="btn btn-primary"><%= $btn %></button>
</div>
</div>
%= hidden_field 'trt' => $grp_datas->{trt}
%= hidden_field 'groupName' => $grp_datas->{group}
%= hidden_field 'groupName' => $grp_datas->{group}
% end
</div>

View File

@@ -25,11 +25,11 @@
% foreach (sort { $a->{'WEIGHT'} <=> $b->{'WEIGHT'} } @{$nav{$h}{'DESCRIPTIONS'}}) {
% next if ($_->{'MENUCAT'} ne 'U' ); # menu User
% if ( $_->{'FILENAME'} =~ m/^2\// ) {
% $target = '_self';
% $target = '_self';
% (my $file2 = $_->{'FILENAME'}) =~ s|^2/||;
% $href = '/smanager/' . $file2;
% } else {
% $target = 'main';
% $target = 'main';
% $href = '/server-manager' . $_->{'FILENAME'};
% }

View File

@@ -1,40 +1,34 @@
<!-- Both Theme drop downs but only the first works curently -->
<div id="">
% my $btn = l('swt_THEME');
%= form_for $c->url_for('swttheme') => (method => 'POST') => begin
% my $value = $c->session->{'CurrentTheme'};
% $value = session 'CurrentTheme';
<div>
%# content_for 'module' => begin
% param 'Theme' => $value unless param 'Theme';
%= select_field 'Theme' => $c->theme_list(), class => ""
%= hidden_field 'From' => $c->tx->req->url
%= submit_button "$btn"
</div>
%# my $value = $c->session->{'CurrentTheme'};
% my $value = $c->session->{'CurrentTheme'};
% $value = session 'CurrentTheme';
% my $formUrl = $c->url_for('swttheme');
% param 'Theme' => $value unless param 'Theme';
% my @themes = $c->theme_list();
%# my @themes = $c->theme_list();
%#= dumper $c
%#= my $size = keys ($c->theme_list)
% my @themeList = $c->theme_list();
%# = dumper @themeList
% my @themes = $themeList[0];
% param 'Theme' => $value unless param 'Theme';
<form action="<%= $formUrl %>" method="POST" >
<div class="row g-3 align-items-center">
<div class="col-auto">
<label class="visually-hidden" for="inlineFormSelectPref">Preference</label>
<select class="form-select" id="inlineFormSelectPref">
<option selected><%= $value %></option>
% foreach my $theme (@themes) {
<option value="<%= $theme %>"><%= $theme %></option>
% };
</select>
%= select_field 'Theme' => $c->theme_list(), class => "form-select"
%= hidden_field 'From' => $c->tx->req->url
</div>
@@ -45,4 +39,7 @@
</form>
% end
%# end
</div>

View File

@@ -1,23 +1,47 @@
<div id="">
<div>
% my $btn = l('REMOVE');
% my $btn = l('REMOVE');
%= form_for '/useraccountsd' => (method => 'POST') => begin
<p>
<h2>
%=l 'usr_REMOVE_ACCOUNT_TITLE'
</h2>
<div>
<h2><%= l 'usr_REMOVE_ACCOUNT_TITLE' %></h2>
</div>
<br>
<div>
Needs a text change in the Lex files
<br>
%= $c->l('usr_REMOVE_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('usr_REMOVE_DESC2'))
</p>
<p>
<br>
%= submit_button "$btn", class => ""
</p>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<button type="submit" class="btn btn-primary"><%= $btn %></button>
</div>
</div>
%= hidden_field 'trt' => $usr_datas->{trt}
%= hidden_field 'user' => $usr_datas->{user}

View File

@@ -5,155 +5,165 @@
%= form_for '/useraccounts' => (method => 'POST') => begin
<p>
<br>
%= submit_button "$btn", class => ""
</p>
<br>
<div>
<button type="submit" class="btn btn-primary"><%= $btn %> </button>
</div>
% end
<p>
<br>
%= $c->render_to_string(inline => $c->l('usr_FIRSTPAGE_DESC'))
<br>
</p>
%#= 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>
%=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');
<tr>
%= t td => (class => "") => $username
%= t td => (class => "") => "$first $last"
%= t td => (class => "") => $vpnaccess
%= t td => (class => "") => $fwd
% 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 ($useraccounts_user_name eq 'admin') {
%$actionModify = qq{
%<a href="useraccountsd?CsrfDef=$csrf_token&trt=UPS&user=$useraccounts_user_name">
% <button type='button' class="" 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="" 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="" title='$modify_text' >
% $modify_text
% </button>
%</a>
%};
%}
%if ($password_set ne 'yes') {
%$actionLock = l('ACCOUNT_LOCKED');
%$actionResetPw = qq{
%<a href="useraccountsd?CsrfDef=$csrf_token&trt=PWD&user=$useraccounts_user_name">
% <button type='button' class="" title="$password_text - currently unset" style = background:pink; >
% $password_text
% </button>
%</a>
%};
%} elsif ($useraccounts_user_name ne 'admin') {
% 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{
%<a href="useraccountsd?CsrfDef=$csrf_token&trt=LCK&user=$useraccounts_user_name">
% <button type='button' class="" 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="" title='$password_text' >
% $password_text
% </button>
%</a>
%};
%}
%if ( $removable eq 'yes' ) {
% my $remove_text = l('REMOVE'); # Localized text
% my $csrf_token = "TOKEN"; # CSRF token for security
%$actionRemove = qq{
%<a href="useraccountsd?CsrfDef=$csrf_token&trt=DEL&user=$useraccounts_user_name">
% <button type='button' class="" title='$remove_text' >
% $remove_text
% </button>
%</a>
%};
%}
% my $thisdomain = $c->req->url->to_abs->host;
% my $roundcube_text = l('Webmail'); # Localized text
% $csrf_token = "TOKEN"; # CSRF token for security
% $useraccounts_user_name = $user->key; # useraccountss_entry name extracted from the data structure
% $actionroundcube = qq{
%<a href="roundcubepanel?CsrfDef=$csrf_token&url=https://$thisdomain/roundcube?_user=$useraccounts_user_name&height=600px">
% <button type='button' class="" title='$roundcube_text' >
% $roundcube_text
% </button>
%</a>
%};
<td class="">
<%= $c->render_to_string(inline => $actionModify) %>
<%= $c->render_to_string(inline => $actionResetPw) %>
<%= $c->render_to_string(inline => $actionLock) %>
<%= $c->render_to_string(inline => $actionRemove) %>
<%= $c->render_to_string(inline => $actionroundcube) %>
</td>
<th>
%=l 'ACCOUNT'
</th>
<th>
%=l 'USER_NAME'
</th>
<th>
%=l 'usr_VPN_CLIENT_ACCESS'
</th>
<th>
%=l 'usr_FORWARDING_ADDRESS'
</th>
<th class="user-valign-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');
<tr>
<td><%= $username %></td>
<td><%=$first %>&nbsp<%=$last %></td>
<td><%= $vpnaccess %></td>
<td><%= $fwd %></td>
% 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 ($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" 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" 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" title='$modify_text' >
% $modify_text
% </button>
%</a>
%};
% }
% if ($password_set ne 'yes') {
%$actionLock = l('ACCOUNT_LOCKED');
%$actionResetPw = qq{
%<a href="useraccountsd?CsrfDef=$csrf_token&trt=PWD&user=$useraccounts_user_name">
% <button type='button' class="btn btn-primary" title="$password_text - currently unset" style = background:pink; >
% $password_text
% </button>
%</a>
%};
% } 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{
%<a href="useraccountsd?CsrfDef=$csrf_token&trt=LCK&user=$useraccounts_user_name">
% <button type='button' class="btn btn-primary" 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" title='$password_text' >
% $password_text
% </button>
%</a>
%};
% }
% if ( $removable eq 'yes' ) {
% my $remove_text = l('REMOVE'); # Localized text
% my $csrf_token = "TOKEN"; # CSRF token for security
%$actionRemove = qq{
%<a href="useraccountsd?CsrfDef=$csrf_token&trt=DEL&user=$useraccounts_user_name">
% <button type='button' class="btn btn-primary" title='$remove_text' >
% $remove_text
% </button>
%</a>
%};
% }
% my $thisdomain = $c->req->url->to_abs->host;
% my $roundcube_text = l('Webmail'); # Localized text
% $csrf_token = "TOKEN"; # CSRF token for security
% $useraccounts_user_name = $user->key; # useraccountss_entry name extracted from the data structure
% $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" title='$roundcube_text' >
% $roundcube_text
% </button>
%</a>
%};
<td class="user-valign-center"><%= $c->render_to_string(inline => $actionModify) %></td>
<td class="user-valign-center"><%= $c->render_to_string(inline => $actionResetPw) %></td>
<td class="user-valign-center"><%= $c->render_to_string(inline => $actionLock) %></td>
<td class="user-valign-center"><%= $c->render_to_string(inline => $actionRemove) %></td>
<td class="user-valign-center"><%= $c->render_to_string(inline => $actionroundcube) %></td>
</tr>
% }
</tbody>
</table>
</div>
<%} %>
%= hidden_field 'trt' => $usr_datas->{trt}
</div>

View File

@@ -3,21 +3,46 @@
% my $btn = l('usr_LOCK');
%= form_for '/useraccountsd' => (method => 'POST') => begin
<p>
<h2>
%=l 'usr_LOCK_ACCOUNT_TITLE'
</h2>
<div>
<h2><%= l 'usr_LOCK_ACCOUNT_TITLE' %></h2>
</div>
<br>
%= $c->l('usr_LOCK_DESC', $usr_datas->{user}, $usr_datas->{name} );
<div>
Needs a text change in the Lex files
<br>
<%= $c->l('usr_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('usr_LOCK_DESC2'))
</p>
<p>
<br>
%= submit_button "$btn", class => ""
</p>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<button type="submit" class="btn btn-primary"><%= $btn %></button>
</div>
</div>
%= hidden_field 'trt' => $usr_datas->{trt}
%= hidden_field 'user' => $usr_datas->{user}

View File

@@ -1,40 +1,81 @@
<div>
% my $btn = l('SAVE');
% my $btn = l('SAVE');
%= form_for '/useraccountsd' => (method => 'POST') => begin
<p>
<h2>
%=l 'RESET_PASSWORD_TITLE'
</h2>
<div>
<h2><%= l 'RESET_PASSWORD_TITLE' %></h2>
</div>
<br>
<div>
%= $c->l('usr_RESET_DESC', $usr_datas->{user}, $usr_datas->{name} );
</div>
<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->l('usr_RESET_DESC', $usr_datas->{user}, $usr_datas->{name} );
<div>
<%= l 'usr_RESET_DESC2' %>
</div>
<br>
%= l 'usr_RESET_DESC2'
</p>
<div>
<%= l 'PASSWORD_NEW' %>
</div>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<input name="newPass" id="newPass" type="password" class="form-control sme-password" placeholder="Password">
</div>
</div>
<p>
<span class="">
%=l 'PASSWORD_NEW', class => ""
</span><span class="">
%= password_field 'newPass', class => "", class=> 'sme-password'
</span>
</p>
<br>
<div>
<%= l 'PASSWORD_VERIFY_NEW' %>
</div>
<p>
<span class="">
%=l 'PASSWORD_VERIFY_NEW', class => ""
</span>
<span class="">
%= password_field 'newPassVerify', class => "", class=> 'sme-password'
</span>
</p>
<br>
<p>
<br><br>
%= submit_button "$btn", class => ""
</p>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<input name="newPassVerify" id="newPassVerify" type="password" class="form-control sme-password" placeholder="Password">
</div>
</div>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<button type="submit" class="btn btn-primary"><%= $btn %></button>
</div>
</div>
%= hidden_field 'trt' => $usr_datas->{trt}
%= hidden_field 'user' => $usr_datas->{user}

View File

@@ -3,41 +3,70 @@
% my $btn = l('SAVE');
%= form_for '/useraccountsd' => (method => 'POST') => begin
<p>
%= l 'usr_SYSTEM_PASSWORD_DESCRIPTION'
</p>
<p>
<span class="">
%=l 'usr_CURRENT_SYSTEM_PASSWORD', class => ""
</span>
<span class="">
%= password_field 'CurPass', class => "", class=> 'sme-password'
</span>
</p>
<div>
<h2><%= l 'PASSWORD_RESET' %></h2>
</div>
<br>
<p>
<span class="">
%=l 'usr_NEW_SYSTEM_PASSWORD', class => ""
</span>
<span class="">
%= password_field 'Pass', class => "", class=> 'sme-password'
</span>
</p>
<div>
<%= l 'usr_SYSTEM_PASSWORD_DESCRIPTION' %>
</div>
<p>
<span class="">
%=l 'usr_NEW_SYSTEM_PASSWORD_VERIFY', class => ""
</span>
<span class="">
%= password_field 'PassVerify', class => "", class=> 'sme-password'
</span>
</p>
<br>
<p>
<br><br>
%= submit_button "$btn", class => ""
</p>
<div>
<%=l 'usr_CURRENT_SYSTEM_PASSWORD' %>
</div>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<input name="CurPass" id="Pass" type="password" class="form-control sme-password" placeholder="Current Password">
</div>
</div>
<br>
<div>
<%= l 'usr_NEW_SYSTEM_PASSWORD' %>
</div>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<input name="Pass" id="Pass" type="password" class="form-control sme-password" placeholder="New Password">
</div>
</div>
<br>
<div>
<%= l 'usr_NEW_SYSTEM_PASSWORD_VERIFY' %>
</div>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<input name="PassVerify" id="PassVerify" type="password" class="form-control sme-password" placeholder="New Password verify">
</div>
</div>
<br>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<button type="submit" class="btn btn-primary"><%= $btn %></button>
</div>
</div>
%= hidden_field 'trt' => $usr_datas->{trt}
%= hidden_field 'user' => $usr_datas->{user}

View File

@@ -1,199 +1,298 @@
<div>
% my $btn = l('ADD');
%= form_for '/useraccountsd' => (method => 'POST') => begin
<p>
<h2>
%=l 'usr_P2_TITLE'
</h2>
<div class="container-sm">
<br>
%= $c->render_to_string(inline => l ('usr_CREATE_MODIFY_DESC'))
</p>
<p>
<span class="">
%=l 'usr_ACCOUNT_NAME'
</span>
<span class="">
% if ( $usr_datas->{trt} eq 'ADD' ) {
% param 'user' => $usr_datas->{user} unless param 'user';
%= text_field 'user', class => ""
% } else {
% $btn = l('SAVE');
%= $usr_datas->{user}, class => ""
% }
</span>
</p>
<p>
<span class="">
%=l 'usr_FIRSTNAME'
</span>
<span class="">
% param 'FirstName' => $usr_datas->{firstname} unless param 'FirstName';
%= text_field 'FirstName', class => ""
</span>
</p>
<p>
<span class="">
%=l 'usr_LASTNAME'
</span>
<span class="">
% param 'LastName' => $usr_datas->{lastname} unless param 'LastName';
%= text_field 'LastName', class => ""
</span>
</p>
<p>
<span class="">
%=l 'usr_DEPARTMENT'
</span><span class="">
% param 'Dept' => $usr_datas->{dept} unless param 'Dept';
%= text_field 'Dept', class => ""
</span>
</p>
<p>
<span class="">
%=l 'usr_COMPANY'
</span>
<span class="">
% param 'Company' => $usr_datas->{company} unless param 'Company';
%= text_field 'Company', class => ""
</span>
</p>
<p>
<span class="">
%=l 'usr_STREET_ADDRESS'
</span>
<span class="">
% param 'Street' => $usr_datas->{street} unless param 'Street';
%= text_field 'Street', class => ""
</span>
</p>
<p>
<span class="">
%=l 'usr_CITY'
</span>
<span class="">
% param 'City' => $usr_datas->{city} unless param 'City';
%= text_field 'City', class => ""
</span>
</p>
<p>
<span class="">
%=l 'usr_PHONE_NUMBER'
</span>
<span class="">
% param 'Phone' => $usr_datas->{phone} unless param 'Phone';
%= text_field 'Phone', class => ""
</span>
</p>
<p>
<span class="">
%=l 'usr_EMAIL_DELIVERY'
</span>
<span class="">
% param 'EmailForward' => $usr_datas->{emailforward} unless param 'EmailForward';
%= select_field 'EmailForward' => $c->emailForward_list(), class => ""
</span>
</p>
<p>
<span class="">
%=l 'usr_FORWARDING_ADDRESS'
</span>
<span class="">
% param 'ForwardAddress' => $usr_datas->{forwardaddress} unless param 'ForwardAddress';
%= text_field 'ForwardAddress', class => ""
</span>
</p>
<p>
<span class="">
%=l 'usr_VPN_CLIENT_ACCESS'
</span>
<span class="">
% param 'VPNClientAccess' => $usr_datas->{vpnclientaccess} unless param 'VPNClientAccess';
%= select_field 'VPNClientAccess' => [[ (l 'NO') => 'no'], [ (l 'YES') => 'yes']], class => ""
</span>
</p>
% if ( $usr_datas->{trt} eq 'UPD' and $c->ipsec_for_acct eq 'OK' ) {
% my $btn2 = $c->l('DOWNLOAD');
%= form_for '/useraccountso' => (method => 'POST') => begin
<p>
<span class="">
%=l 'usr_LABEL_IPSECRW_DOWNLOAD'
</span>
<span class="">
%= submit_button $btn2, class => ""
</span>
</p>
%= hidden_field 'trt' => 'CRT'
%= hidden_field 'user' => $usr_datas->{user}
%end
% }
% my @groups = @{$c->get_groups()};
% if ( @groups ) {
<p>
<span class="">
%=l 'usr_GROUP_MEMBERSHIPS'
</span>
<span class="">
<table class="table table-bordered">
<thead>
<tr>
<th class="">
%=l 'usr_MEMBER'
</th><th class="">
%=l 'GROUP'
</th><th class="">
%=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' ) {
<!-- % = check_box 'groupMemberships', value => $groupname, checked => $checked -->
<input type='checkbox' name='groupMemberships' checked value='<%= $groupname %>'>
%} else {
%= check_box 'groupMemberships' => $groupname
%}
</td>
<!-- t td => (class => "") => (check_box ' groupMemberships' => $groupname $checked) -->
%= t td => (class => "") => $groupname
%= t td => (class => "") => "$description"
</tr>
% }
</tbody>
</table>
</span>
</p>
% }
<p>
<h2><%= l 'usr_P2_TITLE' %></h2>
<br>
<%= $c->render_to_string(inline => l ('usr_CREATE_MODIFY_DESC')) %>
<br><br>
%= submit_button $btn, class => ""
</p>
%= hidden_field 'trt' => $usr_datas->{trt}
% if ( $usr_datas->{trt} eq 'UPD' ) {
%= hidden_field 'user' => $usr_datas->{user}
% }
% end
% 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 'usr_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 'usr_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 'usr_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 %></button>
</div>
</div>
%= hidden_field 'trt' => $usr_datas->{trt}
% if ( $usr_datas->{trt} eq 'UPD' ) {
%= hidden_field 'user' => $usr_datas->{user}
% }
</form>
</div>
<!-- End of containers-sm -->

View File

@@ -1,96 +1,116 @@
<div>
% content_for 'module' => begin
% my $btn = l('SAVE');
%= form_for '/useraccountsd' => (method => 'POST') => begin
<p>
<h2>
%=l 'usr_MODIFY_ADMIN_TITLE'
</h2><br>
</p>
<p>
<span class="">
%=l 'usr_ACCOUNT_NAME'
</span>
<span class="">
% $btn = l('SAVE');
%= $usr_datas->{user}, class => ""
</span>
</p>
<p>
<span class="">
%=l 'usr_FIRSTNAME'
</span>
<span class="">
% param 'FirstName' => $usr_datas->{firstname} unless param 'FirstName';
%= text_field 'FirstName', class => ""
</span>
</p>
<p>
<span class="">
%=l 'usr_LASTNAME'
</span>
<span class="">
% param 'LastName' => $usr_datas->{lastname} unless param 'LastName';
%= text_field 'LastName', class => ""
</span>
</p>
<p>
<span class="">
%=l 'usr_EMAIL_DELIVERY'
</span>
<span class="">
% param 'EmailForward' => $usr_datas->{emailforward} unless param 'EmailForward';
%= select_field 'EmailForward' => $c->emailForward_list(), class => ""
</span>
</p>
<p>
<span class="">
%=l 'usr_FORWARDING_ADDRESS'
</span>
<span class="">
% param 'ForwardAddress' => $usr_datas->{forwardaddress} unless param 'ForwardAddress';
%= text_field 'ForwardAddress', class => ""
</span>
</p>
<p>
<span class="">
%=l 'usr_VPN_CLIENT_ACCESS'
</span>
<span class="">
% param 'VPNClientAccess' => $usr_datas->{vpnclientaccess} unless param 'VPNClientAccess';
%= select_field 'VPNClientAccess' => [[ (l 'NO') => 'no'], [ (l 'YES') => 'yes']], class => ""
</span>
</p>
% if ( $c->ipsec_for_acct eq 'OK' ) {
% my $btn2 = $c->l('DOWNLOAD');
%= form_for '/useraccountso' => (method => 'POST') => begin
<p>
<span class="">
%=l 'usr_LABEL_IPSECRW_DOWNLOAD'
</span>
<span class="">
%= submit_button $btn2, class => ""
</span>
</p>
%= hidden_field 'trt' => 'CRT'
%= hidden_field 'user' => $usr_datas->{user}
%end
% }
<p>
<div class="container-sm">
<br>
%= submit_button $btn, class => ""
</p>
%= hidden_field 'trt' => $usr_datas->{trt}
%= hidden_field 'user' => $usr_datas->{user}
<h2><%= l 'usr_MODIFY_ADMIN_TITLE' %></h2>
<br><br>
<form action="/smanager/useraccountsd" method="POST">
%#= form_for '/useraccountsd' => (method => 'POST') => begin
% end
<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>
% param 'FirstName' => $usr_datas->{firstname} unless param 'FirstName';
<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 '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="ForwardAddress" 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>
<br>
</div>
% my $btn = l('SAVE');
<div class="row g-3 align-items-center">
<div class="col-md-2">
<button type="submit" class="btn btn-primary"><%= l 'SAVE' %></button>
</div>
</div>
trt: <%= dumper $usr_datas->{trt} %>
user: <%= dumper $usr_datas->{user} %>
%= hidden_field 'trt' => $usr_datas->{trt}
%= hidden_field 'user' => $usr_datas->{user}
% end
</form>
</div>

View File

@@ -3,9 +3,6 @@
% content_for 'module' => begin
%#= include 'partials/_panel_card_top'
%#= include 'partials/_panel_card_header'
<div class="card-body">
<h1> <%= $title %> </h1>
@@ -25,7 +22,5 @@
</div>
%#= include 'partials/_panel_card_footer'
%#= include 'partials/_panel_card_bottom'
% end

View File

@@ -15,9 +15,9 @@
%= dumper $usr_datas
</p>
% }
<h1><%= $title%></h1>
% if ( $notif ) {
<br>
<span class="">

View File

@@ -11,80 +11,111 @@
</p>
% }
<h1>
%= l 'pwd_ACCOUNT_PASSWORD_CHANGE'
</h1>
<h2><%= l 'pwd_ACCOUNT_PASSWORD_CHANGE' %></h2>
% if ( stash 'error' ) {
<br>
<div class="">
%= $c->render_to_string(inline => stash 'error')
<div>
%= $c->render_to_string(inline => stash 'error')
</div>
%}
<p>
% my $btn = l('pwd_PASSWORD_CHANGE');
% my $url = '/userpassword';
%= $c->render_to_string( inline => l('pwd_DESCRIPTION'));
<div>
%= $c->render_to_string( inline => l('pwd_DESCRIPTION'));
</div>
% if ( $pwd_datas->{trt} eq 'RESET' ) {
% $btn = l('pwd_PASSWORD_RESET');
% $url = '/userpasswordr';
% my $btn = l('pwd_PASSWORD_RESET');
% my $url = '/userpasswordr';
%= $c->render_to_string( inline => l('pwd_DESCRIPTION_RESET'));
% }
</p>
<br>
<!-- Start of Form -->
%= form_for $url => (method => 'POST') => begin
<p>
<span class="">
%= l 'pwd_YOUR_ACCOUNT'
</span>
<span class="">
%= $pwd_datas->{Account}
</span>
<table class="table table-bordered user-table-max-wdith">
<thead>
<tr>
<th class="col-sm">
%= l 'pwd_YOUR_ACCOUNT'
</th>
<th class="col-sm">
%=l 'USER_NAME'
</th>
</tr>
</thead>
<tbody>
<tr>
<td><%= $pwd_datas->{Account} %></td>
<td><%= $pwd_datas->{name} %>Not in pwd_datas-> name ? :-( </td>
</tr>
</tbody>
</table>
<br>
% if ( $pwd_datas->{trt} ne 'RESET' ) {
<div>
<%= l 'pwd_PASSWORD_OLD' %>
</div>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<input name="OldPass" id="OldPass" type="password" class="form-control sme-password" placeholder="Password">
</div>
</div>
% }
<br>
<div>
<%= l 'pwd_PASSWORD_NEW' %>
</div>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<input name="Pass" id="Pass" type="password" class="form-control sme-password" placeholder="Password">
</div>
</div>
<br>
<div>
%=l 'pwd_PASSWORD_VERIFY_NEW'
</div>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<input name="Passverify" id="PassVerify" type="password" class="form-control sme-password" placeholder="Password">
</div>
</div>
<br>
<div class="row g-3 align-items-center">
<div class="col-md-2">
<button type="submit" class="btn btn-primary"><%= $btn %></button>
</div>
</div>
%= hidden_field 'User' => $pwd_datas->{Account}
%= hidden_field 'Trt' => $pwd_datas->{trt}
%= hidden_field 'jwt' => $pwd_datas->{jwt}
<br><br>
</p>
% if ( $pwd_datas->{trt} ne 'RESET' ) {
<p>
<span class="">
%= l 'pwd_PASSWORD_OLD'
</span>
<span class="">
%= password_field 'Oldpass', class => "", class=> 'sme-password'
</span>
<br><br>
</p>
% }
<p>
<span class="">
%=l 'pwd_PASSWORD_NEW'
</span>
<span class="">
%= password_field 'Pass', class => "", class=> 'sme-password'
</span>
<br><br>
</p>
<p>
<span class="">
%=l 'pwd_PASSWORD_VERIFY_NEW'
</span>
<span class="">
%= password_field 'Passverify', class => "", class=> 'sme-password'
</span>
<br><br>
</p>
<p>
<br>
%= submit_button "$btn", class => ""
</p>
% end
<!-- End of Form -->
</div>

View File

@@ -1,6 +1,6 @@
%define name smeserver-manager-AdminLTE
%define version 11.0.0
%define release 8
%define release 16
Summary: AdminLTE is an html framework for admin consoles - this rpm adds it to smeserver manager2
Name: %{name}
Version: %{version}
@@ -26,6 +26,33 @@ AdminLTE is an html framework for admin consoles
wget https://github.com/ColorlibHQ/AdminLTE/archive/master.zip
%changelog
* Thu May 01 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.0.0-16.sme
- Fix user add error
- Update group templates
* Fri Apr 25 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.0.0-15.sme
- Forgot the updated CSS
* Fri Apr 25 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.0.0-14.sme
- Finish user templates. Saving fixed. Start on groups
* Fri Apr 25 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.0.0-13.sme
- Tidy some useraccounts formatting but admin page will not save
* Thu Apr 24 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.0.0.12.sme
- Tidy user list
* Wed Apr 23 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.0.0-11.sme
- Working sidebar scrolling
* Sat Apr 19 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.0.0-10.sme
- Tweak the form values more but stil not right
* Sat Apr 19 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.0.0-9.sme
- Starting to update forms
- Moving as much formatting to simple html as possible
- Use Mojo helpers for some parts eg theme chooser - may come back to that
* Fri Apr 18 2025 John Crisp <jcrisp@safeandsoundit.co.uk> 11.0.0-8.sme
- More cleanup
- Add Card support across all panels except login