X-Git-Url: http://git.pjr.cc/?p=gwvp.git;a=blobdiff_plain;f=gwvplib%2Fgwvpdebug.php;h=ae98816ca61685c4c107a42472ac93bb4d6f625d;hp=c580ad1887abbed66690b821242b05615ba76b2a;hb=047523a5083efd83dcd94b6d2763c9fddb913c90;hpb=d31646570a19d6fb66d2f648cd282e2b2e3e7033
diff --git a/gwvplib/gwvpdebug.php b/gwvplib/gwvpdebug.php
index c580ad1..ae98816 100644
--- a/gwvplib/gwvpdebug.php
+++ b/gwvplib/gwvpdebug.php
@@ -58,6 +58,45 @@ function gwvp_DebugCall()
gwvp_SendMessage("info", "random message");
header("Location: $BASE_URL/debug");
break;
+ case "createusersandgroups":
+ // gwvp_createUser($email, $fullname, $password, $nick, $desc, $status)
+ for($i=20; $i<120; $i++) {
+ gwvp_createUser("test$i@test.com", "test$i", "asdf", "test$i", "test$i user", 0);
+ }
+
+ // function gwvp_createGroup($group_name, $is_admin, $owner_id)
+ for($i=20; $i<40; $i++) {
+ if(($i%5) == 0) $isadmin = 1;
+ else $isadmin = 0;
+ gwvp_createGroup("testgroup$i", "$isadmin", "$i");
+ }
+
+ // gwvp_addGroupMember($email, $groupname)
+ //
+ for($i=20; $i<120; $i++) {
+ for($k=0; $k<4; $k++) {
+ $gid = rand(20,39);
+ gwvp_addGroupMember("test$i@test.com", "testgroup$gid");
+ }
+ }
+ gwvp_SendMessage("info", "Create users and groups done");
+ header("Location: $BASE_URL/debug");
+ break;
+ case "recreatedb":
+ global $db_name;
+ unlink("$db_name");
+ gwvp_dbCreateSQLiteStructure("$db_name");
+ gwvp_SendMessage("info", "blank db re-created");
+ header("Location: $BASE_URL/debug");
+ break;
+ case "dropallusersandgroups":
+ $conn = gwvp_ConnectDB();
+ $conn->query("delete from users");
+ $conn->query("delete from groups");
+ $conn->query("delete from group_membership");
+ gwvp_SendMessage("info", "Drop all users and groups done");
+ header("Location: $BASE_URL/debug");
+ break;
default:
gwvp_goMainPage("gwvp_DebugBody");
return;
@@ -74,6 +113,9 @@ function gwvp_DebugBody()
?>
Generate error message
Generate info message
+ Create a bunch of users and groups
+ Drop users/groups/groupmemberships
+ Recreate db