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
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
$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>)";
}
$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>";
$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
global $BASE_URL;\r
- error_log("CONF REMOVE REPO");
+ // // error_log("CONF REMOVE REPO");
\r
$rid = -1;\r
if(isset($_REQUEST["q"])) {\r
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
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");
$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
{
$details = gwvpmini_getUser($user);
if($details == false) {
- error_log("no user details for $user");
+ // error_log("no user details for $user");
return 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()
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;
}
}
$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) {
$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;
}
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]);
}
}
$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);
\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;
\r
$permsarray = unserialize(base64_decode($cperms_t));
- error_log("PERMSARRAY: ".print_r($permsarray,true));
+ // error_log("PERMSARRAY: ".print_r($permsarray,true));
$perm = 0;
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
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
}\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
\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;
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
$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
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"];
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";
$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);
\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
$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
$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
}
$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"];
$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
}
$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
$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;
}
{
$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";
$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";
/* 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");
}*/
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);
}
$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;
}
}
// 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;
}
$perm = gwvpmini_GetRepoPerm($rid, $uid);
if($write) {
if($perm < 2) {
- error_log("SEND FOFF");
+ // error_log("SEND FOFF");
gwvpmini_fourZeroThree();
return;
}
// 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;
}*/
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;
$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";
}
$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"];
$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");
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);
}
$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");
}
//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;
}
// 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;
}
}
$cgi_len = strlen($from_cgi_data);
} else {
- error_log("cgi end");
+ // error_log("cgi end");
$cgi_len = 0;
}
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\"");
}
}
}
$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");
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";
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
$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 = "";
$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 = "";
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 = "";
$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")) {
function gwvpmini_RecursiveDelete($fpath)
{
- error_log("RECURSEDETELE: ".$fpath);
+ // error_log("RECURSEDETELE: ".$fpath);
if(is_file($fpath)){\r
return @unlink($fpath);\r
}\r
{
- error_log("in admin callme");
+ // error_log("in admin callme");
if(isset($_REQUEST["q"])) {
$query = $_REQUEST["q"];
$qspl = explode("/", $query);
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
{
global $user_view_call;
- error_log("in admin callme");
+ // error_log("in admin callme");
if(isset($_REQUEST["q"])) {
$query = $_REQUEST["q"];
$qspl = explode("/", $query);
$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);
{
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
}
- 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";
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;
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;
}
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
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
}
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
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
}\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
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
}\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
}
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
}\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
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
}\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
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();
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";
}
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";
}
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();
}
}
$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\"";
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();
}
}
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");
}
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 "";
<?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
return;
}
-error_log("CMDLINETOOL: ".$cmd_line_tool);
+// error_log("CMDLINETOOL: ".$cmd_line_tool);
// need to make this db agnostic
if(!gwvpmini_DBExists($db_name)) {
gwvpmini_setConfigVal("repodir", "$data_directory/repos");
}
-error_log("REQUEST BEGIN");
+// error_log("REQUEST BEGIN");
gwvpmini_goWeb();