X-Git-Url: http://git.pjr.cc/?p=ga4php.git;a=blobdiff_plain;f=authserver%2Flib%2Flib.php;h=c938b8ebf69bc35e8c8f3330228d7faae85ae3ef;hp=0d6ab36d5b97e2ce765babc734632dcd5ac520db;hb=da4ac26dcfd94c9f8b7e8e43f50f671bdd94dfd0;hpb=c3c37cd9f486175adf0351de80c19efd02892ca6 diff --git a/authserver/lib/lib.php b/authserver/lib/lib.php index 0d6ab36..c938b8e 100644 --- a/authserver/lib/lib.php +++ b/authserver/lib/lib.php @@ -23,6 +23,7 @@ define("MSG_REMOVE_RADIUS_CLIENT", 16); define("MSG_ADD_RADIUS_CLIENT", 17); // BASE_DIR = +// messy $BASE_DIR = realpath(dirname(__FILE__)."/../../"); global $BASE_DIR; @@ -44,7 +45,9 @@ function generateRandomString() function updateRadius() { // this is hardcoded for now. + //$clientfile = "/etc/freeradius/clients.conf"; $clientfile = "/tmp/clients.conf"; + $reloadinit = "/etc/init.d/freeradius restart"; $db = getDatabase(); @@ -56,10 +59,12 @@ function updateRadius() $cname = $row["rad_name"]; $cip = $row["rad_ip"]; $csec = $row["rad_secret"]; - $lines = "client $cname {\nipaddr = $cip\nsecret = $csec\nrequire_message_authenticator = no\n}"; + $lines = "client $cname {\nipaddr = $cip\nsecret = $csec\nrequire_message_authenticator = no\n}\n\n"; fwrite($hand, $lines); } fclose($hand); + // not yet + //system($reloadinit); }