radius clients stuff
[ga4php.git] / authserver / authd / authd.php
index 67b9627..520a39f 100644 (file)
@@ -30,6 +30,7 @@ if($pid == -1) {
        
        while(true) {
                msg_receive($sr_queue, 0, $msg_type, 16384, $msg);
+               echo "got message of type $msg_type\n";
                switch($msg_type) {
                        case MSG_GET_RADIUS_CLIENTS:
                                $sql = "select * from radclients";
@@ -50,16 +51,20 @@ if($pid == -1) {
                                // it should send us a client by rad_name - doesnt work yet
                                $client = $msg["clientname"];
                                $sql = "delete from radclients where rad_name='$client'";
+                               $dbo = getDatabase();
                                $res = $dbo->query($sql);
                                updateRadius();
                                msg_send($cl_queue, MSG_REMOVE_RADIUS_CLIENT, true);
                                break;
                        case MSG_ADD_RADIUS_CLIENT:
+                               echo "in addradclient\n";
                                $client = $msg["clientname"];
                                $clientsecret = $msg["clientsecret"];
                                $clientip = $msg["clientip"];
                                $clientdesc = $msg["clientdescription"];
                                $sql = "insert into radclients values (NULL, '$client', '$clientip', '$clientsecret', '$clientdesc')";
+                               $dbo = getDatabase();
+                               $res = $dbo->query($sql);
                                updateRadius();
                                msg_send($cl_queue, MSG_ADD_RADIUS_CLIENT, true);
                                break;