changes to git management links based on perms
[gwvp.git] / gwvplib / gwvprepoadmin.php
index bcf9d25..cc78ba4 100644 (file)
@@ -28,6 +28,9 @@ function gwvp_RepoAdminCallMe()
                                                case "updateperms":
                                                        return "gwvp_UpdateRepoPerms";
                                                        break;
+                                               case "details":
+                                                       return "gwvp_RepoDetailsPage";
+                                                       break;
                                                default:
                                                        return "gwvp_RepoAdminPage";
                                        }                                       
@@ -57,6 +60,16 @@ function gwvp_CreateRepoPage()
        gwvp_goMainPage("gwvp_CreateRepoPageBody");
 }
 
+function gwvp_RepoDetailsPage()
+{
+       gwvp_goMainPage("gwvp_RepoDetailsPageBody");
+}
+
+function gwvp_RepoDetailsPageBody()
+{
+       echo "I am a repo details page";
+}
+
 function gwvp_UpdateRepoPerms()
 {
        global $LOGIN_TYPE, $BASE_URL;
@@ -241,6 +254,7 @@ function gwvp_RepoAdminPageBody()
        // next we need a repo list - with perms checking - ug
        // i must also remember that the home page will also contain a list of repos and that this page is solely for maintance
        // and creation of repos - so i dont need to get over-worked about the info stored on this page outside of those activities
+       echo "<h3>All Repositories</h3>";
        $rlist = gwvp_GetRepoList();
        echo "<table border=\"1\"><tr><th>Repo Name</th><th>Repo Description</th><th>Repo Owner</th></tr>";
        foreach($rlist as $u_res) {
@@ -248,7 +262,15 @@ function gwvp_RepoAdminPageBody()
                $rname = $u_res["name"];
                $rdesc = $u_res["description"];
                $rown = gwvp_getUserName($u_res["owner"]);
-               echo "<tr><td>$rname</td><td>$rdesc</td><td>$rown</td><td><a href=\"$BASE_URL/admin/repos/manage/$rid\">Details</a></td></tr>";
+               $manordetslink = "details";
+               $manordets = "Details";
+               if(isset($_SESSION["id"])) {
+                       if(gwvp_canManageRepo($_SESSION["id"], $rid)) {
+                               $manordetslink = "manage";
+                               $manordets = "Manage";
+                       }
+               }
+               echo "<tr><td>$rname</td><td>$rdesc</td><td>$rown</td><td><a href=\"$BASE_URL/admin/repos/$manordetslink/$rid\">$manordets</a></td></tr>";
        }
        echo "</table>";
        
@@ -304,6 +326,8 @@ function gwvp_ManageRepoPageBody()
        echo "<input type=\"submit\" name=\"update\" value=\"Update\"><br>";
        echo "</form>";
        
+       
+       echo "<h3>Repository Permissions</h3>";
        echo "<form method=\"post\" action=\"$BASE_URL/admin/repos/updateperms/$rid\">";
        echo "<table>";
        echo "<tr bgcolor=\"#eeeee0\"><th>Visibility</th><th>Read/Clone</th><th>Write/Push</th></tr>";