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') { ...@@ -137,7 +137,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
unset($a_client[$id]); unset($a_client[$id]);
write_config(); write_config();
} }
header("Location: vpn_openvpn_client.php"); header(url_safe('Location: vpn_openvpn_client.php'));
exit; exit;
} elseif ($act == "del_x") { } elseif ($act == "del_x") {
if (!empty($pconfig['rule']) && is_array($pconfig['rule'])) { if (!empty($pconfig['rule']) && is_array($pconfig['rule'])) {
...@@ -149,7 +149,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -149,7 +149,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
write_config(); write_config();
} }
header("Location: vpn_openvpn_client.php"); header(url_safe('Location: vpn_openvpn_client.php'));
exit; exit;
} elseif ($act == "move"){ } elseif ($act == "move"){
// move selected items // move selected items
...@@ -159,7 +159,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -159,7 +159,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
$a_client = legacy_move_config_list_items($a_client, $id, $pconfig['rule']); $a_client = legacy_move_config_list_items($a_client, $id, $pconfig['rule']);
write_config(); write_config();
header("Location: vpn_openvpn_client.php"); header(url_safe('Location: vpn_openvpn_client.php'));
exit; exit;
} elseif ($act == "toggle") { } elseif ($act == "toggle") {
if (isset($id)) { if (isset($id)) {
...@@ -171,7 +171,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -171,7 +171,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
openvpn_resync('client', $a_client[$id]); openvpn_resync('client', $a_client[$id]);
write_config(); write_config();
} }
header("Location: vpn_openvpn_client.php"); header(url_safe('Location: vpn_openvpn_client.php'));
exit; exit;
} else { } else {
// update client (after validation) // update client (after validation)
...@@ -339,7 +339,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -339,7 +339,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
openvpn_resync('client', $client); openvpn_resync('client', $client);
write_config(); write_config();
header("Location: vpn_openvpn_client.php"); header(url_safe('Location: vpn_openvpn_client.php'));
exit; exit;
} }
} }
......
...@@ -90,7 +90,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -90,7 +90,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
unset($a_csc[$id]); unset($a_csc[$id]);
write_config(); write_config();
} }
header("Location: vpn_openvpn_csc.php"); header(url_safe('Location: vpn_openvpn_csc.php'));
exit; exit;
} elseif ($act == "del_x") { } elseif ($act == "del_x") {
if (!empty($pconfig['rule']) && is_array($pconfig['rule'])) { if (!empty($pconfig['rule']) && is_array($pconfig['rule'])) {
...@@ -102,7 +102,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -102,7 +102,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
write_config(); write_config();
} }
header("Location: vpn_openvpn_csc.php"); header(url_safe('Location: vpn_openvpn_csc.php'));
exit; exit;
} elseif ($act == "move"){ } elseif ($act == "move"){
// move selected items // move selected items
...@@ -112,7 +112,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -112,7 +112,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
} }
$a_csc = legacy_move_config_list_items($a_csc, $id, $pconfig['rule']); $a_csc = legacy_move_config_list_items($a_csc, $id, $pconfig['rule']);
write_config(); write_config();
header("Location: vpn_openvpn_csc.php"); header(url_safe('Location: vpn_openvpn_csc.php'));
exit; exit;
} elseif ($act == "toggle") { } elseif ($act == "toggle") {
if (isset($id)) { if (isset($id)) {
...@@ -124,7 +124,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -124,7 +124,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
write_config(); write_config();
openvpn_resync_csc(); openvpn_resync_csc();
} }
header("Location: vpn_openvpn_csc.php"); header(url_safe('Location: vpn_openvpn_csc.php'));
exit; exit;
} else { } else {
/* perform validations */ /* perform validations */
...@@ -225,7 +225,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -225,7 +225,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
write_config(); write_config();
openvpn_resync_csc(); openvpn_resync_csc();
header("Location: vpn_openvpn_csc.php"); header(url_safe('Location: vpn_openvpn_csc.php'));
exit; exit;
} }
} }
......
...@@ -112,7 +112,7 @@ if (isset($config['openvpn']['openvpn-server'])) { ...@@ -112,7 +112,7 @@ if (isset($config['openvpn']['openvpn-server'])) {
$usrid = isset($_GET['usrid']) ? $_GET['usrid'] : false; $usrid = isset($_GET['usrid']) ? $_GET['usrid'] : false;
$crtid = isset($_GET['crtid']) ? $_GET['crtid'] : false; $crtid = isset($_GET['crtid']) ? $_GET['crtid'] : false;
if ($srvid === false) { if ($srvid === false) {
header("Location: vpn_openvpn_export.php"); header(url_safe('Location: vpn_openvpn_export.php'));
exit; exit;
} }
......
...@@ -141,7 +141,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -141,7 +141,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
unset($a_server[$id]); unset($a_server[$id]);
write_config(); write_config();
} }
header("Location: vpn_openvpn_server.php"); header(url_safe('Location: vpn_openvpn_server.php'));
exit; exit;
} elseif ($act == "toggle") { } elseif ($act == "toggle") {
if (isset($id)) { if (isset($id)) {
...@@ -153,7 +153,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -153,7 +153,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
openvpn_resync('server', $a_server[$id]); openvpn_resync('server', $a_server[$id]);
write_config(); write_config();
} }
header("Location: vpn_openvpn_server.php"); header(url_safe('Location: vpn_openvpn_server.php'));
exit; exit;
} else { } else {
// action add/update // action add/update
...@@ -406,7 +406,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { ...@@ -406,7 +406,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
write_config(); write_config();
openvpn_resync_csc(); // dump client specific overrides, the required set may have changed 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; exit;
} elseif (!empty($pconfig['authmode'])) { } elseif (!empty($pconfig['authmode'])) {
$pconfig['authmode'] = implode(",", $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