summaryrefslogtreecommitdiffstats
path: root/etc/inc/openvpn.auth-user.php
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-02-03 11:27:13 -0200
committerRenato Botelho <garga@FreeBSD.org>2014-02-04 12:34:41 -0200
commitf17771745918a068950c6a4536b807f37464f02b (patch)
tree3563b5430650c43a87c2430df346450299eddc7e /etc/inc/openvpn.auth-user.php
parent8340d95653a6bb8602a3fb60fbed0173b73e06f9 (diff)
downloadpfsense-f17771745918a068950c6a4536b807f37464f02b.zip
pfsense-f17771745918a068950c6a4536b807f37464f02b.tar.gz
Use php function to get hostname instead of exec()
Diffstat (limited to 'etc/inc/openvpn.auth-user.php')
-rwxr-xr-xetc/inc/openvpn.auth-user.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/etc/inc/openvpn.auth-user.php b/etc/inc/openvpn.auth-user.php
index 5c8c09b..dc12992 100755
--- a/etc/inc/openvpn.auth-user.php
+++ b/etc/inc/openvpn.auth-user.php
@@ -57,11 +57,10 @@ function getNasID()
{
global $g;
- $nasId = "";
- exec("/bin/hostname", $nasId);
- if(!$nasId[0])
- $nasId[0] = "{$g['product_name']}";
- return $nasId[0];
+ $nasId = gethostname();
+ if(empty($nasId))
+ $nasId = $g['product_name'];
+ return $nasId;
}
}
OpenPOWER on IntegriCloud