From eaa989c5b3d6534276be3c32e089d4ec2b45e395 Mon Sep 17 00:00:00 2001 From: Paul J R Date: Fri, 28 Sep 2012 10:21:45 +1000 Subject: [PATCH] removing all the error logging for now --- gwvpmini/gwvpmini_admin.php | 12 ++++---- gwvpmini/gwvpmini_auth.php | 14 ++++---- gwvpmini/gwvpmini_db.php | 62 +++++++++++++++++++------------------- gwvpmini/gwvpmini_gitbackend.php | 62 +++++++++++++++++++------------------- gwvpmini/gwvpmini_gitrepo.php | 20 ++++++------ gwvpmini/gwvpmini_register.php | 2 +- gwvpmini/gwvpmini_search.php | 6 ++-- gwvpmini/gwvpmini_user.php | 4 +- gwvpmini/gwvpmini_view.php | 44 +++++++++++++------------- gwvpmini/gwvpmini_web.php | 20 ++++++------ www/index.php | 6 ++-- 11 files changed, 126 insertions(+), 126 deletions(-) diff --git a/gwvpmini/gwvpmini_admin.php b/gwvpmini/gwvpmini_admin.php index defb0da..2ba9963 100644 --- a/gwvpmini/gwvpmini_admin.php +++ b/gwvpmini/gwvpmini_admin.php @@ -14,7 +14,7 @@ if($IS_WEB_REQUEST) { function gwvpmini_AdminCallMe() { - //error_log("in admin callme"); + //// // error_log("in admin callme"); if(isset($_REQUEST["q"])) { $query = $_REQUEST["q"]; $qspl = explode("/", $query); @@ -61,7 +61,7 @@ function gwvpmini_AdminCallMe() return "gwvpmini_SwitchAdmin"; } } else { - error_log("i got here, where next?"); + // // error_log("i got here, where next?"); return "gwvpmini_AdminMainPage"; } } else return false; @@ -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 (Confirm)"; } @@ -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 "

Remove User?

"; echo "Are you sure you wish to remove the user, $username ($uid) - $fullname - $email - $desc?
"; @@ -371,7 +371,7 @@ function gwvpmini_RemoveRepoPageBody() $fullname = $usedet["fullname"]; - error_log("user dets:".print_r($details, true)); + // // error_log("user dets:".print_r($details, true)); echo "

Remove User?

"; echo "Are you sure you wish to remove the repo, $rname ($rid) - \"$rdesc\" $ownedby?
"; @@ -389,7 +389,7 @@ function gwvpmini_ConfRemoveRepo() global $BASE_URL; - error_log("CONF REMOVE REPO"); + // // error_log("CONF REMOVE REPO"); $rid = -1; if(isset($_REQUEST["q"])) { diff --git a/gwvpmini/gwvpmini_auth.php b/gwvpmini/gwvpmini_auth.php index fc75359..1e4d579 100644 --- a/gwvpmini/gwvpmini_auth.php +++ b/gwvpmini/gwvpmini_auth.php @@ -7,7 +7,7 @@ $CALL_ME_FUNCTIONS["auth"] = "gwvpmini_AuthCallMe"; function gwvpmini_AuthCallMe() { - //error_log("in repoadmin callme"); + //// error_log("in repoadmin callme"); if(isset($_REQUEST["q"])) { $query = $_REQUEST["q"]; $qspl = explode("/", $query); @@ -98,7 +98,7 @@ function gwvpmini_isLoggedIn() function gwvpmini_AskForBasicAuth() { - error_log("SEND BASIC AUTH"); + // error_log("SEND BASIC AUTH"); header_remove("Pragma"); header_remove("Cache-Control"); header_remove("Set-Cookie"); @@ -124,14 +124,14 @@ function gwvpmini_checkBasicAuthLogin() $pass = $_SERVER["PHP_AUTH_PW"]; } else return false; - error_log("IN CHECK FOR BASIC AUTH: $user"); + // error_log("IN CHECK FOR BASIC AUTH: $user"); - error_log("passing basic auth for $user, $pass to backend"); + // error_log("passing basic auth for $user, $pass to backend"); $auth = gwvpmini_authUserPass($user, $pass); if($auth !== false) { - error_log("auth passes"); + // error_log("auth passes"); } else { - error_log("auth failes"); + // error_log("auth failes"); } return $auth; @@ -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; } diff --git a/gwvpmini/gwvpmini_db.php b/gwvpmini/gwvpmini_db.php index bb679b8..0f11ec9 100644 --- a/gwvpmini/gwvpmini_db.php +++ b/gwvpmini/gwvpmini_db.php @@ -6,7 +6,7 @@ $DB_CONNECTION = false; global $db_url, $db_type; -//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'"; - error_log("PERMSARRAYNOW $sql ".print_r($permsarray,true)); + // error_log("PERMSARRAYNOW $sql ".print_r($permsarray,true)); $conn->query($sql); @@ -203,7 +203,7 @@ function gwvpmini_GetRepoPerm($rid, $uid) if($cperms_t === false) return 0; - error_log("PERMSCHECK $rid, $uid:".print_r($dets, true)); + // error_log("PERMSCHECK $rid, $uid:".print_r($dets, true)); if($dets === false) return 0; @@ -211,7 +211,7 @@ function gwvpmini_GetRepoPerm($rid, $uid) $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; // first check if $DB_CONNECTION IS live - //error_log("in connection $db_type, $db_name"); + //// error_log("in connection $db_type, $db_name"); $db_url = false; if($DB_CONNECTION != false) return $DB_CONNECTION; @@ -367,7 +367,7 @@ function gwvpmini_ConnectDB() if($db_type == "sqlite") { $db_url = $db_name; if(!file_exists($db_name)) { - //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"); @@ -375,11 +375,11 @@ function gwvpmini_ConnectDB() } // and here we go with pdo. - error_log("attmpting to open db, $db_type:$db_url"); + // error_log("attmpting to open db, $db_type:$db_url"); try { $DB_CONNECTION = new PDO("$db_type:$db_url"); } catch(PDOException $exep) { - error_log("execpt on db open"); + // error_log("execpt on db open"); return false; } @@ -478,7 +478,7 @@ function gwvpmini_AddActivityLog($type, $userid, $repoid, $commitid, $commitlog) $sql = "insert into 'activity' values ( null, '$type', '".time()."', '$userid', '$repoid', '$commitid', '$commitlog', '$visibleto')"; - error_log("SQL IS $sql"); + // error_log("SQL IS $sql"); $res = $conn->query($sql); if(!$res) return -1; @@ -553,7 +553,7 @@ function gwvpmini_dbCreateSQLiteStructure($dbloc) try { $DB_CONNECTION = new PDO("sqlite:$dbloc"); } catch(PDOException $exep) { - error_log("execpt on db open"); + // error_log("execpt on db open"); return false; } @@ -654,7 +654,7 @@ function gwvpmini_GetRepoDescFromName($reponame) $conn = gwvpmini_ConnectDB(); $sql = "select repos_description from repos where repos_name='$reponame'"; - error_log("desc for name sql: $sql"); + // error_log("desc for name sql: $sql"); $res = $conn->query($sql); @@ -701,7 +701,7 @@ function gwvpmini_GetRepoOwnerDetailsFromName($reponame) if(!$res) return -1; foreach($res as $row) { $retval = array(); - error_log("STUFF2: ".print_r($row,true)); + // error_log("STUFF2: ".print_r($row,true)); $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(); $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"); + // error_log("userid sql $sql"); $res = $conn->query($sql); @@ -775,7 +775,7 @@ function gwvpmini_GetUserNameFromEmail($email) $sql = "select user_username from users where user_email='$email'"; - error_log("username sql $sql"); + // error_log("username sql $sql"); $res = $conn->query($sql); @@ -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; @@ -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)); + // error_log(print_r($retval, true)); return $retval; } @@ -845,7 +845,7 @@ function gwvpmini_GetContributedRepos($username) $i = 0; 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; } - error_log("CONTRIBREPOS: ".print_r($retval, true)); + // error_log("CONTRIBREPOS: ".print_r($retval, true)); return $retval; } @@ -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"); } $retval = false; @@ -946,7 +946,7 @@ function gwvpmini_findPeopleLike($search) $retval[$id]["id"] = $row["user_id"]; } - error_log("SEARCHUSER: array is ".print_r($retval, true)); + // error_log("SEARCHUSER: array is ".print_r($retval, true)); return $retval; } diff --git a/gwvpmini/gwvpmini_gitbackend.php b/gwvpmini/gwvpmini_gitbackend.php index a184213..4cb53b8 100644 --- a/gwvpmini/gwvpmini_gitbackend.php +++ b/gwvpmini/gwvpmini_gitbackend.php @@ -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"); diff --git a/gwvpmini/gwvpmini_gitrepo.php b/gwvpmini/gwvpmini_gitrepo.php index 502210e..edf8fd6 100644 --- a/gwvpmini/gwvpmini_gitrepo.php +++ b/gwvpmini/gwvpmini_gitrepo.php @@ -15,15 +15,15 @@ $MENU_ITEMS["10repos"]["link"] = "$BASE_URL/repos"; function gwvpmini_RepoCallMe() { - error_log("in repoadmin callme - err?"); - error_log(print_r($_REQUEST, true)); + // error_log("in repoadmin callme - err?"); + // error_log(print_r($_REQUEST, true)); if(isset($_REQUEST["q"])) { - error_log("in repoadmin callme, for Q"); + // error_log("in repoadmin callme, for Q"); $query = $_REQUEST["q"]; $qspl = explode("/", $query); if(isset($qspl[0])) { 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 { - error_log("i got here, where next?"); + // error_log("i got here, where next?"); return "gwvpmini_RepoMainPage"; } } else return false; @@ -67,7 +67,7 @@ function gwvpmini_RepoMainPageBody() $cmd = "git --git-dir=\"$repo_base/$name.git\" log --all -1 2> /dev/null"; echo "$name$desc"; echo ""; - 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"); $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 ""; $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)){ return @unlink($fpath); } diff --git a/gwvpmini/gwvpmini_register.php b/gwvpmini/gwvpmini_register.php index b0c5147..b913788 100644 --- a/gwvpmini/gwvpmini_register.php +++ b/gwvpmini/gwvpmini_register.php @@ -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); diff --git a/gwvpmini/gwvpmini_search.php b/gwvpmini/gwvpmini_search.php index 40fae3f..cf2681f 100644 --- a/gwvpmini/gwvpmini_search.php +++ b/gwvpmini/gwvpmini_search.php @@ -10,10 +10,10 @@ $CALL_ME_FUNCTIONS["search"] = "gwvpmini_SearchCallMe"; function gwvpmini_SearchCallMe() { - error_log("in repoadmin callme - err?"); - error_log(print_r($_REQUEST, true)); + // error_log("in repoadmin callme - err?"); + // error_log(print_r($_REQUEST, true)); if(isset($_REQUEST["q"])) { - error_log("in repoadmin callme, for Q"); + // error_log("in repoadmin callme, for Q"); $query = $_REQUEST["q"]; $qspl = explode("/", $query); if(isset($qspl[0])) { diff --git a/gwvpmini/gwvpmini_user.php b/gwvpmini/gwvpmini_user.php index ec7aba5..799ef37 100644 --- a/gwvpmini/gwvpmini_user.php +++ b/gwvpmini/gwvpmini_user.php @@ -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)); + //// error_log("show view of user with $user_view_call: ". print_r($dets, true)); echo "

".$dets["fullname"]."


"; echo gwvpmini_HtmlGravatar($dets["email"],80); diff --git a/gwvpmini/gwvpmini_view.php b/gwvpmini/gwvpmini_view.php index 165a3c1..642a9bc 100644 --- a/gwvpmini/gwvpmini_view.php +++ b/gwvpmini/gwvpmini_view.php @@ -10,7 +10,7 @@ function gwvpmini_RepoViewCallMe() { global $repo_view_call; - error_log("in admin callme"); + // error_log("in admin callme"); if(isset($_REQUEST["q"])) { $query = $_REQUEST["q"]; $qspl = explode("/", $query); @@ -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"; if($bperms == "x") $expl = " selected"; - 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"])) { $query = $_REQUEST["q"]; $qspl = explode("/", $query); - error_log("PLOOP:qview".print_r($qspl, true)); + // error_log("PLOOP:qview".print_r($qspl, true)); } 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"); } @@ -275,12 +275,12 @@ function gwvpmini_AddRepoReader() if(isset($_REQUEST["q"])) { $query = $_REQUEST["q"]; $qspl = explode("/", $query); - error_log("PLOOP:qview".print_r($qspl, true)); + // error_log("PLOOP:qview".print_r($qspl, true)); } if(isset($qspl[1])) $repo_view_call = $qspl[1]; else { - error_log("PLOOP: no repo name"); + // error_log("PLOOP: no repo name"); // TODO: btw, this makes no sense header("Location: $BASE_URL/view/$repo_view_call"); return; @@ -301,7 +301,7 @@ function gwvpmini_AddRepoReader() } 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"); header("Location: $BASE_URL/view/$repo_view_call"); return; } @@ -337,12 +337,12 @@ function gwvpmini_AddRepoContributor() if(isset($_REQUEST["q"])) { $query = $_REQUEST["q"]; $qspl = explode("/", $query); - error_log("PLOOP:qview".print_r($qspl, true)); + // error_log("PLOOP:qview".print_r($qspl, true)); } if(isset($qspl[1])) $repo_view_call = $qspl[1]; else { - error_log("PLOOP: no repo name"); + // error_log("PLOOP: no repo name"); // TODO: btw, this makes no sense header("Location: $BASE_URL/view/$repo_view_call"); return; @@ -363,7 +363,7 @@ function gwvpmini_AddRepoContributor() } 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"); header("Location: $BASE_URL/view/$repo_view_call"); return; } @@ -398,12 +398,12 @@ function gwvpmini_RemoveRepoContributor() if(isset($_REQUEST["q"])) { $query = $_REQUEST["q"]; $qspl = explode("/", $query); - error_log("PLOOP:qview".print_r($qspl, true)); + // error_log("PLOOP:qview".print_r($qspl, true)); } if(isset($qspl[1])) $repo_view_call = $qspl[1]; else { - error_log("PLOOP: no repo name"); + // error_log("PLOOP: no repo name"); // TODO: btw, this makes no sense header("Location: $BASE_URL/view/$repo_view_call"); return; @@ -423,7 +423,7 @@ function gwvpmini_RemoveRepoContributor() } 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"); header("Location: $BASE_URL/view/$repo_view_call"); return; } @@ -455,12 +455,12 @@ function gwvpmini_RemoveRepoReader() if(isset($_REQUEST["q"])) { $query = $_REQUEST["q"]; $qspl = explode("/", $query); - error_log("PLOOP:qview".print_r($qspl, true)); + // error_log("PLOOP:qview".print_r($qspl, true)); } if(isset($qspl[1])) $repo_view_call = $qspl[1]; else { - error_log("PLOOP: no repo name"); + // error_log("PLOOP: no repo name"); // TODO: btw, this makes no sense header("Location: $BASE_URL/view/$repo_view_call"); return; @@ -480,7 +480,7 @@ function gwvpmini_RemoveRepoReader() } 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"); header("Location: $BASE_URL/view/$repo_view_call"); return; } @@ -510,12 +510,12 @@ function gwvpmini_RepoUpdateDescription() if(isset($_REQUEST["q"])) { $query = $_REQUEST["q"]; $qspl = explode("/", $query); - error_log("PLOOP:qview".print_r($qspl, true)); + // error_log("PLOOP:qview".print_r($qspl, true)); } if(isset($qspl[1])) $repo_view_call = $qspl[1]; else { - error_log("PLOOP: no repo name"); + // error_log("PLOOP: no repo name"); // TODO: btw, this makes no sense header("Location: $BASE_URL/view/$repo_view_call"); return; @@ -535,7 +535,7 @@ function gwvpmini_RepoUpdateDescription() } if(!$owner_view) { gwvpmini_SendMessage("error", "failure updating description for repo"); - 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; } diff --git a/gwvpmini/gwvpmini_web.php b/gwvpmini/gwvpmini_web.php index 3dfdde0..4251fb6 100644 --- a/gwvpmini/gwvpmini_web.php +++ b/gwvpmini/gwvpmini_web.php @@ -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 ""; //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 ""; //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 ""; diff --git a/www/index.php b/www/index.php index acb44a1..4dc08e8 100644 --- a/www/index.php +++ b/www/index.php @@ -1,5 +1,5 @@