$userdets = get_gravatar($ownerinfo["email"], 40, 'mm', 'g', true);
$userdets .= "<br><a href=\"$BASE_URL/user/".$ownerinfo["username"]."\">".$ownerinfo["username"]."</a>";
- $repodets = "<b>".$rep["name"]."</b><br>".$rep["desc"];
+ $repodets = "<b><a href=\"$BASE_URL/view/".$rep["name"]."\">".$rep["name"]."</a></b><br>".$rep["desc"];
echo "<tr><td>$userdets</td><td>$repodets</td></tr>";
}
echo "</table>";
$repo_base = gwvpmini_getConfigVal("repodir");\r
+ $bperms_f = gwvpmini_GetRepoPerms(gwvpmini_GetRepoId($repo_view_call));
+ $bperms = $bperms_f["b"];
+
$owner_view = false;\r
if($_SERVER["SERVER_PORT"] == 443) $proto="https://";
$owner_name = $owner["username"];
-
+ // TODO: fix this so that if user has no read access to repo, they cant see it
if(isset($_SESSION["id"])) {
if($owner["id"] == $_SESSION["id"]) {
$owner_view = true;
+ } else if ($bperms != "r") {
+ // check user level perms
+ $perm = gwvpmini_GetRepoPerm($rid, $_SESSION["id"]);
+ if($perm < 1) {
+ header("Location: $BASE_URL");\r
+ return;
+ }
+ }
+ } else {
+ if($bperms != "a") {
+ header("Location: $BASE_URL");
+ return;
}
}
error_log("STUFF:".print_r($owner,true));
- $cloneurl = "git clone $proto$sname$BASE_URL/git/$repo_view_call.git";
+ if($bperms != "a") $login = $_SESSION["username"]."@password:";
+ else $login = "";
+ $cloneurl = "git clone $proto$login$sname$BASE_URL/git/$repo_view_call.git";
echo "<textarea rows=1 cols=".strlen($cloneurl).">$cloneurl</textarea><br>";
if($owner_view) $owner_extra = " (YOU)";
echo "<b>$desc</b><br>";
if($owner_view) {
- $bperms_f = gwvpmini_GetRepoPerms(gwvpmini_GetRepoId($repo_view_call));
- $bperms = $bperms_f["b"];
+
+
$anyo = "";
$regd = "";