repo admin work for dealing with bundles (For initial repo creation).
authorpaulr <me@pjr.cc>
Fri, 4 Nov 2011 17:11:44 +0000 (04:11 +1100)
committerpaulr <me@pjr.cc>
Fri, 4 Nov 2011 17:11:44 +0000 (04:11 +1100)
Im a little confused about how git bundles actually work... they seem
odd

gwvplib/gwvpgitcontrol.php
gwvplib/gwvplib.php
gwvplib/gwvprepoadmin.php

index a949fab..2755859 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 
-$CALL_ME_FUNCTIONS["repoadmin"] = "gwvp_gitControlCallMe";
+$CALL_ME_FUNCTIONS["gitcontrol"] = "gwvp_gitControlCallMe";
 
 //$MENU_ITEMS["20repos"]["text"] = "Repo Admin";
 //$MENU_ITEMS["20repos"]["link"] = "$BASE_URL/admin/repos";
index 526c9cc..693486c 100644 (file)
@@ -15,7 +15,7 @@ require_once("gwvpgitcontrol.php");
 require_once("gwvppluginloader.php");
 
 // only enable this if you need it:
-// require_once("gwvpdebug.php");
+require_once("gwvpdebug.php");
 
 
 ?>
\ No newline at end of file
index ec28e8b..1ecf30b 100644 (file)
@@ -6,11 +6,14 @@ $MENU_ITEMS["20repos"]["link"] = "$BASE_URL/admin/repos";
 
 function gwvp_RepoAdminCallMe()
 {
+       
+       error_log("in repoadmin callme");
        if(isset($_REQUEST["q"])) {
                $query = $_REQUEST["q"];
                $qspl = explode("/", $query);
                if(isset($qspl[0]) && isset($qspl[1])) {
                        if($qspl[0] == "admin" && $qspl[1] == "repos") {
+                               error_log("i got here, where next?");
                                if(isset($qspl[2])) {
                                        switch($qspl[2]) {
                                                case "create":
@@ -52,10 +55,16 @@ function gwvp_DoCreateRepoPage()
        
        if(gwvp_repoExists($reponame)) {
                gwvp_SendMessage("error", "a repository with the name <b>\"$reponame\"</b> already exists");
-               header("Location: $BASE_URL/admin/repos/create?reponameobv=$reponame&repodescobv=$repodesc");
+               //header("Location: $BASE_URL/admin/repos/create?reponameobv=$reponame&repodescobv=$repodesc");
        } else if(gwvp_createGitRepo($reponame)) {
+               if(isset($_FILES["bundlefile"]["size"])) {
+                       //error_log("bundle file name is ".$_FILES["bundlefile"]["size"]);
+                       if($_FILES["bundlefile"]["size"] > 0) {
+                               error_log("bundle file tmpname is ".$_FILES["bundlefile"]["tmp_name"]);
+                       }
+               }
                gwvp_SendMessage("info", "Repo, $reponame, created");
-               header("Location: $BASE_URL/admin/repos");
+               //header("Location: $BASE_URL/admin/repos");
        }
        
        
@@ -72,10 +81,11 @@ function gwvp_CreateRepoPageBody()
        if(isset($_REQUEST["repodescobv"])) $repodescobv = $_REQUEST["repodescobv"];
        
        echo "<h2>Create a Repo</h2>";
-       echo "<form method=\"post\" action=\"$BASE_URL/admin/repos/docreate\">";
+       echo "<form method=\"post\" enctype=\"multipart/form-data\" action=\"$BASE_URL/admin/repos/docreate\">";
        echo "<table>";
        echo "<tr><td>Repository Name</td><td><input type=\"text\" name=\"reponame\" value=\"$reponameobv\"></td></tr>";
        echo "<tr><td>Repository Description</td><td><input type=\"text\" name=\"repodesc\" value=\"$repodescobv\"></td></tr>";
+       echo "<tr><td>Repository Bundle</td><td><input type=\"file\" name=\"bundlefile\"></td><td><i>Create a bundle for pro-creating the git repository</i></td></tr>";
        echo "</table>";
        echo "<input type=\"submit\" name=\"create\" value=\"Create\"><br>";
        echo "</form>";