\r
return $retval;\r
}
+
function gwvpmini_GetOwnedRepos($username)\r
{
/*
$retval[$id]["name"] = $row["repos_name"];
$retval[$id]["desc"] = $row["repos_description"];
$retval[$id]["id"] = $row["repos_id"];
+ $retval[$id]["status"] = $row["repos_status"];
error_log(print_r($row, true));
}
return $retval;\r
}
+function gwvpmini_GetContributedRepos($username)\r
+{\r
+ /*\r
+ * CREATE TABLE "repos" (\r
+ "repos_id" INTEGER PRIMARY KEY AUTOINCREMENT,\r
+ "repos_name" TEXT,\r
+ "repos_description" TEXT,\r
+ "repos_owner" INTEGER\r
+ )';\r
+\r
+ */\r
+ $conn = gwvpmini_ConnectDB();\r
+\r
+\r
+ $uid = gwvpmini_GetUserId($username);\r
+ $sql = "select repos_id,repos_description,repos_perms,repos_owernid,repos_status from repos";\r
+ $res = $conn->query($sql);\r
+ if($username == "") return false;\r
+\r
+ $retval = false;
+ $rids = null;
+ $i = 0;\r
+ foreach($res as $row) {
+ $perms = unserialize(base64_decode($row["repos_perms"]));
+ if(isset($perms["$uid"])) if($perms["$uid"] > 1) {
+ $rids[$i]["id"] = $row["repos_id"];
+ $rids[$i]["desc"] = $row["repos_description"];
+ $rids[$i]["ownerid"] = $row["repos_ownerid"];
+ $rids[$i]["status"] = $row["repos_status"];
+ $i++;
+ }
+ }\r
+\r
+ error_log(print_r($retval, true));\r
+ return $retval;\r
+}
+
function gwvpmini_userLevel($id)
{
$conn = gwvpmini_ConnectDB();
$write = true;
}
}
- if($_SERVER["REQUEST_METHOD"] == "POST") {
- $write = true;
- }
//$write = true;
// THIS MAY CAUSE ISSUES LATER ON but we do it cause the git client ignores our 403 when it uses git-receive-pack after an auth
}
// if its a write, we push for authentication
- if($write) {
+
+ //if($write) {
gwvpmini_callGitBackend($person, $repo);
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")) {
+ /*if(file_exists("$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("would ask $repo for $repo/$newloc from $repo_base/$repo/$newloc, NE");
gwvpmini_fourZeroFour();
return;
- }
+ }*/
}