added some code to deal with username case (made it all lower)
[ga4php.git] / gaas / lib / globalLib.php
index bbfd2fc..79857cf 100644 (file)
@@ -9,6 +9,30 @@ $TCP_PORT_NUMBER = 21256;
 global $TCP_PORT_NUMBER;
 
 
+/* tasks we need to do (- prefix means done or working)
+ * - status
+ * - init
+ * - set ad login
+ * - set ad client group
+ * - set ad admin group
+ * - provision user
+ * - get users
+ * - delete user
+ * - create hardware token
+ * - list hardware tokens
+ * - assign hardware token
+ * disable user
+ * set user password
+ * enable admin for user
+ * disable admin for user
+ * resync token
+ * get qrcode
+ * re-create user token
+ * set user pin
+ * authenticate user by token
+ * authenticate user by password
+ * 
+ */
 
 
 // the messages structure, used to extend gaas if needed
@@ -26,11 +50,11 @@ define("MSG_GET_HARDWARE",28);
 
 // the gaasd call's $MESSAGE[<MSG>]_server() for the server side
 // and $MESSAGE[<msg>]_client() for the client side 
-$MESSAGES[MSG_STATUS] = "gaasStatus";
-$MESSAGES[MSG_INIT_SERVER] = "gaasInitServer"; 
+$MESSAGES[MSG_STATUS] = "gaasStatus"; //
+$MESSAGES[MSG_INIT_SERVER] = "gaasInitServer"; // AD: "AD", "user", "pass", "domain", "client def", "admin def" - IN: "IN", "user", "pass"
 $MESSAGES[MSG_SET_AD_LOGIN] = "gaasSetADLogin"; // domain, user, password
 $MESSAGES[MSG_SET_CLIENT_GROUP] = "gaasSetClientGroup"; // groupname
-$MESSAGES[MSG_SET_ADMIN_GROUP] = "gaasSetAdminGroup";
+$MESSAGES[MSG_SET_ADMIN_GROUP] = "gaasSetAdminGroup"; // groupname
 $MESSAGES[MSG_PROVISION_USER] = "gaasProvisionUser"; // username, tokentype, tokenkey, hardware|software
 $MESSAGES[MSG_GET_USERS] = "gaasGetUsers"; // [admin|client], [name pattern], [only with tokens]
 $MESSAGES[MSG_DELETE_USER] = "gaasDeleteUser"; // username
@@ -208,7 +232,9 @@ function getUsersInGroup($domain, $adlogin, $adpass, $group)
        $i = 0;
        foreach($info as $kpot => $lpot) {
                if(isset($lpot["samaccountname"])) {
-                       $arbi[$lpot["samaccountname"][0]] =  $lpot["name"][0];
+                       $arbi[$i]["realname"] =  $lpot["name"][0];
+                       $arbi[$i]["username"] = strtolower($lpot["samaccountname"][0]);
+                       $i++;
                }
        }