From ed1c86a90a6aa87dfc8b90c2242697a73039bfad Mon Sep 17 00:00:00 2001 From: paulr Date: Sat, 12 Feb 2011 10:06:40 +1100 Subject: [PATCH] minor updates --- gaas/lib/gaasdLib.php | 9 ++++----- gaas/lib/gaasdMessages.php | 14 +++++++++++--- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/gaas/lib/gaasdLib.php b/gaas/lib/gaasdLib.php index e980986..a2b50de 100644 --- a/gaas/lib/gaasdLib.php +++ b/gaas/lib/gaasdLib.php @@ -49,11 +49,10 @@ 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_otk" 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);'; diff --git a/gaas/lib/gaasdMessages.php b/gaas/lib/gaasdMessages.php index 8c6e2da..3b23da4 100644 --- a/gaas/lib/gaasdMessages.php +++ b/gaas/lib/gaasdMessages.php @@ -152,14 +152,18 @@ function gaasSetADLogin_server($msg) function gaasSetAdminGroup_server($msg) { - confSetVal("ad.admindef", $msg["admingroup"]); + if(confGetVal("backend") == "AD") { + confSetVal("ad.admindef", $msg["admingroup"]); + } else return false; return true; } function gaasSetClientGroup_server($msg) { - confSetVal("ad.clientdef", $msg["clientgroup"]); + if(confGetVal("backend") == "AD") { + confSetVal("ad.clientdef", $msg["clientgroup"]); + } else return false; return true; } @@ -168,7 +172,11 @@ function gaasProvisionUser_server($msg) { // function userInGroup($user, $domain, $adlogin, $adpass, $group) - userInGroup($msg["username"], confGetVal("ad.domain"), confGetVal("ad.user", $adlogin), confGetVal("ad.pass"), confGetVal("ad.clientdef")); + if(confGetVal("backend") == "AD") { + userInGroup($msg["username"], confGetVal("ad.domain"), confGetVal("ad.user", $adlogin), confGetVal("ad.pass"), confGetVal("ad.clientdef")); + } else { + // internal db + } return true; -- 1.7.0.4