diff options
author | Renato Botelho <garga@FreeBSD.org> | 2014-02-03 11:23:28 -0200 |
---|---|---|
committer | Renato Botelho <garga@FreeBSD.org> | 2014-02-04 12:35:30 -0200 |
commit | 7ea30d60503a5511f8b9f04171e74a0e8dd4cf8f (patch) | |
tree | 6902076e5360ee74dbaf01bf9fa26a2240dbcf4d | |
parent | eda4179204d21204be067fc4024330ad63cb8c3d (diff) | |
download | pfsense-7ea30d60503a5511f8b9f04171e74a0e8dd4cf8f.zip pfsense-7ea30d60503a5511f8b9f04171e74a0e8dd4cf8f.tar.gz |
Use php function to get hostname instead of exec()
-rwxr-xr-x | etc/inc/ipsec.auth-user.php | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/etc/inc/ipsec.auth-user.php b/etc/inc/ipsec.auth-user.php index 97ec0e3..1f93e09 100755 --- a/etc/inc/ipsec.auth-user.php +++ b/etc/inc/ipsec.auth-user.php @@ -56,11 +56,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; } } |