X-Git-Url: http://git.pjr.cc/?p=gwvp.git;a=blobdiff_plain;f=gwvplib%2Fgwvpsetup.php;h=bc639da93f1957a9bf27a246131224083a271e28;hp=b83e41541ffd603b60973e90a4f1877b48fd8038;hb=e363e11485867a857cdd0823e80170af6d34d780;hpb=8f714681f0b8452e97c1d4eeb02262f1ffd3ee7b diff --git a/gwvplib/gwvpsetup.php b/gwvplib/gwvpsetup.php index b83e415..bc639da 100644 --- a/gwvplib/gwvpsetup.php +++ b/gwvplib/gwvpsetup.php @@ -27,12 +27,122 @@ function gwvp_PostSetupPageBody() // TODO: need to do this bit function gwvp_issetup() { - return true; + return false; } function gwvp_goSetup() { + global $BASE_URL; + if(isset($_REQUEST["install"])) { + switch($_REQUEST["install"]) { + case "tryinstall": + gwvp_goSetupDoInstall(); + break; + default: + gwvp_goSetupGoMain(); + break; + + } + } else { + header("Location: $BASE_URL/?install=begin"); + } } + +function gwvp_goSetupGoMain() +{ + + // interesting, TODO: need a non-unix dependant way of doing this + $webusername = exec("whoami"); + + $defrepoloc = "/var/lib/gwvp/gitrepos"; + $defdataloc = "/var/lib/gwvp/data"; + + $repodata = "$defrepoloc"; + if(file_exists("$defrepoloc")) { + $repodata .= " exists"; + if(is_writable("$defrepoloc")) { + $repodata .= " and is wriable - this is ok as it is"; + } else { + $repodata .= " but is not writable - needs permissions for the web user"; + } + } else $repodata .= " does not exist (needs to be created)"; + + $datadata = "$defdataloc"; + if(file_exists("$defdataloc")) { + $datadata .= " exists"; + if(is_writable("$defdataloc")) { + $datadata .= " and is wriable - this is ok as it is"; + } else { + $datadata .= " but is not writable - needs permissions for the web user"; + } + } else $datadata .= " does not exist (needs to be created)"; + + echo "
Sitename | $sitename |
fullname | $fufn |
$fwem | |
nick | $fwnick |
pass | $fwpass |
passconfirm | $fwpassconf |
dbtype | $dbtype |
dbname | $dbname |
repoloc | $repoloc |
dataloc | $dataloc |