diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-02-03 11:27:13 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-02-04 12:34:41 -0200 |
commit | f17771745918a068950c6a4536b807f37464f02b (patch) | |
tree | 3563b5430650c43a87c2430df346450299eddc7e /etc/inc/openvpn.auth-user.php | |
parent | 8340d95653a6bb8602a3fb60fbed0173b73e06f9 (diff) | |
download | pfsense-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-x | etc/inc/openvpn.auth-user.php | 9 |
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; } } |