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:35:46 -0200 |
commit | 645018b2efa61f0f93abccc33f4e236992977fcd (patch) | |
tree | fb0515b777985bc0cacde5817117c2bf65951041 /etc | |
parent | 4744c6e44e971b2a0828f15c5991d82faf6bb0b3 (diff) | |
download | pfsense-645018b2efa61f0f93abccc33f4e236992977fcd.zip pfsense-645018b2efa61f0f93abccc33f4e236992977fcd.tar.gz |
Use php function to get hostname instead of exec()
Diffstat (limited to 'etc')
-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 2ddadca..326f788 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; } } |