Commit d3bca141 authored by Franco Fichtner's avatar Franco Fichtner

vpn: url_safe() for OpenVPN pages

parent 0760c967
......@@ -137,7 +137,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
unset($a_client[$id]);
write_config();
}
header("Location: vpn_openvpn_client.php");
header(url_safe('Location: vpn_openvpn_client.php'));
exit;
} elseif ($act == "del_x") {
if (!empty($pconfig['rule']) && is_array($pconfig['rule'])) {
......@@ -149,7 +149,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
write_config();
}
header("Location: vpn_openvpn_client.php");
header(url_safe('Location: vpn_openvpn_client.php'));
exit;
} elseif ($act == "move"){
// move selected items
......@@ -159,7 +159,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
$a_client = legacy_move_config_list_items($a_client, $id, $pconfig['rule']);
write_config();
header("Location: vpn_openvpn_client.php");
header(url_safe('Location: vpn_openvpn_client.php'));
exit;
} elseif ($act == "toggle") {
if (isset($id)) {
......@@ -171,7 +171,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
openvpn_resync('client', $a_client[$id]);
write_config();
}
header("Location: vpn_openvpn_client.php");
header(url_safe('Location: vpn_openvpn_client.php'));
exit;
} else {
// update client (after validation)
......@@ -339,7 +339,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
openvpn_resync('client', $client);
write_config();
header("Location: vpn_openvpn_client.php");
header(url_safe('Location: vpn_openvpn_client.php'));
exit;
}
}
......
......@@ -90,7 +90,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
unset($a_csc[$id]);
write_config();
}
header("Location: vpn_openvpn_csc.php");
header(url_safe('Location: vpn_openvpn_csc.php'));
exit;
} elseif ($act == "del_x") {
if (!empty($pconfig['rule']) && is_array($pconfig['rule'])) {
......@@ -102,7 +102,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
write_config();
}
header("Location: vpn_openvpn_csc.php");
header(url_safe('Location: vpn_openvpn_csc.php'));
exit;
} elseif ($act == "move"){
// move selected items
......@@ -112,7 +112,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
}
$a_csc = legacy_move_config_list_items($a_csc, $id, $pconfig['rule']);
write_config();
header("Location: vpn_openvpn_csc.php");
header(url_safe('Location: vpn_openvpn_csc.php'));
exit;
} elseif ($act == "toggle") {
if (isset($id)) {
......@@ -124,7 +124,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
write_config();
openvpn_resync_csc();
}
header("Location: vpn_openvpn_csc.php");
header(url_safe('Location: vpn_openvpn_csc.php'));
exit;
} else {
/* perform validations */
......@@ -225,7 +225,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
write_config();
openvpn_resync_csc();
header("Location: vpn_openvpn_csc.php");
header(url_safe('Location: vpn_openvpn_csc.php'));
exit;
}
}
......
......@@ -112,7 +112,7 @@ if (isset($config['openvpn']['openvpn-server'])) {
$usrid = isset($_GET['usrid']) ? $_GET['usrid'] : false;
$crtid = isset($_GET['crtid']) ? $_GET['crtid'] : false;
if ($srvid === false) {
header("Location: vpn_openvpn_export.php");
header(url_safe('Location: vpn_openvpn_export.php'));
exit;
}
......
......@@ -141,7 +141,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
unset($a_server[$id]);
write_config();
}
header("Location: vpn_openvpn_server.php");
header(url_safe('Location: vpn_openvpn_server.php'));
exit;
} elseif ($act == "toggle") {
if (isset($id)) {
......@@ -153,7 +153,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
openvpn_resync('server', $a_server[$id]);
write_config();
}
header("Location: vpn_openvpn_server.php");
header(url_safe('Location: vpn_openvpn_server.php'));
exit;
} else {
// action add/update
......@@ -406,7 +406,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
write_config();
openvpn_resync_csc(); // dump client specific overrides, the required set may have changed
header("Location: vpn_openvpn_server.php");
header(url_safe('Location: vpn_openvpn_server.php'));
exit;
} elseif (!empty($pconfig['authmode'])) {
$pconfig['authmode'] = implode(",", $pconfig['authmode']);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment