started work on the repo page
[gwvp.git] / gwvplib / gwvpdebug.php
index ae98816..b1df458 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";
@@ -59,7 +60,7 @@ function gwvp_DebugCall()
                                        header("Location: $BASE_URL/debug");
                                        break;
                                case "createusersandgroups":
-                                       // gwvp_createUser($email, $fullname, $password, $nick, $desc, $status)
+                                       // gwvp_createUser($email, $fullname, $password, $username, $desc, $status)
                                        for($i=20; $i<120; $i++) {
                                                gwvp_createUser("test$i@test.com", "test$i", "asdf", "test$i", "test$i user", 0);
                                        }
@@ -86,7 +87,21 @@ 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");
+                                       
+                                       gwvp_AddRepo("repo1", "this is a test repo1", 1);
+                                       gwvp_AddRepo("repo2", "this is a test repo2", 1);
+                                       gwvp_AddRepo("repo2", "this is a test repo3", 1);
+                                       
                                        header("Location: $BASE_URL/debug");
                                        break;
                                case "dropallusersandgroups":