X-Git-Url: http://git.pjr.cc/?p=gwvp.git;a=blobdiff_plain;f=gwvplib%2Fgwvpdebug.php;h=4a5c3035157c9275935f7e52f44c2211847347c3;hp=2a56674190aae8f9a9641c8e36e7e45483cf27c9;hb=942b821d861aba1da43ef6c999141853e9f8b3a8;hpb=c968cf55b0f366830676c8555cf61e9765277e44 diff --git a/gwvplib/gwvpdebug.php b/gwvplib/gwvpdebug.php index 2a56674..4a5c303 100644 --- a/gwvplib/gwvpdebug.php +++ b/gwvplib/gwvpdebug.php @@ -8,6 +8,21 @@ function gwvp_DebugEnabled() { global $BASE_URL, $LOGIN_TYPE; + $isgitagent = false; + + // tested the user agent bit with jgit from eclipse and normal git... seems to work + if(isset($_SERVER["HTTP_USER_AGENT"])) { + $agent = $_SERVER["HTTP_USER_AGENT"]; + error_log("in git backend with user agent $agent"); + if(stristr($agent, "git")!==false) { + $isgitagent = true; + } + } + + // we dont wan to send this to a git agent + if($isgitagent) return; + + echo "
";
 	if(isset($_SERVER["PHP_AUTH_USER"])) error_log("authuser: ".$_SERVER["PHP_AUTH_USER"]."\n");
 	echo "USERTYPE: $LOGIN_TYPE\n";
@@ -114,12 +129,17 @@ function gwvp_DebugCall()
 					
 					gwvp_SendMessage("info", "blank db re-created");
 					
-					gwvp_AddRepo("repo1", "this is a test repo1", $adminid);
-					gwvp_AddRepo("repo2", "this is a test repo2", $userid1);
-					gwvp_AddRepo("repo3", "this is a test repo3", $userid2);
-					
+					//gwvp_createGitRepo($name, $ownerid, $desc, $bundle=null, $defaultperms=0)
 					gwvp_setConfigVal("repodir", "/tmp/");
 					
+					// TODO change these to create not add.
+					system("rm -rf /tmp/repo1.git /tmp/repo2.git /tmp/repo3.git");
+					gwvp_createGitRepo("repo1", $adminid, "test repo1");
+					gwvp_createGitRepo("repo2", $userid1, "test repo2");
+					gwvp_createGitRepo("repo3", $userid2, "test repo3");
+					
+					
+					
 					header("Location: $BASE_URL/debug");
 					break;
 				case "dropallusersandgroups":
@@ -143,6 +163,8 @@ function gwvp_DebugCall()
 function gwvp_DebugBody()
 {
 	global $BASE_URL;
+	
+	
 	?>
 	Generate error message
Generate info message