diff options
author | friendica <info@friendica.com> | 2012-11-28 01:23:16 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2012-11-28 01:23:16 -0800 |
commit | 7c047bea332efaa11af0d02878d91823c4bba1ad (patch) | |
tree | 8b8598b2dcf8ee9d5c365c7214f54d5cc6923132 | |
parent | 2fe2de1d5ac991d2bc20dd2df8eb071f5c8039a7 (diff) | |
download | volse-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.
-rw-r--r-- | index.php | 27 |
1 files changed, 15 insertions, 12 deletions
@@ -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. |