Commit e22afc54 authored by AdSchellevis's avatar AdSchellevis

remove ipsec roadwarrior php-fpm hacks

parent 2258cb90
...@@ -46,15 +46,16 @@ require_once("interfaces.inc"); ...@@ -46,15 +46,16 @@ require_once("interfaces.inc");
* We will use our local hostname to make up the nas_id * We will use our local hostname to make up the nas_id
*/ */
if (!function_exists("getNasID")) { if (!function_exists("getNasID")) {
function getNasID() function getNasID()
{ {
global $g; global $g;
$nasId = gethostname(); $nasId = gethostname();
if(empty($nasId)) if(empty($nasId)) {
$nasId = $g['product_name']; $nasId = $g['product_name'];
return $nasId; }
} return $nasId;
}
} }
/** /**
...@@ -64,29 +65,22 @@ function getNasID() ...@@ -64,29 +65,22 @@ function getNasID()
* *
*/ */
if (!function_exists("getNasIP")) { if (!function_exists("getNasIP")) {
function getNasIP() function getNasIP()
{ {
$nasIp = get_interface_ip(); $nasIp = get_interface_ip();
if(!$nasIp) if(!$nasIp)
$nasIp = "0.0.0.0"; $nasIp = "0.0.0.0";
return $nasIp; return $nasIp;
} }
} }
/* setup syslog logging */ /* setup syslog logging */
openlog("charon", LOG_ODELAY, LOG_AUTH); openlog("charon", LOG_ODELAY, LOG_AUTH);
if (isset($_GET['username'])) { /* read data from environment */
$authmodes = explode(",", $_GET['authcfg']); $username = getenv("username");
$username = $_GET['username']; $password = getenv("password");
$password = $_GET['password']; $common_name = getenv("common_name");
$common_name = $_GET['cn']; $authmodes = explode(",", getenv("authcfg"));
} else {
/* read data from environment */
$username = getenv("username");
$password = getenv("password");
$common_name = getenv("common_name");
$authmodes = explode(",", getenv("authcfg"));
}
if (!$username || !$password) { if (!$username || !$password) {
syslog(LOG_ERR, "invalid user authentication environment"); syslog(LOG_ERR, "invalid user authentication environment");
...@@ -151,7 +145,4 @@ if ($authenticated == false) { ...@@ -151,7 +145,4 @@ if ($authenticated == false) {
syslog(LOG_NOTICE, "user '{$username}' authenticated\n"); syslog(LOG_NOTICE, "user '{$username}' authenticated\n");
closelog(); closelog();
if (isset($_GET['username'])) exit(0);
echo "OK";
else
exit(0);
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