implemented authentication levels of anon,user,admin and setup the
[gwvp.git] / gwvplib / gwvpdebug.php
index 47e630f..3793e31 100644 (file)
@@ -6,9 +6,10 @@ $MENU_ITEMS["999debug"]["link"] = "$BASE_URL/debug";
 
 function gwvp_DebugEnabled()
 {
-       global $BASE_URL;
+       global $BASE_URL, $LOGIN_TYPE;
        
        echo "<pre>";
+       echo "USERTYPE: $LOGIN_TYPE\n";
        echo "BASEURL: $BASE_URL\n";
        echo "CUSTOM\n";
        echo "\n\nserver\n";
@@ -86,6 +87,15 @@ function gwvp_DebugCall()
                                        global $db_name;
                                        unlink("$db_name");
                                        gwvp_dbCreateSQLiteStructure("$db_name");
+                                       //gwvp_createGroup($group_name, $is_admin, $owner_id)
+                                       //gwvp_createUser($email, $fullname, $password, $username, $desc, $status)
+                                       //gwvp_addGroupMember($email, $groupname)
+                                       gwvp_createUser("admin@localhost", "adminer", "password", "admin", "initial admin user", 0);
+                                       gwvp_createGroup("admingroup", 1, gwvp_getUserId("admin@localhost"));
+                                       gwvp_addGroupMember("admin@localhost", "admingroup");
+                                       gwvp_createUser("user@localhost", "userer", "password", "user", "initial pleb user", 0);
+                                       gwvp_createGroup("usergroup", 0, gwvp_getUserId("user@localhost"));
+                                       gwvp_addGroupMember("user@localhost", "usergroup");
                                        gwvp_SendMessage("info", "blank db re-created");
                                        header("Location: $BASE_URL/debug");
                                        break;