\r
\r
$uid = gwvpmini_GetUserId($username);\r
- $sql = "select repos_id,repos_description,repos_perms,repos_owernid,repos_status from repos";\r
+ $sql = "select repos_id,repos_description,repos_perms,repos_owner,repos_status,repos_name from repos";\r
$res = $conn->query($sql);\r
if($username == "") return false;\r
\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));
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]["owner"] = $row["repos_owner"];
$rids[$i]["status"] = $row["repos_status"];
+ $rids[$i]["name"] = $row["repos_name"];
$i++;
}
+ }
+ $retval = $rids;
+
+ if($i == 0) {
+ error_log("CONTRIBREPOS: no repos found?");
+ return false;
}\r
\r
- error_log(print_r($retval, true));\r
+ error_log("CONTRIBREPOS: ".print_r($retval, true));\r
return $retval;\r
}
// if its a write, we push for authentication
//if($write) {
- gwvpmini_callGitBackend($person, $repo);
- return;
+ if(!$person) {
+ $person = "anonymous";
+ }
+ 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
global $BASE_URL;
if(gwvpmini_isLoggedIn()) {
- gwvpmini_GitCreateRepoForm();
$repos = gwvpmini_GetOwnedRepos($_SESSION["username"]);
if(!$repos) {
echo "You currently own no repos<br>";
foreach($repos as $repo) {
$name = $repo["name"];
$desc = $repo["desc"];
+ $repo_base = gwvpmini_getConfigVal("repodir");
+ $cmd = "git --git-dir=\"$repo_base/$name.git\" log -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");
}
echo "</table>";
}
+ gwvpmini_GitCreateRepoForm();\r
+
+
+ $contreps = gwvpmini_GetContributedRepos($_SESSION["username"]);
+
+ if($contreps !== false) {
+ echo "<h2>Repos you contribute to</h2>";
+ echo "<table border=\"1\"><tr><th>Repo Name</th><th>Owner</th><th>Repo Description</th><th>Last Log</th></tr>";
+ foreach($contreps as $repo) {
+ $name = $repo["name"];\r
+ $desc = $repo["desc"];
+ $repo_base = gwvpmini_getConfigVal("repodir");\r
+ $cmd = "git --git-dir=\"$repo_base/$name.git\" log -1 2> /dev/null";
+ error_log("CMD: $cmd");
+ //system("$cmd");
+ $fls = popen($cmd, "r");
+ $tks = "";
+ if($fls !== false) while(!feof($fls)) {
+ $tks .= fread($fls,1024);
+ }
+
+ if($tks == "") {
+ $lastlog = "No Log Info Yet";
+ } else $lastlog = $tks;
+
+ $owner = gwvpmini_getUser(null, null, $repo["owner"]);
+ $repname = "<a href=\"$BASE_URL/view/$name\">$name</a>";
+ $repown = get_gravatar($owner["email"], 30, 'mm', 'g', true)."<br><a href=\"$BASE_URL/user/".$owner["username"]."\">".$owner["username"]."</a>";
+
+
+ echo "<tr><td>$repname</td><td>$repown</td><td>$desc</td><td>$lastlog</td></tr>";
+ }
+ echo "</table>";
+ }
}
return true;
}
$desc = gwvpmini_GetRepoDescFromName($repo_view_call);
$editdesc = preg_replace("/\<br\>/", "\n", $desc);
+ $rid = gwvpmini_GetRepoId($repo_view_call);
$owner_name = $owner["username"];