removing all the error logging for now
authorPaul J R <me@pjr.cc>
Fri, 28 Sep 2012 00:21:45 +0000 (10:21 +1000)
committerPaul J R <me@pjr.cc>
Fri, 28 Sep 2012 00:21:45 +0000 (10:21 +1000)
gwvpmini/gwvpmini_admin.php
gwvpmini/gwvpmini_auth.php
gwvpmini/gwvpmini_db.php
gwvpmini/gwvpmini_gitbackend.php
gwvpmini/gwvpmini_gitrepo.php
gwvpmini/gwvpmini_register.php
gwvpmini/gwvpmini_search.php
gwvpmini/gwvpmini_user.php
gwvpmini/gwvpmini_view.php
gwvpmini/gwvpmini_web.php
www/index.php

index defb0da..2ba9963 100644 (file)
@@ -14,7 +14,7 @@ if($IS_WEB_REQUEST) {
 function gwvpmini_AdminCallMe()\r
 {\r
 \r
-       //error_log("in admin callme");\r
+       //// // error_log("in admin callme");\r
        if(isset($_REQUEST["q"])) {\r
                $query = $_REQUEST["q"];\r
                $qspl = explode("/", $query);\r
@@ -61,7 +61,7 @@ function gwvpmini_AdminCallMe()
                                                return "gwvpmini_SwitchAdmin";
                                        }
                                } else {\r
-                                       error_log("i got here, where next?");\r
+                                       // // error_log("i got here, where next?");\r
                                        return "gwvpmini_AdminMainPage";\r
                                }\r
                        } else return false;\r
@@ -155,7 +155,7 @@ function gwvpmini_AdminMainPageBody()
                        $cstat = "Disable";
                } else  if($st_t[0] == "2") {
                        $vl = explode(":", $st_t);
-                       error_log("VL: ".print_r($vl, true));
+                       // // error_log("VL: ".print_r($vl, true));
                        $status = " Awaiting Confirmation (<a href=\"$BASE_URL/register/confirmreg/".$vl[1]."\">Confirm</a>)";
                }
                
@@ -327,7 +327,7 @@ function gwvpmini_RemoveUserPageBody()
                $email = $details[$uid]["email"];
                $desc = $details[$uid]["desc"];
                
-               error_log("user dets:".print_r($details, true));
+               //// // error_log("user dets:".print_r($details, true));
                
                echo "<h2>Remove User?</h2>";
                echo "Are you sure you wish to remove the user, $username ($uid) - $fullname - $email - $desc?<br>";
@@ -371,7 +371,7 @@ function gwvpmini_RemoveRepoPageBody()
                $fullname = $usedet["fullname"];
                \r
 \r
-               error_log("user dets:".print_r($details, true));\r
+               // // error_log("user dets:".print_r($details, true));\r
 \r
                echo "<h2>Remove User?</h2>";\r
                echo "Are you sure you wish to remove the repo, <b>$rname</b> ($rid) - \"$rdesc\" $ownedby?<br>";\r
@@ -389,7 +389,7 @@ function gwvpmini_ConfRemoveRepo()
        global $BASE_URL;\r
 
        
-       error_log("CONF REMOVE REPO");
+       // // error_log("CONF REMOVE REPO");
        \r
        $rid = -1;\r
        if(isset($_REQUEST["q"])) {\r
index fc75359..1e4d579 100644 (file)
@@ -7,7 +7,7 @@ $CALL_ME_FUNCTIONS["auth"] = "gwvpmini_AuthCallMe";
 function gwvpmini_AuthCallMe()\r
 {\r
 \r
-       //error_log("in repoadmin callme");\r
+       //// error_log("in repoadmin callme");\r
        if(isset($_REQUEST["q"])) {\r
                $query = $_REQUEST["q"];\r
                $qspl = explode("/", $query);\r
@@ -98,7 +98,7 @@ function gwvpmini_isLoggedIn()
 
 function gwvpmini_AskForBasicAuth()\r
 {
-       error_log("SEND BASIC AUTH");
+       // error_log("SEND BASIC AUTH");
        header_remove("Pragma");
        header_remove("Cache-Control");\r
        header_remove("Set-Cookie");
@@ -124,14 +124,14 @@ function gwvpmini_checkBasicAuthLogin()
                $pass = $_SERVER["PHP_AUTH_PW"];\r
        } else return false;
        \r
-       error_log("IN CHECK FOR BASIC AUTH: $user");\r
+       // error_log("IN CHECK FOR BASIC AUTH: $user");\r
        \r
-       error_log("passing basic auth for $user, $pass to backend");\r
+       // error_log("passing basic auth for $user, $pass to backend");\r
        $auth = gwvpmini_authUserPass($user, $pass);\r
        if($auth !== false) {\r
-               error_log("auth passes");\r
+               // error_log("auth passes");\r
        } else {\r
-               error_log("auth failes");\r
+               // error_log("auth failes");\r
        }\r
 \r
        return $auth;\r
@@ -159,7 +159,7 @@ function gwvpmini_authUserPass($user, $pass)
 {
        $details = gwvpmini_getUser($user);
        if($details == false) {
-               error_log("no user details for $user");
+               // error_log("no user details for $user");
                return false;
        }
        
index bb679b8..0f11ec9 100644 (file)
@@ -6,7 +6,7 @@ $DB_CONNECTION = false;
 \r
 \r
 global $db_url, $db_type;\r
-//error_log("in include for database, $db_type, $db_name");
+//// error_log("in include for database, $db_type, $db_name");
 
 
 function gwvpmini_DBExists()
@@ -14,15 +14,15 @@ function gwvpmini_DBExists()
        global $WEB_ROOT_FS, $BASE_URL, $data_directory, $db_type, $db_name;
        
        // oh this isnt working. poo.
-       //error_log("checking for $db_name, $db_type");
+       //// error_log("checking for $db_name, $db_type");
        
        if($db_type == "sqlite") {
                if(file_exists($db_name)) {
-                       //error_log("Exists");
+                       //// error_log("Exists");
                        return true;
                }
                else {
-                       //error_log("no exists");
+                       //// error_log("no exists");
                        return false;
                }
        }
@@ -108,7 +108,7 @@ function gwvpmini_ChangeRepoPerm($rid, $uid, $acc)
        
        $res = $conn->query($sql);
        
-       error_log("CHANGEREPOPERMS: call with $rid, $uid, $acc");
+       // error_log("CHANGEREPOPERMS: call with $rid, $uid, $acc");
        
        $cperms_t = "";
        foreach($res as $row) {
@@ -125,12 +125,12 @@ function gwvpmini_ChangeRepoPerm($rid, $uid, $acc)
                        $permsarray = unserialize(base64_decode($cperms_t));
                        $permsarray[$uid] = $acc;
                        if($acc == 0) {
-                               error_log("PERMSUPDATE: REMOVE $uid");
+                               // error_log("PERMSUPDATE: REMOVE $uid");
                                unset($permsarray[$uid]);
                        }
                }
        } else {
-               error_log("CHANGEREPOPERMS for b of $acc");
+               // error_log("CHANGEREPOPERMS for b of $acc");
                $permsarray["b"] = $acc;
        }
        
@@ -138,7 +138,7 @@ function gwvpmini_ChangeRepoPerm($rid, $uid, $acc)
        if($permsarray["b"] == "a" || $permsarray["b"] == "r") {
                foreach($permsarray as $key => $val) {
                        if($val == 1) {
-                               error_log("CHANGEREPOPERMS removed $key $val for base perm change");
+                               // error_log("CHANGEREPOPERMS removed $key $val for base perm change");
                                unset($permsarray[$key]);
                        }
                }
@@ -159,7 +159,7 @@ function gwvpmini_ChangeRepoPerm($rid, $uid, $acc)
        
        $sql = "update repos set repos_perms='$encperms' where repos_id='$rid'";\r
 
-       error_log("PERMSARRAYNOW $sql ".print_r($permsarray,true));\r
+       // error_log("PERMSARRAYNOW $sql ".print_r($permsarray,true));\r
        
        $conn->query($sql);
        
@@ -203,7 +203,7 @@ function gwvpmini_GetRepoPerm($rid, $uid)
        \r
        if($cperms_t === false) return 0;
        
-       error_log("PERMSCHECK $rid, $uid:".print_r($dets, true));\r
+       // error_log("PERMSCHECK $rid, $uid:".print_r($dets, true));\r
        \r
        if($dets === false) return 0;
        
@@ -211,7 +211,7 @@ function gwvpmini_GetRepoPerm($rid, $uid)
        \r
        $permsarray = unserialize(base64_decode($cperms_t));
        
-       error_log("PERMSARRAY: ".print_r($permsarray,true));
+       // error_log("PERMSARRAY: ".print_r($permsarray,true));
        
        
        $perm = 0;
@@ -359,7 +359,7 @@ function gwvpmini_ConnectDB()
        global $WEB_ROOT_FS, $BASE_URL, $data_directory, $db_type, $db_name, $DB_CONNECTION;\r
 \r
        // first check if $DB_CONNECTION IS live\r
-       //error_log("in connection $db_type, $db_name");
+       //// error_log("in connection $db_type, $db_name");
        $db_url = false;\r
 \r
        if($DB_CONNECTION != false) return $DB_CONNECTION;\r
@@ -367,7 +367,7 @@ function gwvpmini_ConnectDB()
        if($db_type == "sqlite") {\r
                $db_url = $db_name;\r
                if(!file_exists($db_name)) {\r
-                       //error_log("$db_name does not exist - problem");
+                       //// error_log("$db_name does not exist - problem");
                        // TODO: NEED A SETUP AGENT!
                        gwvpmini_dbCreateSQLiteStructure($db_name);
                        gwvpmini_setConfigVal("repodir", "$data_directory/repos");\r
@@ -375,11 +375,11 @@ function gwvpmini_ConnectDB()
        }\r
 \r
        // and here we go with pdo.\r
-       error_log("attmpting to open db, $db_type:$db_url");\r
+       // error_log("attmpting to open db, $db_type:$db_url");\r
        try {\r
                $DB_CONNECTION = new PDO("$db_type:$db_url");\r
        } catch(PDOException $exep) {\r
-               error_log("execpt on db open");\r
+               // error_log("execpt on db open");\r
                return false;\r
        }\r
 \r
@@ -478,7 +478,7 @@ function gwvpmini_AddActivityLog($type, $userid, $repoid, $commitid, $commitlog)
        \r
        $sql = "insert into 'activity' values ( null, '$type', '".time()."', '$userid', '$repoid', '$commitid', '$commitlog', '$visibleto')";
        
-       error_log("SQL IS $sql");\r
+       // error_log("SQL IS $sql");\r
        \r
        $res = $conn->query($sql);\r
        if(!$res) return -1;
@@ -553,7 +553,7 @@ function gwvpmini_dbCreateSQLiteStructure($dbloc)
        try {\r
                $DB_CONNECTION = new PDO("sqlite:$dbloc");\r
        } catch(PDOException $exep) {\r
-               error_log("execpt on db open");\r
+               // error_log("execpt on db open");\r
                return false;\r
        }\r
 
@@ -654,7 +654,7 @@ function gwvpmini_GetRepoDescFromName($reponame)
        $conn = gwvpmini_ConnectDB();\r
 \r
        $sql = "select repos_description from repos where repos_name='$reponame'";
-       error_log("desc for name sql: $sql");\r
+       // error_log("desc for name sql: $sql");\r
 \r
        $res = $conn->query($sql);\r
 \r
@@ -701,7 +701,7 @@ function gwvpmini_GetRepoOwnerDetailsFromName($reponame)
        if(!$res) return -1;\r
        foreach($res as $row) {
                $retval = array();
-               error_log("STUFF2: ".print_r($row,true));\r
+               // error_log("STUFF2: ".print_r($row,true));\r
                $retval["id"] = $row["user_id"];
                $retval["fullname"] = $row["user_full_name"];
                $retval["username"] = $row["user_username"];
@@ -739,7 +739,7 @@ function gwvpmini_setConfigVal($confname, $confval)
 function gwvpmini_AddRepo($name, $desc, $ownerid)
 {
        
-       error_log("addrepo in db for $name, $desc, $ownerid");
+       // error_log("addrepo in db for $name, $desc, $ownerid");
        $conn = gwvpmini_ConnectDB();\r
        
        $perms["b"] = "a";
@@ -757,7 +757,7 @@ function gwvpmini_GetUserId($username)
        
        $sql = "select user_id from users where user_username='$username'";
 
-       error_log("userid sql $sql");\r
+       // error_log("userid sql $sql");\r
        
        $res = $conn->query($sql);
        
@@ -775,7 +775,7 @@ function gwvpmini_GetUserNameFromEmail($email)
 \r
        $sql = "select user_username from users where user_email='$email'";\r
 \r
-       error_log("username sql $sql");\r
+       // error_log("username sql $sql");\r
 \r
        $res = $conn->query($sql);\r
 \r
@@ -803,7 +803,7 @@ function gwvpmini_GetOwnedRepos($username)
        
        $uid = gwvpmini_GetUserId($username);
        $sql = "select * from repos where repos_owner='$uid'";
-       error_log("owned repos sql $sql for username $username");
+       // error_log("owned repos sql $sql for username $username");
        $res = $conn->query($sql);
        if($username == "") return false;\r
        
@@ -814,10 +814,10 @@ function gwvpmini_GetOwnedRepos($username)
                $retval[$id]["desc"] = $row["repos_description"];
                $retval[$id]["id"] = $row["repos_id"];
                $retval[$id]["status"] = $row["repos_status"];
-               error_log(print_r($row, true));
+               // error_log(print_r($row, true));
        }
        
-       error_log(print_r($retval, true));\r
+       // error_log(print_r($retval, true));\r
        return $retval;\r
 }
 
@@ -845,7 +845,7 @@ function gwvpmini_GetContributedRepos($username)
        $i = 0;\r
        foreach($res as $row) {
                $perms = unserialize(base64_decode($row["repos_perms"]));
-               error_log("CONTRIB: $uid for ".$row["repos_id"]." - ".print_r($perms,true));
+               // error_log("CONTRIB: $uid for ".$row["repos_id"]." - ".print_r($perms,true));
                if(isset($perms["$uid"])) if($perms["$uid"] > 1) {
                        $rids[$i]["id"] = $row["repos_id"];
                        $rids[$i]["desc"] = $row["repos_description"];
@@ -858,11 +858,11 @@ function gwvpmini_GetContributedRepos($username)
        $retval = $rids;
        
        if($i == 0) {
-               error_log("CONTRIBREPOS: no repos found?");
+               // error_log("CONTRIBREPOS: no repos found?");
                return false;
        }\r
 \r
-       error_log("CONTRIBREPOS: ".print_r($retval, true));\r
+       // error_log("CONTRIBREPOS: ".print_r($retval, true));\r
        return $retval;\r
 }
 
@@ -928,10 +928,10 @@ function gwvpmini_findPeopleLike($search)
        $res = $conn->query($sql);
        
        if(!$res) {
-               error_log("SERACHUSER: $sql returned false");
+               // error_log("SERACHUSER: $sql returned false");
                return false;
        } else {
-               error_log("SERACHUSER: $sql returned true");
+               // error_log("SERACHUSER: $sql returned true");
        }\r
        \r
        $retval = false;\r
@@ -946,7 +946,7 @@ function gwvpmini_findPeopleLike($search)
                $retval[$id]["id"] = $row["user_id"];\r
        }\r
        
-       error_log("SEARCHUSER: array is ".print_r($retval, true));\r
+       // error_log("SEARCHUSER: array is ".print_r($retval, true));\r
        return $retval;
 }
 
index a184213..4cb53b8 100644 (file)
@@ -30,7 +30,7 @@ function gwvpmini_CreateRepoHooks($repopath, $cmdpath)
 {
        $fp = fopen("$repopath/hooks/pre-receive", "w");
        
-       if(!$fp) error_log("could not create pre-receive hook");
+       if(!$fp) // error_log("could not create pre-receive hook");
        
        // TODO: think about this one
        $script = '#!/bin/bash'."\n\n".'DCOMMIT=`cat`'."\n".'START=`echo $DCOMMIT|cut -d " " -f 1`'."\n".'END=`echo $DCOMMIT|cut -d " " -f 2`'."\n".'REF=`echo $DCOMMIT|cut -d " " -f 3`'."\n\n";
@@ -45,7 +45,7 @@ function gwvpmini_CreateRepoHooks($repopath, $cmdpath)
 
        $fp = fopen("$repopath/hooks/update", "w");
        
-       if(!$fp) error_log("could not create update hook");
+       if(!$fp) // error_log("could not create update hook");
        
        // TODO: think about this one
        $script = "#!/bin/bash\n\n";
@@ -77,13 +77,13 @@ function gwvpmini_gitBackendInterface()
        
        
        /* bizare git problem that ignores 403's or continues on with a push despite them 
-       error_log("FLAP for ".$_SERVER["REQUEST_URI"]);
+       // error_log("FLAP for ".$_SERVER["REQUEST_URI"]);
        if(isset($_REQUEST)) {
                $dump = print_r($_REQUEST, true);
-               error_log("FLAP, $dump");
+               // error_log("FLAP, $dump");
        }
        if(isset($_SERVER["PHP_AUTH_USER"])) {
-               error_log("FLAP: donut hole");
+               // error_log("FLAP: donut hole");
        }*/
        
 
@@ -112,7 +112,7 @@ function gwvpmini_gitBackendInterface()
        exec("/usr/bin/git update-server-info");
        
        if(!file_exists("$repo_base/$repo.git/hooks/pre-receive") || !file_exists("$repo_base/$repo.git/hooks/update")) {
-               error_log("WRITING HOOKS");
+               // error_log("WRITING HOOKS");
                gwvpmini_CreateRepoHooks("$repo_base/$repo.git", $cmd_line_tool);
        }
        
@@ -124,7 +124,7 @@ function gwvpmini_gitBackendInterface()
        $write = false;
        if(isset($_REQUEST["service"])) {
                if($_REQUEST["service"] == "git-receive-pack") {
-                       error_log("got write as receivepack in post");
+                       // error_log("got write as receivepack in post");
                        $write = true;
                }
        }
@@ -142,17 +142,17 @@ function gwvpmini_gitBackendInterface()
        // next, figure out permissions for repo
        $rid = gwvpmini_GetRepoId($repo);
        $uid = -1;
-       error_log("AT THIS POINT WE HAVE $uid, $rid, $repo $person");
+       // error_log("AT THIS POINT WE HAVE $uid, $rid, $repo $person");
        
        if(!$person) {
                if($write) {
-                       error_log("ASK FOR BASIC AUTH");
+                       // error_log("ASK FOR BASIC AUTH");
                        gwvpmini_AskForBasicAuth();
                        return;
                } else {
                        $perm = gwvpmini_GetRepoPerm($rid, "a");
                        if($perm < 1) {
-                               error_log("ASK FOR BASIC AUTH 2");
+                               // error_log("ASK FOR BASIC AUTH 2");
                                gwvpmini_AskForBasicAuth();
                                return;
                        }
@@ -162,7 +162,7 @@ function gwvpmini_gitBackendInterface()
                $perm = gwvpmini_GetRepoPerm($rid, $uid);
                if($write) {
                        if($perm < 2) {
-                               error_log("SEND FOFF");
+                               // error_log("SEND FOFF");
                                gwvpmini_fourZeroThree();
                                return;
                        }
@@ -194,15 +194,15 @@ function gwvpmini_gitBackendInterface()
 
        // if we made it this far, we a read and we have permissions to do so, just search the file from the repo
        /*if(file_exists("$repo_base/$repo.git/$newloc")) {
-               error_log("would ask $repo for $repo.git/$newloc from $repo_base/$repo.git/$newloc");
+               // error_log("would ask $repo for $repo.git/$newloc from $repo_base/$repo.git/$newloc");
                $fh = fopen("$repo_base/$repo.git/$newloc", "rb");
                
-               error_log("pushing file");
+               // error_log("pushing file");
                while(!feof($fh)) {
                        echo fread($fh, 8192);
                }
        } else {
-               error_log("would ask $repo for $repo/$newloc from $repo_base/$repo/$newloc, NE");
+               // error_log("would ask $repo for $repo/$newloc from $repo_base/$repo/$newloc, NE");
                gwvpmini_fourZeroFour();
                return;
        }*/
@@ -212,7 +212,7 @@ function gwvpmini_gitBackendInterface()
 function gwvpmini_canManageRepo($userid, $repoid)
 {
        // only the owner or an admin can do these tasks
-       error_log("Checking repoid, $repoid against userid $userid");
+       // error_log("Checking repoid, $repoid against userid $userid");
        
        if(gwvpmini_IsUserAdmin(null, null, $userid)) return true;
        if(gwvpmini_IsRepoOwner($userid, $repoid)) return true;
@@ -239,7 +239,7 @@ function gwvpmini_callGitBackend($username, $repo)
                $qs = "";
                foreach($_REQUEST as $key => $var) {
                        if($key != "q") {
-                               //error_log("adding, $var from $key");
+                               //// error_log("adding, $var from $key");
                                if($qs == "") $qs.="$key=$var";
                                else $qs.="&$key=$var";
                        }
@@ -269,7 +269,7 @@ function gwvpmini_callGitBackend($username, $repo)
                $procenv["REMOTE_ADDR"] = $_SERVER["REMOTE_ADDR"];
                $procenv["AUTH_TYPE"] = "Basic";
                
-               //error_log("PROCENV: ".print_r($procenv,true));
+               //// error_log("PROCENV: ".print_r($procenv,true));
                
                if(isset($_SERVER["CONTENT_TYPE"])) { 
                        $procenv["CONTENT_TYPE"] = $_SERVER["CONTENT_TYPE"];
@@ -280,7 +280,7 @@ function gwvpmini_callGitBackend($username, $repo)
                        $procenv["CONTENT_LENGTH"] = $_SERVER["CONTENT_LENGTH"];
                }
                
-               error_log("path trans'd is /$repo_base/$repo.git/$euri from $ruri with ".$_REQUEST["q"]." $strrem");
+               // error_log("path trans'd is /$repo_base/$repo.git/$euri from $ruri with ".$_REQUEST["q"]." $strrem");
                
                
                
@@ -293,13 +293,13 @@ function gwvpmini_callGitBackend($username, $repo)
                while(!$untilblank&&!feof($pipes[1])) {
                        $lines_t = fgets($pipes[1]);
                        $lines = trim($lines_t);
-                       error_log("got line: $lines");
+                       // error_log("got line: $lines");
                        if($lines_t == "\r\n") {
                                $untilblank = true;
-                               error_log("now blank");
+                               // error_log("now blank");
                        } else header($lines);
                        if($lines === false) {
-                               error_log("got an unexpexted exit...");
+                               // error_log("got an unexpexted exit...");
                                exit(0);
                        }
                        
@@ -310,11 +310,11 @@ function gwvpmini_callGitBackend($username, $repo)
                $continue = true;
                
                if(!stream_set_blocking($fh,0)) {
-                       error_log("cant set input non-blocking");
+                       // error_log("cant set input non-blocking");
                }
 
                if(!stream_set_blocking($pipes[1],0)) {
-                       error_log("cant set pipe1 non-blocking");
+                       // error_log("cant set pipe1 non-blocking");
                }
                
                
@@ -333,7 +333,7 @@ function gwvpmini_callGitBackend($username, $repo)
                                //fwrite($fl, $from_client_data);
                                $client_len = strlen($from_client_data);
                        } else {
-                               error_log("client end");
+                               // error_log("client end");
                                $client_len = 0;
                                //$continue = false;
                        }
@@ -355,9 +355,9 @@ function gwvpmini_callGitBackend($username, $repo)
                                                // TODO: find out why this happens
                                                $from_cgi_data = preg_replace("/^\r\n/", "", $from_cgi_data_t);
                                                if(strlen($from_cgi_data)!=strlen($from_cgi_data_t)) {
-                                                       error_log("MOOOKS - we did trunc");
+                                                       // error_log("MOOOKS - we did trunc");
                                                } else {
-                                                       error_log("MOOOKS - we did not trunc");
+                                                       // error_log("MOOOKS - we did not trunc");
                                                }
                                                $firstline = false;
                                        }
@@ -369,7 +369,7 @@ function gwvpmini_callGitBackend($username, $repo)
                                }
                                $cgi_len = strlen($from_cgi_data);
                        } else {
-                               error_log("cgi end");
+                               // error_log("cgi end");
                                $cgi_len = 0;
                        }
                        
@@ -377,14 +377,14 @@ function gwvpmini_callGitBackend($username, $repo)
                        else {
                                if($client_len == 0 && $cgi_len == 0) {
                                        usleep(200000);
-                                       error_log("sleep tick");
+                                       // error_log("sleep tick");
                                        $stlimit++;
                                        if($stlimit > 2) $continue = false;
                                } else {
                                        $stlimit = 0;
-                                       error_log("sizes: $client_len, $cgi_len");
+                                       // error_log("sizes: $client_len, $cgi_len");
                                        if($cgi_len > 0) {
-                                               error_log("from cgi: \"$from_cgi_data\"");
+                                               // error_log("from cgi: \"$from_cgi_data\"");
                                        }
                                }
                        }
@@ -417,7 +417,7 @@ function gwvpmini_createGitRepo($name, $ownerid, $desc)
        $repo_base = gwvpmini_getConfigVal("repodir");
        
        // phew, this works, but i tell you this - bundles arent quite as nice as they should be
-       error_log("would create $repo_base/$name.git");
+       // error_log("would create $repo_base/$name.git");
        exec("/usr/bin/git init $repo_base/$name.git --bare > /tmp/gitlog 2>&1");
        chdir("$repo_base/$name.git");
        exec("/usr/bin/git update-server-info");
index 502210e..edf8fd6 100644 (file)
@@ -15,15 +15,15 @@ $MENU_ITEMS["10repos"]["link"] = "$BASE_URL/repos";
 function gwvpmini_RepoCallMe()\r
 {\r
 \r
-       error_log("in repoadmin callme - err?");
-       error_log(print_r($_REQUEST, true));\r
+       // error_log("in repoadmin callme - err?");
+       // error_log(print_r($_REQUEST, true));\r
        if(isset($_REQUEST["q"])) {
-               error_log("in repoadmin callme, for Q");\r
+               // error_log("in repoadmin callme, for Q");\r
                $query = $_REQUEST["q"];\r
                $qspl = explode("/", $query);\r
                if(isset($qspl[0])) {\r
                        if($qspl[0] == "repos") {
-                               error_log("in repos call");
+                               // error_log("in repos call");
                                if(isset($qspl[1])) {
                                        if($qspl[1] == "create") {
                                                return "gwvpmini_RepoCreate";
@@ -31,7 +31,7 @@ function gwvpmini_RepoCallMe()
                                                return "gwvpmini_RepoMainPage";
                                        }
                                } else {\r
-                                       error_log("i got here, where next?");\r
+                                       // error_log("i got here, where next?");\r
                                        return "gwvpmini_RepoMainPage";
                                }\r
                        } else return false;\r
@@ -67,7 +67,7 @@ function gwvpmini_RepoMainPageBody()
                                $cmd = "git --git-dir=\"$repo_base/$name.git\" log --all -1 2> /dev/null";
                                echo "<tr><td><a href=\"$BASE_URL/view/$name\">$name</a></td><td>$desc</td>";
                                echo "<td>";\r
-                               error_log("CMD: $cmd");
+                               // error_log("CMD: $cmd");
                                //system("$cmd");
                                $fls = popen($cmd, "r");
                                $tks = "";
@@ -96,7 +96,7 @@ function gwvpmini_RepoMainPageBody()
                                $desc = $repo["desc"];
                                $repo_base = gwvpmini_getConfigVal("repodir");\r
                                $cmd = "git --git-dir=\"$repo_base/$name.git\" log --all -1 2> /dev/null";
-                               error_log("CMD: $cmd");
+                               // error_log("CMD: $cmd");
                                //system("$cmd");
                                $fls = popen($cmd, "r");
                                $tks = "";
@@ -152,7 +152,7 @@ function gwvpmini_GitLogProvider()
                                echo "<td>";
                                $repo_base = gwvpmini_getConfigVal("repodir");
                                $cmd = "git --git-dir=\"$repo_base/$name.git\" log --all -1 2> /dev/null";
-                               error_log("CMD: $cmd");
+                               // error_log("CMD: $cmd");
                                //system("$cmd");
                                $fls = popen($cmd, "r");
                                $tks = "";
@@ -255,7 +255,7 @@ function gwvpmini_RemoveRepo($rid)
        
        $rname = $repdet["name"];
        
-       error_log("FROM PANTS:".print_r($repdet,true)." ----------- ".print_r($rname, true));
+       // error_log("FROM PANTS:".print_r($repdet,true)." ----------- ".print_r($rname, true));
        
        if($repdet != false && $rname != "") {
                if(file_exists("$repo_base/$rname.git")) {
@@ -269,7 +269,7 @@ function gwvpmini_RemoveRepo($rid)
 
 function gwvpmini_RecursiveDelete($fpath)
 {
-       error_log("RECURSEDETELE: ".$fpath);
+       // error_log("RECURSEDETELE: ".$fpath);
        if(is_file($fpath)){\r
                return @unlink($fpath);\r
        }\r
index b0c5147..b913788 100644 (file)
@@ -37,7 +37,7 @@ function gwvpmini_RegisterCallMe()
 {
        
        
-       error_log("in admin callme");
+       // error_log("in admin callme");
        if(isset($_REQUEST["q"])) {
                $query = $_REQUEST["q"];
                $qspl = explode("/", $query);
index 40fae3f..cf2681f 100644 (file)
@@ -10,10 +10,10 @@ $CALL_ME_FUNCTIONS["search"] = "gwvpmini_SearchCallMe";
 function gwvpmini_SearchCallMe()\r
 {\r
 \r
-       error_log("in repoadmin callme - err?");\r
-       error_log(print_r($_REQUEST, true));\r
+       // error_log("in repoadmin callme - err?");\r
+       // error_log(print_r($_REQUEST, true));\r
        if(isset($_REQUEST["q"])) {\r
-               error_log("in repoadmin callme, for Q");\r
+               // error_log("in repoadmin callme, for Q");\r
                $query = $_REQUEST["q"];\r
                $qspl = explode("/", $query);\r
                if(isset($qspl[0])) {\r
index ec7aba5..799ef37 100644 (file)
@@ -37,7 +37,7 @@ function gwvpmini_UserViewCallMe()
 {
        global $user_view_call;
        
-       error_log("in admin callme");
+       // error_log("in admin callme");
        if(isset($_REQUEST["q"])) {
                $query = $_REQUEST["q"];
                $qspl = explode("/", $query);
@@ -89,7 +89,7 @@ function gwvpmini_UserViewPageBody()
        
        
        $dets = gwvpmini_getUser($user_view_call);
-       //error_log("show view of user with $user_view_call: ". print_r($dets, true));\r
+       //// error_log("show view of user with $user_view_call: ". print_r($dets, true));\r
 
        echo "<h2>".$dets["fullname"]."</h2><br>";
        echo gwvpmini_HtmlGravatar($dets["email"],80);
index 165a3c1..642a9bc 100644 (file)
@@ -10,7 +10,7 @@ function gwvpmini_RepoViewCallMe()
 {
        global $repo_view_call;
        
-       error_log("in admin callme");\r
+       // error_log("in admin callme");\r
        if(isset($_REQUEST["q"])) {\r
                $query = $_REQUEST["q"];\r
                $qspl = explode("/", $query);\r
@@ -102,7 +102,7 @@ function gwvpmini_RepoViewPageBody()
        }
        
        
-       error_log("STUFF:".print_r($owner,true));
+       // error_log("STUFF:".print_r($owner,true));
        if($bperms != "a") $login = $_SESSION["username"].":password@";
        else $login = "";
        $cloneurl = "git clone $proto$login$sname$BASE_URL/git/$repo_view_call.git";
@@ -129,7 +129,7 @@ function gwvpmini_RepoViewPageBody()
                if($bperms == "r") $regd = " selected";\r
                if($bperms == "x") $expl = " selected";\r
                
-               error_log("BPERMS: $bperms");
+               // error_log("BPERMS: $bperms");
                
                if($bperms == "x") $cspan = 3;
                else $cspan = 2;
@@ -230,12 +230,12 @@ function gwvpmini_UpdateRepoBasePerms()
        if(isset($_REQUEST["q"])) {\r
                $query = $_REQUEST["q"];\r
                $qspl = explode("/", $query);
-               error_log("PLOOP:qview".print_r($qspl, true));\r
+               // error_log("PLOOP:qview".print_r($qspl, true));\r
        }
        
        if(isset($qspl[1])) $repo_view_call = $qspl[1];
        else {
-               error_log("PLOOP: no repo name");
+               // error_log("PLOOP: no repo name");
                header("Location: $BASE_URL/view/$repo_view_call");
                return;
        }
@@ -258,9 +258,9 @@ function gwvpmini_UpdateRepoBasePerms()
        
        if(!$owner_view) {
                gwvpmini_SendMessage("error", "failure updating permission for repo");
-               error_log("PLOOP: attempt to update from non-owner");
+               // error_log("PLOOP: attempt to update from non-owner");
        } else {
-               error_log("PLOOP: updateds: ".print_r($_REQUEST, true));
+               // error_log("PLOOP: updateds: ".print_r($_REQUEST, true));
                gwvpmini_ChangeRepoPerm($rid, "b", $_REQUEST["base_perms"]);
                gwvpmini_SendMessage("info", "Base permissions for repo updated");
        }\r
@@ -275,12 +275,12 @@ function gwvpmini_AddRepoReader()
        if(isset($_REQUEST["q"])) {\r
                $query = $_REQUEST["q"];\r
                $qspl = explode("/", $query);\r
-               error_log("PLOOP:qview".print_r($qspl, true));\r
+               // error_log("PLOOP:qview".print_r($qspl, true));\r
        }\r
        \r
        if(isset($qspl[1])) $repo_view_call = $qspl[1];\r
        else {\r
-               error_log("PLOOP: no repo name");
+               // error_log("PLOOP: no repo name");
                // TODO: btw, this makes no sense\r
                header("Location: $BASE_URL/view/$repo_view_call");\r
                return;\r
@@ -301,7 +301,7 @@ function gwvpmini_AddRepoReader()
        }
        if(!$owner_view) {
                gwvpmini_SendMessage("error", "failure updating permission for repo");\r
-               error_log("PLOOP: attempt to update from non-owner");
+               // error_log("PLOOP: attempt to update from non-owner");
                header("Location: $BASE_URL/view/$repo_view_call");
                return;
        }\r
@@ -337,12 +337,12 @@ function gwvpmini_AddRepoContributor()
        if(isset($_REQUEST["q"])) {\r
                $query = $_REQUEST["q"];\r
                $qspl = explode("/", $query);\r
-               error_log("PLOOP:qview".print_r($qspl, true));\r
+               // error_log("PLOOP:qview".print_r($qspl, true));\r
        }\r
        \r
        if(isset($qspl[1])) $repo_view_call = $qspl[1];\r
        else {\r
-               error_log("PLOOP: no repo name");\r
+               // error_log("PLOOP: no repo name");\r
                // TODO: btw, this makes no sense\r
                header("Location: $BASE_URL/view/$repo_view_call");\r
                return;\r
@@ -363,7 +363,7 @@ function gwvpmini_AddRepoContributor()
        }\r
        if(!$owner_view) {\r
                gwvpmini_SendMessage("error", "failure updating permission for repo");\r
-               error_log("PLOOP: attempt to update from non-owner");\r
+               // error_log("PLOOP: attempt to update from non-owner");\r
                header("Location: $BASE_URL/view/$repo_view_call");\r
                return;\r
        }\r
@@ -398,12 +398,12 @@ function gwvpmini_RemoveRepoContributor()
        if(isset($_REQUEST["q"])) {\r
                $query = $_REQUEST["q"];\r
                $qspl = explode("/", $query);\r
-               error_log("PLOOP:qview".print_r($qspl, true));\r
+               // error_log("PLOOP:qview".print_r($qspl, true));\r
        }\r
        \r
        if(isset($qspl[1])) $repo_view_call = $qspl[1];\r
        else {\r
-               error_log("PLOOP: no repo name");\r
+               // error_log("PLOOP: no repo name");\r
                // TODO: btw, this makes no sense\r
                header("Location: $BASE_URL/view/$repo_view_call");\r
                return;\r
@@ -423,7 +423,7 @@ function gwvpmini_RemoveRepoContributor()
        }\r
        if(!$owner_view) {\r
                gwvpmini_SendMessage("error", "failure updating permission for repo");\r
-               error_log("PLOOP: attempt to update from non-owner");\r
+               // error_log("PLOOP: attempt to update from non-owner");\r
                header("Location: $BASE_URL/view/$repo_view_call");\r
                return;\r
        }
@@ -455,12 +455,12 @@ function gwvpmini_RemoveRepoReader()
        if(isset($_REQUEST["q"])) {\r
                $query = $_REQUEST["q"];\r
                $qspl = explode("/", $query);\r
-               error_log("PLOOP:qview".print_r($qspl, true));\r
+               // error_log("PLOOP:qview".print_r($qspl, true));\r
        }\r
 \r
        if(isset($qspl[1])) $repo_view_call = $qspl[1];\r
        else {\r
-               error_log("PLOOP: no repo name");\r
+               // error_log("PLOOP: no repo name");\r
                // TODO: btw, this makes no sense\r
                header("Location: $BASE_URL/view/$repo_view_call");\r
                return;\r
@@ -480,7 +480,7 @@ function gwvpmini_RemoveRepoReader()
        }\r
        if(!$owner_view) {\r
                gwvpmini_SendMessage("error", "failure updating permission for repo");\r
-               error_log("PLOOP: attempt to update from non-owner");\r
+               // error_log("PLOOP: attempt to update from non-owner");\r
                header("Location: $BASE_URL/view/$repo_view_call");\r
                return;\r
        }\r
@@ -510,12 +510,12 @@ function gwvpmini_RepoUpdateDescription()
        if(isset($_REQUEST["q"])) {\r
                $query = $_REQUEST["q"];\r
                $qspl = explode("/", $query);\r
-               error_log("PLOOP:qview".print_r($qspl, true));\r
+               // error_log("PLOOP:qview".print_r($qspl, true));\r
        }\r
        \r
        if(isset($qspl[1])) $repo_view_call = $qspl[1];\r
        else {\r
-               error_log("PLOOP: no repo name");\r
+               // error_log("PLOOP: no repo name");\r
                // TODO: btw, this makes no sense\r
                header("Location: $BASE_URL/view/$repo_view_call");\r
                return;\r
@@ -535,7 +535,7 @@ function gwvpmini_RepoUpdateDescription()
        }\r
        if(!$owner_view) {\r
                gwvpmini_SendMessage("error", "failure updating description for repo");\r
-               error_log("PLOOP: attempt to update from non-owner");\r
+               // error_log("PLOOP: attempt to update from non-owner");\r
                header("Location: $BASE_URL/view/$repo_view_call");\r
                return;\r
        }\r
index 3dfdde0..4251fb6 100644 (file)
@@ -35,7 +35,7 @@ function gwvpmini_goWeb()
        
        ksort($CALL_ME_FUNCTIONS);
        foreach($CALL_ME_FUNCTIONS as $key => $val) {
-               //error_log("checking callmefunction $key as $val");
+               //// error_log("checking callmefunction $key as $val");
                $callme = $val();
                if($callme !== false) {
                        $callme();
@@ -68,7 +68,7 @@ function gwvpmini_goMainPage($bodyFunction = null)
                        while(($file = readdir($dh))!==false) {
                                $mt = preg_match("/.*.css$/", $file);
                                if($mt > 0) {
-                                       error_log("loading css $file");
+                                       // error_log("loading css $file");
                                        echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"$BASE_URL/css/$file\">";
                                        //echo "required $basedir/$file\n";
                                }
@@ -83,7 +83,7 @@ function gwvpmini_goMainPage($bodyFunction = null)
                        while(($file = readdir($dh))!==false) {
                                $mt = preg_match("/.*.js$/", $file);
                                if($mt > 0) {
-                                       error_log("loading js $file");
+                                       // error_log("loading js $file");
                                        echo "<script type=\"text/javascript\" src=\"$BASE_URL/js/$file\"></script>";
                                        //echo "required $basedir/$file\n";
                                }
@@ -126,7 +126,7 @@ function gwvpmini_goMainPage($bodyFunction = null)
                if(function_exists($bodyFunction)) {
                        $bodyFunction();
                } else {
-                       error_log("Got called with non-existant body function, $bodyFunction");
+                       // error_log("Got called with non-existant body function, $bodyFunction");
                        gwvpmini_BodyBuilder();
                }
        }
@@ -177,7 +177,7 @@ function gwvpmini_MenuBuilder()
                $menucolor = "";
                if(isset($_REQUEST["q"])) {
                        $extlink = str_replace("$BASE_URL/", "", $link);
-                       error_log("trying to do replace of $BASE_URL in $link, got $extlink for ".$_REQUEST["q"]);
+                       // error_log("trying to do replace of $BASE_URL in $link, got $extlink for ".$_REQUEST["q"]);
                        if(stristr($_REQUEST["q"], $extlink)!==false) {
                                $menucolor = " bgcolor=\"#ffdddd\"";
                                
@@ -223,7 +223,7 @@ function gwvpmini_BodyBuilder()
        if(isset($HOME_PAGE_PROVIDERS)) {
                ksort($HOME_PAGE_PROVIDERS);
                foreach($HOME_PAGE_PROVIDERS as $provider) {
-                       error_log("Loading home_page_provider, $provider");
+                       // error_log("Loading home_page_provider, $provider");
                        $provider();
                }
        }
@@ -250,13 +250,13 @@ function gwvpmini_emailToUserLink($email)
 
 function gwvpmini_fourZeroThree()
 {
-       error_log("403 called");
+       // error_log("403 called");
        header("HTTP/1.1 403 Permission Denied");
 }
 
 function gwvpmini_fourZeroFour()
 {
-       error_log("404 called");
+       // error_log("404 called");
        header("HTTP/1.1 404 No Such Thing");
 }
 
@@ -279,9 +279,9 @@ function gwvpmini_HtmlGravatar($email, $size, $htmlappend="")
        global $use_gravatar;
        
        if($use_gravatar) {
-               error_log("call to gravatar with yes");
+               // error_log("call to gravatar with yes");
        } else {
-               error_log("call to gravatar with no");
+               // error_log("call to gravatar with no");
        }
        
        if($use_gravatar == false) return "";
index acb44a1..4dc08e8 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-error_log("INCALLSTART ".print_r($_COOKIE, true)." -------------------- ".print_r($_SERVER,true)." ---------- ".print_r($_REQUEST, true));
+// error_log("INCALLSTART ".print_r($_COOKIE, true)." -------------------- ".print_r($_SERVER,true)." ---------- ".print_r($_REQUEST, true));
 $WEB_ROOT_FS = realpath(dirname(__FILE__));\r
 $BASE_URL = dirname($_SERVER["PHP_SELF"]);\r
 \r
@@ -20,7 +20,7 @@ if(isset($noconfig)) {
        return;
 }
 
-error_log("CMDLINETOOL: ".$cmd_line_tool);
+// error_log("CMDLINETOOL: ".$cmd_line_tool);
 
 // need to make this db agnostic
 if(!gwvpmini_DBExists($db_name)) {
@@ -31,7 +31,7 @@ if(!gwvpmini_DBExists($db_name)) {
        gwvpmini_setConfigVal("repodir", "$data_directory/repos");
 }
 
-error_log("REQUEST BEGIN");
+// error_log("REQUEST BEGIN");
 gwvpmini_goWeb();