diff --git a/admin_plans.php b/admin_plans.php
index 97e09498..c2eb9f43 100644
--- a/admin_plans.php
+++ b/admin_plans.php
@@ -119,8 +119,6 @@ if ($page == '' || $page == 'overview') {
}
// dummy to avoid unknown variables
- $language_options = null;
- $gender_options = null;
$hosting_plans = null;
$plans_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/plans/formfield.plans_add.php';
@@ -199,9 +197,9 @@ if ($page == '' || $page == 'overview') {
$result['documentroot'] = null;
$result['standardsubdomain'] = null;
$result['deactivated'] = null;
- $language_options = null;
+ $result['def_language'] = null;
$result['firstname'] = null;
- $gender_options = null;
+ $result['gender'] = null;
$result['company'] = null;
$result['street'] = null;
$result['zipcode'] = null;
@@ -214,8 +212,7 @@ if ($page == '' || $page == 'overview') {
$result['custom_notes_show'] = null;
$result['api_allowed'] = null;
$hosting_plans = null;
- $admin_select_cnt = null;
- $admin_select = null;
+ $admin_select = [];
$plans_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/plans/formfield.plans_edit.php';
$cust_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/customer/formfield.customer_edit.php';
@@ -223,6 +220,7 @@ if ($page == '' || $page == 'overview') {
unset($cust_edit_data['customer_edit']['sections']['section_a']);
unset($cust_edit_data['customer_edit']['sections']['section_b']);
unset($cust_edit_data['customer_edit']['sections']['section_cpre']);
+ unset($cust_edit_data['customer_edit']['sections']['section_d']);
// merge
$plans_edit_data['plans_edit']['sections'] = array_merge($plans_edit_data['plans_edit']['sections'], $cust_edit_data['customer_edit']['sections']);
diff --git a/lng/english.lng.php b/lng/english.lng.php
index 44069fd1..90586a46 100644
--- a/lng/english.lng.php
+++ b/lng/english.lng.php
@@ -414,7 +414,7 @@ $lng['admin']['ipsandports']['add'] = 'Add IP/Port';
$lng['admin']['ipsandports']['edit'] = 'Edit IP/Port';
$lng['admin']['ipsandports']['ipandport'] = 'IP/Port';
$lng['admin']['ipsandports']['ip'] = 'IP';
-$lng['admin']['ipsandports']['ipnote'] = '
Note: Although private ip addresses are allowed, some features like DNS might not behave correctly.
Only use private ip addresses if you are sure.
';
+$lng['admin']['ipsandports']['ipnote'] = 'Note: Although private ip addresses are allowed, some features like DNS might not behave correctly.
Only use private ip addresses if you are sure.
';
$lng['admin']['ipsandports']['port'] = 'Port';
// ADDED IN 1.2.13-rc3
diff --git a/lng/german.lng.php b/lng/german.lng.php
index ebe4b676..c69e4864 100644
--- a/lng/german.lng.php
+++ b/lng/german.lng.php
@@ -408,7 +408,7 @@ $lng['admin']['ipsandports']['add'] = 'IP-Adresse/Port hinzufügen';
$lng['admin']['ipsandports']['edit'] = 'IP-Adresse/Port bearbeiten';
$lng['admin']['ipsandports']['ipandport'] = 'IP-Adresse/Port';
$lng['admin']['ipsandports']['ip'] = 'IP-Adresse';
-$lng['admin']['ipsandports']['ipnote'] = 'Hinweis: Obwohl private IP Adressen erlaubt sind, kann es bei manchen Features wie DNS zu ungewolltem Verhalten kommen.
Verwende private Adressen nur wenn du sicher bist.
';
+$lng['admin']['ipsandports']['ipnote'] = 'Hinweis: Obwohl private IP Adressen erlaubt sind, kann es bei manchen Features wie DNS zu ungewolltem Verhalten kommen.
Verwende private Adressen nur wenn du sicher bist.
';
$lng['admin']['ipsandports']['port'] = 'Port';
// ADDED IN 1.2.13-rc3
diff --git a/templates/Froxlor/src/js/components/customer.js b/templates/Froxlor/src/js/components/customer.js
new file mode 100644
index 00000000..c04b7409
--- /dev/null
+++ b/templates/Froxlor/src/js/components/customer.js
@@ -0,0 +1,76 @@
+$(document).ready(function () {
+
+ // Make inputs with enabled unlimited checked disabled
+ $("input[name$='_ul']").each(function () {
+ var fieldname = $(this).attr("name").substring(0, $(this).attr("name").length - 3);
+ $("input[name='" + fieldname + "']").prop({
+ readonly: $(this).is(":checked"),
+ required: !$(this).is(":checked")
+ });
+ });
+ // change state when unlimited checkboxes are clicked
+ $("input[name$='_ul']").change(function () {
+ var fieldname = $(this).attr("name").substring(0, $(this).attr("name").length - 3);
+ $("input[name='" + fieldname + "']").prop({
+ readonly: $(this).is(":checked"),
+ required: !$(this).is(":checked")
+ });
+ if (!$(this).is(":checked")) {
+ $("input[name='" + fieldname + "']").focus()
+ }
+ });
+
+ // set values from hosting plan when adding/editing a customer according to the plan's values
+ $('#use_plan').change(function () {
+ var pid = $(this).val();
+ if (pid > 0) {
+ $.ajax({
+ url: "admin_plans.php?s=" + window.$session + "&page=overview&action=jqGetPlanValues",
+ type: "POST",
+ data: {
+ planid: pid
+ },
+ dataType: "json",
+ success: function (json) {
+ for (var i in json) {
+ if (i == 'email_imap' || i == 'email_pop3' || i == 'perlenabled' || i == 'phpenabled' || i == 'dnsenabled' || i == 'logviewenabled') {
+ /** handle checkboxes **/
+ if (json[i] == 1) {
+ $("input[name='" + i + "']").prop('checked', true);
+ } else {
+ $("input[name='" + i + "']").prop('checked', false);
+ }
+ } else if (i == 'allowed_phpconfigs') {
+ /** handle array of values **/
+ $("input[name='allowed_phpconfigs[]']").each(function (index) {
+ $(this).prop('checked', false);
+ for (var j in json[i]) {
+ if ($(this).val() == json[i][j]) {
+ $(this).prop('checked', true);
+ break;
+ }
+ }
+ });
+ } else if (json[i] == -1) {
+ /** handle unlimited checkboxes **/
+ $("input[name='" + i + "_ul']").attr('checked', 'checked');
+ $("input[name='" + i + "']").prop({
+ readonly: true
+ });
+ } else {
+ /** handle normal value **/
+ $("input[name='" + i + "']").val(json[i]);
+ $("input[name='" + i + "']").prop({
+ readonly: false
+ });
+ $("input[name='" + i + "_ul']").prop('checked', false);
+ }
+ }
+ },
+ error: function (a, b) {
+ console.log(a, b);
+ }
+ });
+ }
+ });
+});
diff --git a/templates/Froxlor/src/js/components/domains.js b/templates/Froxlor/src/js/components/domains.js
new file mode 100644
index 00000000..f6b8fca4
--- /dev/null
+++ b/templates/Froxlor/src/js/components/domains.js
@@ -0,0 +1,32 @@
+$(document).ready(function () {
+
+ // disable unusable php-configuration by customer settings
+ $('#customerid').change(function () {
+ var cid = $(this).val();
+ $.ajax({
+ url: "admin_domains.php?s=" + window.$session + "&page=domains&action=jqGetCustomerPHPConfigs",
+ type: "POST",
+ data: {
+ customerid: cid
+ },
+ dataType: "json",
+ success: function (json) {
+ if (json.length > 0) {
+ $('#phpsettingid option').each(function () {
+ var pid = $(this).val();
+ $(this).attr("disabled", "disabled");
+ for (var i in json) {
+ if (pid == json[i]) {
+ $(this).removeAttr("disabled");
+ }
+ }
+ });
+ }
+ },
+ error: function (a, b) {
+ console.log(a, b);
+ }
+ });
+ });
+
+});
diff --git a/templates/Froxlor/src/js/components/ipsandports.js b/templates/Froxlor/src/js/components/ipsandports.js
new file mode 100644
index 00000000..905915d7
--- /dev/null
+++ b/templates/Froxlor/src/js/components/ipsandports.js
@@ -0,0 +1,29 @@
+$(document).ready(function () {
+
+ // check for internal ip and output a notice if private-range ip is given
+ $('#ip').change(function () {
+ var ipval = $(this).val();
+ if (ipval.length > 0) {
+ $('#ipnote').remove();
+ $('#ip').removeClass('is-invalid');
+ $.ajax({
+ url: "admin_ipsandports.php?s=" + window.$session + "&page=overview&action=jqCheckIP",
+ type: "POST",
+ data: {
+ ip: ipval
+ },
+ dataType: "json",
+ success: function (json) {
+ if (json != 0) {
+ $('#ip').addClass('is-invalid');
+ $('#ip').parent().append(json);
+ }
+ },
+ error: function (a, b) {
+ console.log(a, b);
+ }
+ });
+ }
+ });
+
+});
diff --git a/templates/Froxlor/src/js/main.js b/templates/Froxlor/src/js/main.js
index 4bd8953f..9f46725d 100644
--- a/templates/Froxlor/src/js/main.js
+++ b/templates/Froxlor/src/js/main.js
@@ -13,3 +13,6 @@ $(document).ready(function () {
require('./components/search')
require('./components/newsfeed')
require('./components/updatecheck')
+require('./components/customer')
+require('./components/ipsandports')
+require('./components/domains')