[MOVED] Removed include and templates from public [TESTING]

This commit is contained in:
Sebastian Grewe 2014-04-14 18:06:07 +02:00
parent 540a99abc5
commit 1456bd21ef
566 changed files with 27 additions and 27 deletions

16
.gitignore vendored
View File

@ -1,12 +1,12 @@
# Local Config # Local Config
/public/include/config/global.inc.php /include/config/global.inc.php
/public/include/config/security.inc.php /include/config/security.inc.php
# Templates # Templates
/public/templates/compile/*.php /templates/compile/*.php
/public/templates/compile/** /templates/compile/**
/public/templates/cache/*.php /templates/cache/*.php
/public/templates/cache/** /templates/cache/**
# Logs # Logs
/cronjobs/logs /cronjobs/logs
@ -14,8 +14,8 @@
/logs/* /logs/*
# Test configs # Test configs
public/include/config/global.inc.scrypt.php /include/config/global.inc.scrypt.php
public/include/config/global.inc.sha.php /include/config/global.inc.sha.php
# IDE Settings # IDE Settings
/.idea/* /.idea/*

View File

@ -53,10 +53,10 @@ if (@$_SESSION['USERDATA']['is_admin'] && $user->isAdmin(@$_SESSION['USERDATA'][
} }
// check if we can write templates/cache and templates/compile -> error // check if we can write templates/cache and templates/compile -> error
if (!is_writable(THEME_DIR.'/cache')) { if (!is_writable(TEMPLATE_DIR . '/cache')) {
$error[] = "templates/cache folder is not writable for uid {$apache_user['name']}"; $error[] = "templates/cache folder is not writable for uid {$apache_user['name']}";
} }
if (!is_writable(THEME_DIR.'/compile')) { if (!is_writable(TEMPLATE_DIR . '/compile')) {
$error[] = "templates/compile folder is not writable for uid {$apache_user['name']}"; $error[] = "templates/compile folder is not writable for uid {$apache_user['name']}";
} }

View File

@ -3,20 +3,20 @@ $defflip = (!cfip()) ? exit(header('HTTP/1.1 401 Unauthorized')) : 1;
// Used for performance calculations // Used for performance calculations
$dStartTime = microtime(true); $dStartTime = microtime(true);
define('INCLUDE_DIR', BASEPATH . 'include'); define('INCLUDE_DIR', BASEPATH . '../include');
define('CLASS_DIR', INCLUDE_DIR . '/classes'); define('CLASS_DIR', INCLUDE_DIR . '/classes');
define('PAGES_DIR', INCLUDE_DIR . '/pages'); define('PAGES_DIR', INCLUDE_DIR . '/pages');
define('THEME_DIR', BASEPATH . 'templates'); define('TEMPLATE_DIR', BASEPATH . '../templates');
$quickstartlink = "<a href='https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide' title='MPOS Quick Start Guide'>Quick Start Guide</a>"; $quickstartlink = "<a href='https://github.com/MPOS/php-mpos/wiki/Quick-Start-Guide' title='MPOS Quick Start Guide'>Quick Start Guide</a>";
// Include our configuration (holding defines for the requires) // Include our configuration (holding defines for the requires)
if (!include_once(BASEPATH . 'include/config/global.inc.dist.php')) die('Unable to load base global config from ['.BASEPATH . 'include/config/global.inc.dist.php' . '] - '.$quickstartlink); if (!include_once(INCLUDE_DIR . '/config/global.inc.dist.php')) die('Unable to load base global config from ['.INCLUDE_DIR. '/config/global.inc.dist.php' . '] - '.$quickstartlink);
if (!@include_once(BASEPATH . 'include/config/global.inc.php')) die('Unable to load your global config from ['.BASEPATH . 'include/config/global.inc.php' . '] - '.$quickstartlink); if (!@include_once(INCLUDE_DIR . '/config/global.inc.php')) die('Unable to load your global config from ['.INCLUDE_DIR. '/config/global.inc.php' . '] - '.$quickstartlink);
// load our security configs // load our security configs
if (!include_once(BASEPATH . 'include/config/security.inc.dist.php')) die('Unable to load base security config from ['.BASEPATH . 'include/config/security.inc.dist.php' . '] - '.$quickstartlink); if (!include_once(INCLUDE_DIR . '/config/security.inc.dist.php')) die('Unable to load base security config from ['.INCLUDE_DIR. '/config/security.inc.dist.php' . '] - '.$quickstartlink);
if (@file_exists(BASEPATH . 'include/config/security.inc.php')) include_once(BASEPATH . 'include/config/security.inc.php'); if (@file_exists(INCLUDE_DIR . '/config/security.inc.php')) include_once(INCLUDE_DIR . '/config/security.inc.php');
// start our session, we need it for smarty caching // start our session, we need it for smarty caching
session_set_cookie_params(time()+$config['cookie']['duration'], $config['cookie']['path'], $config['cookie']['domain'], $config['cookie']['secure'], $config['cookie']['httponly']); session_set_cookie_params(time()+$config['cookie']['duration'], $config['cookie']['path'], $config['cookie']['domain'], $config['cookie']['secure'], $config['cookie']['httponly']);
@ -36,4 +36,4 @@ $master_template = 'master.tpl';
// We include all needed files here, even though our templates could load them themself // We include all needed files here, even though our templates could load them themself
require_once(INCLUDE_DIR . '/autoloader.inc.php'); require_once(INCLUDE_DIR . '/autoloader.inc.php');
?> ?>

View File

@ -17,13 +17,13 @@ class Template extends Base {
/** /**
* Get all available themes * Get all available themes
* Read theme folders from THEME_DIR * Read theme folders from TEMPLATE_DIR
* *
* @return array - list of available themes * @return array - list of available themes
*/ */
public function getThemes() { public function getThemes() {
$this->debug->append("STA " . __METHOD__, 4); $this->debug->append("STA " . __METHOD__, 4);
$aTmpThemes = glob(THEME_DIR . '/*'); $aTmpThemes = glob(TEMPLATE_DIR . '/*');
$aThemes = array(); $aThemes = array();
foreach ($aTmpThemes as $dir) { foreach ($aTmpThemes as $dir) {
if (basename($dir) != 'cache' && basename($dir) != 'compile' && basename($dir) != 'mail') $aThemes[basename($dir)] = basename($dir); if (basename($dir) != 'cache' && basename($dir) != 'compile' && basename($dir) != 'mail') $aThemes[basename($dir)] = basename($dir);
@ -86,12 +86,12 @@ class Template extends Base {
/** /**
* Return the content of specific template file * Return the content of specific template file
* *
* @param $file - file of template related to THEME_DIR * @param $file - file of template related to TEMPLATE_DIR
* @return string - content of the template file * @return string - content of the template file
*/ */
public function getTemplateContent($file) { public function getTemplateContent($file) {
$this->debug->append("STA " . __METHOD__, 4); $this->debug->append("STA " . __METHOD__, 4);
$filepath = THEME_DIR . '/' . $file; $filepath = TEMPLATE_DIR . '/' . $file;
return file_get_contents($filepath); return file_get_contents($filepath);
} }
@ -103,7 +103,7 @@ class Template extends Base {
*/ */
public function getTemplateFiles($theme) { public function getTemplateFiles($theme) {
$this->debug->append("STA " . __METHOD__, 4); $this->debug->append("STA " . __METHOD__, 4);
$folder = THEME_DIR . '/' . $theme; $folder = TEMPLATE_DIR . '/' . $theme;
$dir = new RecursiveDirectoryIterator($folder); $dir = new RecursiveDirectoryIterator($folder);
$ite = new RecursiveIteratorIterator($dir); $ite = new RecursiveIteratorIterator($dir);
@ -130,7 +130,7 @@ class Template extends Base {
$templates = array(); $templates = array();
foreach($themes as $theme) { foreach($themes as $theme) {
$templates[$theme] = $this->_getTemplatesTreeRecursive(THEME_DIR . '/' . $theme); $templates[$theme] = $this->_getTemplatesTreeRecursive(TEMPLATE_DIR . '/' . $theme);
} }
return $templates; return $templates;

Some files were not shown because too many files have changed in this diff Show More