if(!isset($MSG_QUEUE_KEY_ID_CLIENT)) $MSG_QUEUE_KEY_ID_CLIENT = "189751073"; // ftok is not ok!
global $MSG_QUEUE_KEY_ID_SERVER, $MSG_QUEUE_KEY_ID_CLIENT;
+if(!isset($TCP_PORT_NUMBER)) $TCP_PORT_NUMBER = 21446;
+global $TCP_PORT_NUMBER;
+
define("MSG_AUTH_USER_TOKEN", 1);
define("MSG_ADD_USER_TOKEN", 2);
define("MSG_DELETE_USER", 3);
define("MSG_ADD_RADIUS_CLIENT", 17);
// BASE_DIR =
+// messy
$BASE_DIR = realpath(dirname(__FILE__)."/../../");
global $BASE_DIR;
function updateRadius()
{
// this is hardcoded for now.
- $clientfile = "/opt/freeradius/clients.conf";
+ //$clientfile = "/etc/freeradius/clients.conf";
+ $clientfile = "/tmp/clients.conf";
+ $reloadinit = "/etc/init.d/freeradius restart";
$db = getDatabase();
+ echo "in updateradius\n";
$hand = fopen($clientfile, "w");
$sql = "select * from radclients";
$res = $db->query($sql);
$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);
}