aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Weiske <christian.weiske@netresearch.de>2014-07-04 11:11:53 +0200
committerChristian Weiske <christian.weiske@netresearch.de>2014-07-04 11:11:53 +0200
commit8c40f2a64ae2ba63a1ed6c89cb7ce8a4b07e4dd1 (patch)
tree98fb2f694b15d6b58ec11e09e75ac0b40a4b7b96
parent47a3b51ef8ab7d47bc5492c830bc8905e3fb872e (diff)
downloadphorkie-8c40f2a64ae2ba63a1ed6c89cb7ce8a4b07e4dd1.tar.gz
phorkie-8c40f2a64ae2ba63a1ed6c89cb7ce8a4b07e4dd1.zip
Lead users to setup check page when no config file given
-rw-r--r--data/templates/base.htm6
-rw-r--r--www/www-header.php4
2 files changed, 10 insertions, 0 deletions
diff --git a/data/templates/base.htm b/data/templates/base.htm
index 90ccc0a..86c79e6 100644
--- a/data/templates/base.htm
+++ b/data/templates/base.htm
@@ -74,6 +74,12 @@
<div class="container">
<div class="row">
<div class="span9">
+ {% if suggestSetupCheck %}
+ <div class="alert alert-error">
+ It seems phorkie is not setup properly.
+ Visit the <a href="setup">setup check page</a> for more information.
+ </div>
+ {% endif %}
{% block content %}{% endblock %}
</div>
<div class="span3">
diff --git a/www/www-header.php b/www/www-header.php
index 3fa4e0e..5381eed 100644
--- a/www/www-header.php
+++ b/www/www-header.php
@@ -40,9 +40,12 @@ if ($pharFile == '') {
$cfgFilePath = substr($pharFile, 7) . '.config.php';
}
$GLOBALS['phorkie']['cfgfiles'][$cfgFilePath] = false;
+$GLOBALS['phorkie']['suggestSetupCheck'] = false;
if (file_exists($cfgFilePath)) {
$GLOBALS['phorkie']['cfgfiles'][$cfgFilePath] = true;
require_once $cfgFilePath;
+} else if ($GLOBALS['phorkie']['cfg']['setupcheck']) {
+ $GLOBALS['phorkie']['suggestSetupCheck'] = true;
}
if ($GLOBALS['phorkie']['cfg']['baseurl'] === null) {
@@ -101,6 +104,7 @@ function render($tplname, $vars = array())
if (!isset($vars['htmlhelper'])) {
$vars['htmlhelper'] = new HtmlHelper();
}
+ $vars['suggestSetupCheck'] = $GLOBALS['phorkie']['suggestSetupCheck'];
$template = $GLOBALS['twig']->loadTemplate($tplname . '.htm');
echo $template->render($vars);