]> git.mxchange.org Git - friendica.git/blobdiff - index.php
show permission denied photo when direct link was accessed and authentication is...
[friendica.git] / index.php
index 5f128ebb1b4754a9615a97d244d3bcc1b7db2dce..01d8eb2a1333b3670eba575961df4338d9b6952f 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,5 +1,5 @@
 <?php
-
+error_reporting(E_ERROR | E_WARNING | E_PARSE);
 /**
  *
  * Friendika
@@ -19,11 +19,11 @@ $a = new App;
 /**
  *
  * Load the configuration file which contains our DB credentials.
- * Ignore errors. If the file doesn't exist, we are running in installation mode.
+ * Ignore errors. If the file doesn't exist or is empty, we are running in installation mode.
  *
  */
 
-$install = ((file_exists('.htconfig.php')) ? false : true);
+$install = ((file_exists('.htconfig.php') && filesize('.htconfig.php')) ? false : true);
 
 @include(".htconfig.php");
 
@@ -113,6 +113,13 @@ else
        check_config($a);
 
 
+$arr = array('app_menu' => $a->apps);
+
+call_hooks('app_menu', $arr);
+
+$a->apps = $arr['app_menu'];
+
+
 /**
  *
  * We have already parsed the server path into $->argc and $a->argv
@@ -132,13 +139,17 @@ else
  * further processing.
  */
 
-
 if(strlen($a->module)) {
-       if(file_exists("mod/{$a->module}.php")) {
+       if(is_array($a->plugins) && in_array($a->module,$a->plugins) && file_exists("addon/{$a->module}/{$a->module}.php")) {
+               include_once("addon/{$a->module}/{$a->module}.php");
+               if(function_exists($a->module . '_module'))
+                       $a->module_loaded = true;
+       }
+       if((! $a->module_loaded) && (file_exists("mod/{$a->module}.php"))) {
                include("mod/{$a->module}.php");
                $a->module_loaded = true;
        }
-       else {
+       if(! $a->module_loaded) {
                if((x($_SERVER,'QUERY_STRING')) && ($_SERVER['QUERY_STRING'] === 'q=internal_error.html') && isset($dreamhost_error_hack)) {
                        logger('index.php: dreamhost_error_hack invoked. Original URI =' . $_SERVER['REQUEST_URI']);
                        goaway($a->get_baseurl() . $_SERVER['REQUEST_URI']);
@@ -150,6 +161,8 @@ if(strlen($a->module)) {
        }
 }
 
+
+
 /* initialise content region */
 
 if(! x($a->page,'content'))
@@ -234,8 +247,10 @@ $a->page['content'] .=  '<div id="pause"></div>';
  *
  */
 
-if($a->module != 'install')
+if($a->module != 'install') {
        require_once('nav.php');
+       nav($a);
+}
 
 /**
  * Build the page - now that we have all the components