warn about remote fork config in setup and help
authorChristian Weiske <cweiske@cweiske.de>
Fri, 4 Jul 2014 06:28:22 +0000 (08:28 +0200)
committerChristian Weiske <cweiske@cweiske.de>
Fri, 4 Jul 2014 06:28:22 +0000 (08:28 +0200)
data/templates/help.htm
src/phorkie/SetupCheck.php
www/help.php

index 555a7381da81480f6d8d7877d2c0ceababaea0f8..a17aa502522adbcd3266ed0843a54e1a750e89ce 100644 (file)
@@ -46,4 +46,19 @@ function registerHandler() {
   </a>
  </div>
 </div>
   </a>
  </div>
 </div>
+
+<h3 id="fork-check">Setup check</h3>
+<p>
+ You need to activate public clone URLs in your config file.
+ Otherwise forking onto remote systems will not work.
+</p>
+{% if publicGitUrl %}
+<div class="alert alert-success">
+ OK! A public git URL prefix is configured: <tt>{{publicGitUrl}}</tt>
+</div>
+{% else %}
+<div class="alert alert-error">
+ Error! No public git URL prefix configured.
+</div>
+{% endif %}
 {% endblock %}
 {% endblock %}
index c459e2af546d251c981fc9f0888dc525e9f53072..69cffd8f073e7b200dfb861eeb1a92183f2858ce 100644 (file)
@@ -39,6 +39,7 @@ class SetupCheck
         $sc->checkGit();
         $sc->checkDatabase();
         $sc->checkMimeTypeDetection();
         $sc->checkGit();
         $sc->checkDatabase();
         $sc->checkMimeTypeDetection();
+        $sc->checkRemoteForking();
 
         return $sc->messages;
     }
 
         return $sc->messages;
     }
@@ -133,6 +134,18 @@ class SetupCheck
         }
     }
 
         }
     }
 
+    public function checkRemoteForking()
+    {
+        if (!isset($GLOBALS['phorkie']['cfg']['git']['public'])
+            || $GLOBALS['phorkie']['cfg']['git']['public'] == ''
+        ) {
+            $this->fail(
+                'No public git URL prefix configured.'
+                . ' Remote forking will not work'
+            );
+        }
+    }
+
     public function fail($msg)
     {
         $this->messages[] = array('error', $msg);
     public function fail($msg)
     {
         $this->messages[] = array('error', $msg);
index fe56c2240f892bddaaa2a7e8b173c61aee9945ff..8ccdd69d0f6cc6965a1a2865afb1357818752f38 100644 (file)
@@ -10,6 +10,7 @@ render(
     'help',
     array(
         'htmlhelper' => new HtmlHelper(),
     'help',
     array(
         'htmlhelper' => new HtmlHelper(),
+        'publicGitUrl' => @$GLOBALS['phorkie']['cfg']['git']['public'],
     )
 );
 ?>
     )
 );
 ?>