moved the old git poc code off and away from the main directory
[gwvp.git] / gwvplib / gwvpdebug.php
index dcc7c7a..4a5c303 100644 (file)
@@ -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 "<pre>";
        if(isset($_SERVER["PHP_AUTH_USER"])) error_log("authuser: ".$_SERVER["PHP_AUTH_USER"]."\n");
        echo "USERTYPE: $LOGIN_TYPE\n";
@@ -148,6 +163,8 @@ function gwvp_DebugCall()
 function gwvp_DebugBody()
 {
        global $BASE_URL;
+       
+       
        ?>
        <a href="<?php echo $BASE_URL?>/debug/errormessage">Generate error message</a><br>
        <a href="<?php echo $BASE_URL?>/debug/infomessage">Generate info message</a><br>