X-Git-Url: http://git.pjr.cc/?p=gwvp-mini.git;a=blobdiff_plain;f=gwvpmini%2Fgwvpmini_gitrepo.php;h=6f9264bd6ee7d0817ff358ac93ebb4d00584a331;hp=1f42a7fab7bb01f355279ea7c4496e036f7d3478;hb=42069486556c27a9ceff2108970c6fe1c5333bfd;hpb=4d6a42b605b8c52c5621fb704b284e4c12672755 diff --git a/gwvpmini/gwvpmini_gitrepo.php b/gwvpmini/gwvpmini_gitrepo.php index 1f42a7f..6f9264b 100644 --- a/gwvpmini/gwvpmini_gitrepo.php +++ b/gwvpmini/gwvpmini_gitrepo.php @@ -124,17 +124,41 @@ function gwvpmini_GitCreateRepoForm() echo "Create Repo"; echo "Repo Name"; echo "Repo Description"; + echo "Read Permissions"; + echo ""; + echo ""; echo ""; echo ""; echo ""; -} +} function gwvpmini_RepoCreate() { global $BASE_URL; - if(gwvpmini_isLoggedIn()) { + // TODO: check the stuff out + // first reponame + $inputcheck = true; + + // remove a .git at the end if it was input + $_REQUEST["reponame"] = preg_replace("/\.git$/", "", $_REQUEST["reponame"]); + + // check for valid chars + $replcheck = preg_replace("/[a-zA-Z0-9_\-\.]/", "", $_REQUEST["reponame"]); + if(strlen($replcheck)>0) { + $inputcheck = false; + $inputcheckerror = "Repo name contains invalid characters, repos can only contain a-z, A-Z, 0-9, _, - and ."; + } + + if(!$inputcheck) { + gwvpmini_SendMessage("error", "$inputcheckerror"); + header("Location: $BASE_URL/repos"); + } else if(gwvpmini_isLoggedIn()) { //gwvpmini_createGitRepo($name, $ownerid, $desc, $bundle=null, $defaultperms=0) if(gwvpmini_HaveRepo($_REQUEST["reponame"])) { gwvpmini_SendMessage("error", "Repo ".$_REQUEST["reponame"]." already exists");