Todo #12431 » 429.diff
| src/usr/local/www/pkg.php | ||
|---|---|---|
|
$evaledvar = config_get_path($config_path, []);
|
||
|
if ($_REQUEST['act'] == "update") {
|
||
|
if ($_POST['act'] == "update") {
|
||
|
if (is_array($config['installedpackages'][$pkg['name']]) && $pkg['name'] != "" && $_REQUEST['ids'] !="") {
|
||
|
if (is_array($config['installedpackages'][$pkg['name']]) && $pkg['name'] != "" && $_POST['ids'] !="") {
|
||
|
// get current values
|
||
|
$current_values=config_get_path("installedpackages/{$pkg['name']}/config");
|
||
|
// get updated ids
|
||
|
parse_str($_REQUEST['ids'], $update_list);
|
||
|
parse_str($_POST['ids'], $update_list);
|
||
|
// sort ids to know what to change
|
||
|
// useful to do not lose data when using sorting and paging
|
||
|
$sort_list=$update_list['ids'];
|
||
| ... | ... | |
|
var strloading="<?=gettext('Saving changes...')?>";
|
||
|
if (confirm("<?=gettext("Confirmation Required to save changes.")?>")) {
|
||
|
$.ajax({
|
||
|
type: 'get',
|
||
|
type: 'post',
|
||
|
cache: false,
|
||
|
url: "<?=$_SERVER['SCRIPT_NAME']?>",
|
||
|
data: {xml:'<?=$xml?>', act:'update', ids: ids},
|
||
| src/usr/local/www/services_captiveportal_vouchers.php | ||
|---|---|---|
|
$cpzone = strtolower(htmlspecialchars($_REQUEST['zone']));
|
||
|
if ($_REQUEST['generatekey']) {
|
||
|
if ($_POST['generatekey']) {
|
||
|
include_once("phpseclib/Math/BigInteger.php");
|
||
|
include_once("phpseclib/Crypt/Hash.php");
|
||
|
include_once("phpseclib/Crypt/RSA.php");
|
||
| ... | ... | |
|
var generateButton = $('<a class="btn btn-xs btn-warning"><i class="fa fa-refresh icon-embed-btn"></i><?=gettext("Generate new keys");?></a>');
|
||
|
generateButton.on('click', function() {
|
||
|
$.ajax({
|
||
|
type: 'get',
|
||
|
url: 'services_captiveportal_vouchers.php?generatekey=true',
|
||
|
type: 'post',
|
||
|
url: 'services_captiveportal_vouchers.php',
|
||
|
data: {
|
||
|
generatekey: true,
|
||
|
},
|
||
|
dataType: 'json',
|
||
|
success: function(data) {
|
||
|
$('#publickey').val(data.public.replace(/\\n/g, '\n'));
|
||
| src/usr/local/www/status_graph.php | ||
|---|---|---|
|
$.ajax(
|
||
|
'/bandwidth_by_ip.php',
|
||
|
{
|
||
|
type: 'get',
|
||
|
type: 'post',
|
||
|
data: $(document.forms[0]).serialize(),
|
||
|
success: function (data) {
|
||
|
var hosts_split = data.split("|");
|
||
| src/usr/local/www/status_openvpn.php | ||
|---|---|---|
|
require_once("service-utils.inc");
|
||
|
/* Handle AJAX */
|
||
|
if ($_REQUEST['action']) {
|
||
|
if ($_REQUEST['action'] == "kill") {
|
||
|
$port = $_REQUEST['port'];
|
||
|
$remipp = $_REQUEST['remipp'];
|
||
|
$client_id = $_REQUEST['client_id'];
|
||
|
if ($_POST['action']) {
|
||
|
if ($_POST['action'] == "kill") {
|
||
|
$port = $_POST['port'];
|
||
|
$remipp = $_POST['remipp'];
|
||
|
$client_id = $_POST['client_id'];
|
||
|
if (!empty($port) and !empty($remipp)) {
|
||
|
$retval = openvpn_kill_client($port, $remipp, $client_id);
|
||
|
echo htmlentities("|{$port}|{$remipp}|{$retval}|");
|
||
| ... | ... | |
|
$('img[name="i:' + mport + ":" + remipp + '"]').each(busy);
|
||
|
$.ajax(
|
||
|
"<?=$_SERVER['SCRIPT_NAME'];?>" +
|
||
|
"?action=kill&port=" + mport + "&remipp=" + remipp + "&client_id=" + client_id,
|
||
|
{ type: "get", complete: killComplete }
|
||
|
"<?=$_SERVER['SCRIPT_NAME'];?>",
|
||
|
{
|
||
|
type: "post",
|
||
|
data: {
|
||
|
action: "kill",
|
||
|
port: mport,
|
||
|
remipp: remipp,
|
||
|
client_id: client_id
|
||
|
},
|
||
|
complete: killComplete
|
||
|
}
|
||
|
);
|
||
|
}
|
||
| src/usr/local/www/vpn_ipsec_phase1.php | ||
|---|---|---|
|
require_once("vpn.inc");
|
||
|
require_once("filter.inc");
|
||
|
if ($_REQUEST['generatekey']) {
|
||
|
if ($_POST['generatekey']) {
|
||
|
$keyoutput = "";
|
||
|
$keystatus = "";
|
||
|
exec("/bin/dd status=none if=/dev/random bs=4096 count=1 | /usr/bin/openssl sha224 | /usr/bin/cut -f2 -d' '", $keyoutput, $keystatus);
|
||
| ... | ... | |
|
var generateButton = $('<a class="btn btn-xs btn-warning"><i class="fa fa-refresh icon-embed-btn"></i><?=gettext("Generate new Pre-Shared Key");?></a>');
|
||
|
generateButton.on('click', function() {
|
||
|
$.ajax({
|
||
|
type: 'get',
|
||
|
url: 'vpn_ipsec_phase1.php?generatekey=true',
|
||
|
type: 'post',
|
||
|
url: 'vpn_ipsec_phase1.php',
|
||
|
data: {
|
||
|
generatekey: true,
|
||
|
},
|
||
|
dataType: 'json',
|
||
|
success: function(data) {
|
||
|
$('#pskey').val(data.pskey.replace(/\\n/g, '\n'));
|
||
| src/usr/local/www/widgets/widgets/gmirror_status.widget.php | ||
|---|---|---|
|
//<![CDATA[
|
||
|
function gmirrorStatusUpdateFromServer() {
|
||
|
$.ajax({
|
||
|
type: 'get',
|
||
|
type: 'post',
|
||
|
url: '/widgets/widgets/gmirror_status.widget.php',
|
||
|
dataType: 'html',
|
||
|
dataFilter: function(raw){
|
||
| src/usr/local/www/widgets/widgets/openvpn.widget.php | ||
|---|---|---|
|
}
|
||
|
/* Handle AJAX */
|
||
|
if ($_GET['action']) {
|
||
|
if ($_GET['action'] == "kill") {
|
||
|
$port = $_GET['port'];
|
||
|
$remipp = $_GET['remipp'];
|
||
|
$client_id = $_GET['client_id'];
|
||
|
if ($_POST['action']) {
|
||
|
if ($_POST['action'] == "kill") {
|
||
|
$port = $_POST['port'];
|
||
|
$remipp = $_POST['remipp'];
|
||
|
$client_id = $_POST['client_id'];
|
||
|
if (!empty($port) and !empty($remipp)) {
|
||
|
$retval = openvpn_kill_client($port, $remipp, $client_id);
|
||
|
echo htmlentities("|{$port}|{$remipp}|{$retval}|");
|
||
| ... | ... | |
|
function killClient(mport, remipp, client_id) {
|
||
|
$.ajax(
|
||
|
"widgets/widgets/openvpn.widget.php" +
|
||
|
"?action=kill&port=" + mport + "&remipp=" + remipp + "&client_id=" + client_id,
|
||
|
{ type: "get", complete: killComplete }
|
||
|
"widgets/widgets/openvpn.widget.php",
|
||
|
{
|
||
|
type: "post",
|
||
|
data: {
|
||
|
action: "kill",
|
||
|
port: mport,
|
||
|
remipp: remipp,
|
||
|
client_id: client_id
|
||
|
},
|
||
|
complete: killComplete
|
||
|
}
|
||
|
);
|
||
|
}
|
||