working on repo permissions code
[gwvp.git] / gwvplib / gwvprepoadmin.php
index 665aeff..baa7cf1 100644 (file)
@@ -46,6 +46,8 @@ function gwvp_CreateRepoPage()
        gwvp_goMainPage("gwvp_CreateRepoPageBody");
 }
 
+//function gwvp_createGitRepo($name, $ownerid, $desc, $defaultperms=0, $bundle=null)
+
 function gwvp_DoCreateRepoPage()
 {
        global $BASE_URL;
@@ -59,9 +61,11 @@ function gwvp_DoCreateRepoPage()
                //header("Location: $BASE_URL/admin/repos/create?reponameobv=$reponame&repodescobv=$repodesc");
        } else if($_FILES["bundlefile"]["size"] > 0) { //               if(isset($_FILES["bundlefile"]["size"]))  <--- this needs to happen here TODO
                error_log("bundle file tmpname is ".$_FILES["bundlefile"]["tmp_name"]);
-               gwvp_createGitRepo($reponame, $_FILES["bundlefile"]["tmp_name"]);
+               // function gwvp_createGitRepo($name, $ownerid, $desc, $defaultperms=0, $bundle=null)
+               // TODO: deal with default perms
+               gwvp_createGitRepo($reponame, $_SESSION["id"], $repodesc, $_FILES["bundlefile"]["tmp_name"]);
                gwvp_SendMessage("info", "Repo, $reponame, created");
-       } else if(gwvp_createGitRepo($reponame)) {
+       } else if(gwvp_createGitRepo($reponame, $_SESSION["id"], $repodesc)) {
                gwvp_SendMessage("info", "Repo, $reponame, created");
        }
        header("Location: $BASE_URL/admin/repos");
@@ -84,7 +88,8 @@ function gwvp_CreateRepoPageBody()
        echo "<table>";
        echo "<tr><td>Repository Name</td><td bgcolor=\"#eeeeee\"><input type=\"text\" name=\"reponame\" value=\"$reponameobv\"></td></tr>";
        echo "<tr><td>Repository Description</td><td bgcolor=\"#eeeeee\"><input type=\"text\" name=\"repodesc\" value=\"$repodescobv\"></td></tr>";
-       echo "<tr><td>Repository Bundle</td><td bgcolor=\"#eeeeee\"><input type=\"file\" name=\"bundlefile\"></td><td><i>Create a bundle for pro-creating the git repository (export your git bundle with \"git bundle create /tmp/filename --branches\")</i></td></tr>";
+       echo "<tr><td>Repository Bundle</td><td bgcolor=\"#eeeeee\"><input type=\"file\" name=\"bundlefile\"></td><td><i>Create a bundle for pro-creating the git repository (export your git bundle with \"git bundle create /tmp/filename --branches\")<br>";
+       echo "Typically you wouldn't use this as its easier to \"push\" to the repo after its created by adding it as a remote and pushing your local master branch</i></td></tr>";
        
        echo "<tr><td>Default Permisison Set</td><td bgcolor=\"#eeeeee\">";
        
@@ -152,11 +157,6 @@ function gwvp_RepoAdminPageBody()
        return;
 }
 
-// this funciton returns one of three things
-function gwvp_resolvRepoPerms($userid, $repoid)
-{
-       
-}