From a197ef5e020b206c50edb2bb01703a23f83c2777 Mon Sep 17 00:00:00 2001 From: Knah Tsaeb Date: Thu, 8 Dec 2016 10:03:46 +0100 Subject: [PATCH] Restore custum tpl dir --- application/config/ConfigManager.php | 3 ++- application/config/ConfigPhp.php | 3 ++- doc/Shaarli-configuration.html | 4 ++-- doc/Shaarli-configuration.md | 15 +++++++-------- index.php | 3 ++- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/application/config/ConfigManager.php b/application/config/ConfigManager.php index dbce69a..4231e4c 100644 --- a/application/config/ConfigManager.php +++ b/application/config/ConfigManager.php @@ -189,7 +189,7 @@ class ConfigManager 'general.title', 'general.header_link', 'privacy.default_private_links', - 'redirector.url' + 'redirector.url', ); // Only logged in user can alter config. @@ -296,6 +296,7 @@ class ConfigManager $this->setEmpty('resource.updates', 'data/updates.txt'); $this->setEmpty('resource.log', 'data/log.txt'); $this->setEmpty('resource.update_check', 'data/lastupdatecheck.txt'); + $this->setEmpty('resource.raintpl_tpl', 'tpl/'); $this->setEmpty('resource.theme', 'default'); $this->setEmpty('resource.raintpl_tmp', 'tmp/'); $this->setEmpty('resource.thumbnails_cache', 'cache'); diff --git a/application/config/ConfigPhp.php b/application/config/ConfigPhp.php index 5752d37..2eb68d8 100644 --- a/application/config/ConfigPhp.php +++ b/application/config/ConfigPhp.php @@ -40,6 +40,7 @@ class ConfigPhp implements ConfigIO 'resource.updates' => 'config.UPDATES_FILE', 'resource.log' => 'config.LOG_FILE', 'resource.update_check' => 'config.UPDATECHECK_FILENAME', + 'resource.raintpl_tpl' => 'config.RAINTPL_TPL', 'resource.theme' => 'config.theme', 'resource.raintpl_tmp' => 'config.RAINTPL_TMP', 'resource.thumbnails_cache' => 'config.CACHEDIR', @@ -99,7 +100,7 @@ class ConfigPhp implements ConfigIO $configStr .= '$GLOBALS[\'' . $key . '\'] = ' . var_export($conf[$key], true) . ';' . PHP_EOL; } } - + // Store all $conf['config'] foreach ($conf['config'] as $key => $value) { $configStr .= '$GLOBALS[\'config\'][\''. $key .'\'] = '.var_export($conf['config'][$key], true).';'. PHP_EOL; diff --git a/doc/Shaarli-configuration.html b/doc/Shaarli-configuration.html index 3494506..6d717c6 100644 --- a/doc/Shaarli-configuration.html +++ b/doc/Shaarli-configuration.html @@ -172,7 +172,7 @@ It might be useful if your IP adress often changes.
updates: File path for the ran updates file.
log: Log file path.
update_check: Last update check file path.
-theme: Templates directory.
+raintpl_tpl: Templates directory.
raintpl_tmp: Template engine cache directory.
thumbnails_cache: Thumbnails cache directory.
page_cache: Shaarli's internal cache directory.
@@ -220,7 +220,7 @@ It might be useful if your IP adress often changes.
"log": "data\/log.txt", "update_check": "data\/lastupdatecheck.txt", "raintpl_tmp": "tmp\/", - "theme": "tpl\/", + "raintpl_tpl": "tpl\/", "thumbnails_cache": "cache", "page_cache": "pagecache" }, diff --git a/doc/Shaarli-configuration.md b/doc/Shaarli-configuration.md index 430bc5f..f6fd414 100644 --- a/doc/Shaarli-configuration.md +++ b/doc/Shaarli-configuration.md @@ -3,7 +3,7 @@ ## Foreword -**Do not edit configuration options in index.php! Your changes would be lost.** +**Do not edit configuration options in index.php! Your changes would be lost.** Once your Shaarli instance is installed, the file `data/config.json.php` is generated: * it contains all settings in JSON format, and can be edited to customize values @@ -42,7 +42,7 @@ In `data/config.json.php`. See also [Plugin System](Plugin-System.html).[](.html) ### Credentials - + > You shouldn't edit those. **login**: Login username. @@ -59,12 +59,12 @@ See also [Plugin System](Plugin-System.html).[](.html) ### Security -**session_protection_disabled**: Disable session cookie hijacking protection (not recommended). +**session_protection_disabled**: Disable session cookie hijacking protection (not recommended). It might be useful if your IP adress often changes. **ban_after**: Failed login attempts before being IP banned. **ban_duration**: IP ban duration in seconds. **open_shaarli**: Anyone can add a new link while logged out if enabled. -**trusted_proxies**: List of trusted IP which won't be banned after failed login attemps. Useful if Shaarli is behind a reverse proxy. +**trusted_proxies**: List of trusted IP which won't be banned after failed login attemps. Useful if Shaarli is behind a reverse proxy. ### Resources @@ -73,7 +73,7 @@ It might be useful if your IP adress often changes. **updates**: File path for the ran updates file. **log**: Log file path. **update_check**: Last update check file path. -**theme**: Templates directory. +**raintpl_tpl**: Templates directory. **raintpl_tmp**: Template engine cache directory. **thumbnails_cache**: Thumbnails cache directory. **page_cache**: Shaarli's internal cache directory. @@ -134,7 +134,7 @@ It might be useful if your IP adress often changes. "log": "data\/log.txt", "update_check": "data\/lastupdatecheck.txt", "raintpl_tmp": "tmp\/", - "theme": "tpl\/", + "raintpl_tpl": "tpl\/", "thumbnails_cache": "cache", "page_cache": "pagecache" }, @@ -205,7 +205,6 @@ It might be useful if your IP adress often changes. ## Additional configuration -The playvideos plugin may require that you adapt your server's +The playvideos plugin may require that you adapt your server's [Content Security Policy](https://github.com/shaarli/Shaarli/blob/master/plugins/playvideos/README.md#troubleshooting) [](.html) configuration to work properly.[(.html)]((.html).html) - diff --git a/index.php b/index.php index 317e8e1..871e2eb 100644 --- a/index.php +++ b/index.php @@ -123,11 +123,12 @@ $conf = new ConfigManager(); $conf->setEmpty('general.timezone', date_default_timezone_get()); $conf->setEmpty('general.title', 'Shared links on '. escape(index_url($_SERVER))); $conf->setEmpty('resource.theme', 'default'); -RainTPL::$tpl_dir = 'tpl/'.$conf->get('resource.theme').'/'; // template directory +RainTPL::$tpl_dir = $conf->get('resource.raintpl_tpl').'/'.$conf->get('resource.theme').'/'; // template directory RainTPL::$cache_dir = $conf->get('resource.raintpl_tmp'); // cache directory $pluginManager = new PluginManager($conf); $pluginManager->load($conf->get('general.enabled_plugins')); + date_default_timezone_set($conf->get('general.timezone', 'UTC')); ob_start(); // Output buffering for the page cache.