re-add some of the js/ajax actions
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -119,8 +119,6 @@ if ($page == '' || $page == 'overview') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// dummy to avoid unknown variables
|
// dummy to avoid unknown variables
|
||||||
$language_options = null;
|
|
||||||
$gender_options = null;
|
|
||||||
$hosting_plans = null;
|
$hosting_plans = null;
|
||||||
|
|
||||||
$plans_add_data = include_once dirname(__FILE__) . '/lib/formfields/admin/plans/formfield.plans_add.php';
|
$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['documentroot'] = null;
|
||||||
$result['standardsubdomain'] = null;
|
$result['standardsubdomain'] = null;
|
||||||
$result['deactivated'] = null;
|
$result['deactivated'] = null;
|
||||||
$language_options = null;
|
$result['def_language'] = null;
|
||||||
$result['firstname'] = null;
|
$result['firstname'] = null;
|
||||||
$gender_options = null;
|
$result['gender'] = null;
|
||||||
$result['company'] = null;
|
$result['company'] = null;
|
||||||
$result['street'] = null;
|
$result['street'] = null;
|
||||||
$result['zipcode'] = null;
|
$result['zipcode'] = null;
|
||||||
@@ -214,8 +212,7 @@ if ($page == '' || $page == 'overview') {
|
|||||||
$result['custom_notes_show'] = null;
|
$result['custom_notes_show'] = null;
|
||||||
$result['api_allowed'] = null;
|
$result['api_allowed'] = null;
|
||||||
$hosting_plans = null;
|
$hosting_plans = null;
|
||||||
$admin_select_cnt = null;
|
$admin_select = [];
|
||||||
$admin_select = null;
|
|
||||||
|
|
||||||
$plans_edit_data = include_once dirname(__FILE__) . '/lib/formfields/admin/plans/formfield.plans_edit.php';
|
$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';
|
$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_a']);
|
||||||
unset($cust_edit_data['customer_edit']['sections']['section_b']);
|
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_cpre']);
|
||||||
|
unset($cust_edit_data['customer_edit']['sections']['section_d']);
|
||||||
// merge
|
// merge
|
||||||
$plans_edit_data['plans_edit']['sections'] = array_merge($plans_edit_data['plans_edit']['sections'], $cust_edit_data['customer_edit']['sections']);
|
$plans_edit_data['plans_edit']['sections'] = array_merge($plans_edit_data['plans_edit']['sections'], $cust_edit_data['customer_edit']['sections']);
|
||||||
|
|
||||||
|
|||||||
@@ -414,7 +414,7 @@ $lng['admin']['ipsandports']['add'] = 'Add IP/Port';
|
|||||||
$lng['admin']['ipsandports']['edit'] = 'Edit IP/Port';
|
$lng['admin']['ipsandports']['edit'] = 'Edit IP/Port';
|
||||||
$lng['admin']['ipsandports']['ipandport'] = 'IP/Port';
|
$lng['admin']['ipsandports']['ipandport'] = 'IP/Port';
|
||||||
$lng['admin']['ipsandports']['ip'] = 'IP';
|
$lng['admin']['ipsandports']['ip'] = 'IP';
|
||||||
$lng['admin']['ipsandports']['ipnote'] = '<div id="ipnote" class="text-danger">Note: Although private ip addresses are allowed, some features like DNS might not behave correctly.<br>Only use private ip addresses if you are sure.</div>';
|
$lng['admin']['ipsandports']['ipnote'] = '<div id="ipnote" class="invalid-feedback">Note: Although private ip addresses are allowed, some features like DNS might not behave correctly.<br>Only use private ip addresses if you are sure.</div>';
|
||||||
$lng['admin']['ipsandports']['port'] = 'Port';
|
$lng['admin']['ipsandports']['port'] = 'Port';
|
||||||
|
|
||||||
// ADDED IN 1.2.13-rc3
|
// ADDED IN 1.2.13-rc3
|
||||||
|
|||||||
@@ -408,7 +408,7 @@ $lng['admin']['ipsandports']['add'] = 'IP-Adresse/Port hinzufügen';
|
|||||||
$lng['admin']['ipsandports']['edit'] = 'IP-Adresse/Port bearbeiten';
|
$lng['admin']['ipsandports']['edit'] = 'IP-Adresse/Port bearbeiten';
|
||||||
$lng['admin']['ipsandports']['ipandport'] = 'IP-Adresse/Port';
|
$lng['admin']['ipsandports']['ipandport'] = 'IP-Adresse/Port';
|
||||||
$lng['admin']['ipsandports']['ip'] = 'IP-Adresse';
|
$lng['admin']['ipsandports']['ip'] = 'IP-Adresse';
|
||||||
$lng['admin']['ipsandports']['ipnote'] = '<div id="ipnote" class="text-danger">Hinweis: Obwohl private IP Adressen erlaubt sind, kann es bei manchen Features wie DNS zu ungewolltem Verhalten kommen.<br>Verwende private Adressen nur wenn du sicher bist.</div>';
|
$lng['admin']['ipsandports']['ipnote'] = '<div id="ipnote" class="invalid-feedback">Hinweis: Obwohl private IP Adressen erlaubt sind, kann es bei manchen Features wie DNS zu ungewolltem Verhalten kommen.<br>Verwende private Adressen nur wenn du sicher bist.</div>';
|
||||||
$lng['admin']['ipsandports']['port'] = 'Port';
|
$lng['admin']['ipsandports']['port'] = 'Port';
|
||||||
|
|
||||||
// ADDED IN 1.2.13-rc3
|
// ADDED IN 1.2.13-rc3
|
||||||
|
|||||||
76
templates/Froxlor/src/js/components/customer.js
Normal file
76
templates/Froxlor/src/js/components/customer.js
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
32
templates/Froxlor/src/js/components/domains.js
Normal file
32
templates/Froxlor/src/js/components/domains.js
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
29
templates/Froxlor/src/js/components/ipsandports.js
Normal file
29
templates/Froxlor/src/js/components/ipsandports.js
Normal file
@@ -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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
@@ -13,3 +13,6 @@ $(document).ready(function () {
|
|||||||
require('./components/search')
|
require('./components/search')
|
||||||
require('./components/newsfeed')
|
require('./components/newsfeed')
|
||||||
require('./components/updatecheck')
|
require('./components/updatecheck')
|
||||||
|
require('./components/customer')
|
||||||
|
require('./components/ipsandports')
|
||||||
|
require('./components/domains')
|
||||||
|
|||||||
Reference in New Issue
Block a user