added client get users command
[ga4php.git] / gaas / lib / gaasdLib.php
index 9af4dfb..ab6b4ad 100644 (file)
@@ -14,7 +14,10 @@ if(file_exists($BASE_DIR."/gaas/gaasd/gaasd.sqlite")) {
        // then we check if the config vars we need exist in the db
        $backEndType = confGetVal("backend");
        
+       echo "backend type is $backEndType\n";
+       
        if($backEndType == "AD") {
+               echo "init state should be true\n";
                $backEnd = "AD";
                
                // TODO: we should now check all vars are set, but for now this will surfice
@@ -46,11 +49,11 @@ function createDB()
                return false;
        }
        
-       if($backEnd == "IN") {
-               $sql = 'CREATE TABLE "users" ("users_id" INTEGER PRIMARY KEY AUTOINCREMENT,"users_username" TEXT, "users_realname" TEXT, "users_password" TEXT, "users_tokendata" TEXT, "users_otk" TEXT);';
-               $dbobject->query($sql);
-       }
-       
+       // users_tokendata is used by ga4php, users_otk is the qrcode data link if needed, 
+       // tokentype is the software/hardware token types
+       $sql = 'CREATE TABLE "users" ("users_id" INTEGER PRIMARY KEY AUTOINCREMENT,"users_username" TEXT, "users_realname" TEXT, \
+               "users_password" TEXT, "users_tokendata" TEXT, "users_qrcodeid" TEXT, "user_enabled" TEXT, "users_tokentype" TEXT);';
+       $dbobject->query($sql);
        $sql = 'CREATE TABLE "config" ("conf_id" INTEGER PRIMARY KEY AUTOINCREMENT,"conf_name" TEXT, "conf_value" TEXT);';
        $dbobject->query($sql);
        $sql = 'CREATE TABLE "radclients" ("rad_id" INTEGER PRIMARY KEY AUTOINCREMENT,"rad_name" TEXT, "rad_ip" TEXT, "rad_secret" TEXT, "rad_desc" TEXT);';