}
+function gwvpmini_GetRepoPerms($rid)
+{
+ $conn = gwvpmini_ConnectDB();\r
+ \r
+ $sql = "select repos_perms from repos where repos_id='$rid'";\r
+ \r
+ $res = $conn->query($sql);\r
+ \r
+ $cperms_t = false;\r
+ if($res !== false) foreach($res as $row) {\r
+ $cperms_t = $row[0];\r
+ }\r
+ \r
+ if($cperms_t === false) return 0;\r
+ \r
+ error_log("PERMSCHECK $rid, $uid:".print_r($dets, true));\r
+ \r
+ if($dets === false) return 0;\r
+ \r
+ if($dets["ownerid"] == $uid) return 2;\r
+ \r
+ $permsarray = unserialize(base64_decode($cperms_t));
+}
+
//returns 0 for none, 1 for read, 2 for writes
function gwvpmini_GetRepoPerm($rid, $uid)
{
\r
$res = $conn->query($sql);
- error_log("PERMCHECK: FUCK U! $sql");\r
- \r
$cperms_t = false;\r
if($res !== false) foreach($res as $row) {\r
$cperms_t = $row[0];\r
error_log("BPERMS: $bperms");
+ if($bperms == "x") $cspan = 3;
+ else $cspan = 2;
+
+ echo "<table border=\"1\"><tr valign=\"top\"><tr><th colspan=\"$cspan\">Permissions</th></tr><td>";
echo "<form method=\"post\" action=\"$BASE_URL/updaterepobaseperms/$repo_view_call\">";
- echo "Base Permissions ";
echo "<select name=\"base_perms\">";
echo "<option value=\"a\"$anyo>Anyone can read</option>";
echo "<option value=\"r\"$regd>Only registered users can read</option>";
echo "</select>";
echo "<input type=\"submit\" name=\"Set\" value=\"Set\">";
echo "</form>";
+ if($bperms == "x") {
+ echo "</td><td>Readers<br>";
+ echo "<form method=\"post\" action=\"$BASE_URL/repoaddreader/$repo_view_call\">";
+ echo "<input type=\"text\" name=\"readerusername\"> <input type=\"submit\" name=\"Add\" value=\"Add\">";
+ echo "</form><br>";
+ }
+
+ echo "</td><td>Contributors";
+ echo "<form method=\"post\" action=\"$BASE_URL/repoaddcontrib/$repo_view_call\">";
+ echo "<input type=\"text\" name=\"contribusername\"> <input type=\"submit\" name=\"Add\" value=\"Add\">";
+ echo "</form><br>";
+ echo "</td></tr></table>";
}
//echo "command: git log --git-dir=$repo_base/$repo_view_call.git --pretty=format:\"%H\" -10";
$rs = popen("git --git-dir=$repo_base/$repo_view_call.git log --pretty=format:\"%H\" -10", "r");