aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-11-28 01:23:16 -0800
committerfriendica <info@friendica.com>2012-11-28 01:23:16 -0800
commit7c047bea332efaa11af0d02878d91823c4bba1ad (patch)
tree8b8598b2dcf8ee9d5c365c7214f54d5cc6923132 /index.php
parent2fe2de1d5ac991d2bc20dd2df8eb071f5c8039a7 (diff)
downloadvolse-hubzilla-7c047bea332efaa11af0d02878d91823c4bba1ad.tar.gz
volse-hubzilla-7c047bea332efaa11af0d02878d91823c4bba1ad.tar.bz2
volse-hubzilla-7c047bea332efaa11af0d02878d91823c4bba1ad.zip
Allow anybody to completely over-ride any module on their own site without any core code edits. Just copy an existing module file to 'custom/{module}.php' and edit to your liking.
Diffstat (limited to 'index.php')
-rw-r--r--index.php27
1 files changed, 15 insertions, 12 deletions
diff --git a/index.php b/index.php
index 393d0cf4d..64cf55f7a 100644
--- a/index.php
+++ b/index.php
@@ -96,10 +96,6 @@ if((x($_GET,'zid')) && (! $install)) {
if((x($_SESSION,'authenticated')) || (x($_POST,'auth-params')) || ($a->module === 'login'))
require("auth.php");
-if(! x($_SESSION,'authenticated'))
- header('X-Account-Management-Status: none');
-
-
/*
* Create the page head after setting the language
* and getting any auth credentials
@@ -172,24 +168,31 @@ if(strlen($a->module)) {
$a->module_loaded = true;
}
+
+ if((strpos($a->module,'admin') === 0) && (! is_site_admin())) {
+ $a->module_loaded = false;
+ notice( t('Permission denied.') . EOL);
+ goaway(z_root());
+ }
+
/**
- * If not, next look for a 'standard' program module in the 'mod' directory
+ * If the site has a custom module to over-ride the standard module, use it.
+ * Otherwise, look for the standard program module in the 'mod' directory
*/
- if((! $a->module_loaded) && (file_exists("mod/{$a->module}.php"))) {
- if((strpos($a->module,'admin') === 0) && (! is_site_admin())) {
- $a->module_loaded = false;
- notice( t('Permission denied.') . EOL);
- goaway(z_root());
+
+ if(! $a->module_loaded) {
+ if(file_exists("custom/{$a->module}.php")) {
+ include_once("custom/{$a->module}.php");
+ $a->module_loaded = true;
}
- else {
+ elseif(file_exists("mod/{$a->module}.php")) {
include_once("mod/{$a->module}.php");
$a->module_loaded = true;
}
}
-
/**
*
* The URL provided does not resolve to a valid module.