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:34:41 -0200 |
commit | e6867c81d14a682eea0a1ff19580f94b678b7fe2 (patch) | |
tree | 2f6d7240cc9ad3142e119825d1d5fcb7c29604e0 /etc/inc/ipsec.auth-user.php | |
parent | 3f4bd83b5aa2f830f247f51cdc8fc45adc5a99f1 (diff) | |
download | pfsense-e6867c81d14a682eea0a1ff19580f94b678b7fe2.zip pfsense-e6867c81d14a682eea0a1ff19580f94b678b7fe2.tar.gz |
Use php function to get hostname instead of exec()
Diffstat (limited to 'etc/inc/ipsec.auth-user.php')
-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 48bbe81..3865501 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; } } |