X-Git-Url: http://git.pjr.cc/?p=gwvp.git;a=blobdiff_plain;f=gwvplib%2Fgwvpsetup.php;h=a9e7a06e18cc61377bf5e81a403c7cfa90b50d47;hp=b83e41541ffd603b60973e90a4f1877b48fd8038;hb=4f4bf1da18181d412cd755143e016ede587cc1d6;hpb=8f714681f0b8452e97c1d4eeb02262f1ffd3ee7b diff --git a/gwvplib/gwvpsetup.php b/gwvplib/gwvpsetup.php index b83e415..a9e7a06 100644 --- a/gwvplib/gwvpsetup.php +++ b/gwvplib/gwvpsetup.php @@ -21,18 +21,131 @@ function gwvp_PostSetup() function gwvp_PostSetupPageBody() { - echo "GWVP Is now setup, login at the top of the page and you should in control!"; + echo "GWVP Is now setup, login at the top of the page and you should be in control!"; } // TODO: need to do this bit function gwvp_issetup() { - return true; + // check for the config file + if(!file_exists("config.php")) return false; + + return gwvp_isDBSetup(); } 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 | |
username | $fwusername |
pass | $fwpass |
passconfirm | $fwpassconf |
dbtype | $dbtype |
dbname | $dbname |
repoloc | $repoloc |
dataloc | $dataloc |