Commit 5c554165 by Scott

Show configured cache path instead of (possibly empty) realpath

And always show Caching admin submenu
parent 9b3d5076
...@@ -39,10 +39,10 @@ class Q2A_Storage_FileCache ...@@ -39,10 +39,10 @@ class Q2A_Storage_FileCache
$this->cacheDir = realpath($config['dir']); $this->cacheDir = realpath($config['dir']);
if (!is_writable($this->cacheDir)) { if (!is_writable($this->cacheDir)) {
$this->error = qa_lang_html_sub('admin/caching_dir_error', $this->cacheDir); $this->error = qa_lang_html_sub('admin/caching_dir_error', $config['dir']);
} elseif (strpos($this->cacheDir, realpath($_SERVER['DOCUMENT_ROOT'])) === 0 || strpos($this->cacheDir, realpath(QA_BASE_DIR)) === 0) { } elseif (strpos($this->cacheDir, realpath($_SERVER['DOCUMENT_ROOT'])) === 0 || strpos($this->cacheDir, realpath(QA_BASE_DIR)) === 0) {
// check the folder is outside the public root - checks against server root and Q2A root, in order to handle symbolic links // check the folder is outside the public root - checks against server root and Q2A root, in order to handle symbolic links
$this->error = qa_lang_html_sub('admin/caching_dir_public', $this->cacheDir); $this->error = qa_lang_html_sub('admin/caching_dir_public', $config['dir']);
} }
} else { } else {
$this->error = qa_lang_html('admin/caching_dir_missing'); $this->error = qa_lang_html('admin/caching_dir_missing');
......
...@@ -352,12 +352,10 @@ function qa_admin_sub_navigation() ...@@ -352,12 +352,10 @@ function qa_admin_sub_navigation()
'url' => qa_path_html('admin/spam'), 'url' => qa_path_html('admin/spam'),
); );
if (defined('QA_CACHE_DIRECTORY')) { $navigation['admin/caching'] = array(
$navigation['admin/caching'] = array( 'label' => qa_lang_html('admin/caching_title'),
'label' => qa_lang_html('admin/caching_title'), 'url' => qa_path_html('admin/caching'),
'url' => qa_path_html('admin/caching'), );
);
}
$navigation['admin/stats'] = array( $navigation['admin/stats'] = array(
'label' => qa_lang_html('admin/stats_title'), 'label' => qa_lang_html('admin/stats_title'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment