From 0bd9529e302db3ce588a66870dd6186e2142c433 Mon Sep 17 00:00:00 2001 From: tehron Date: Sun, 20 Oct 2019 20:41:12 +0200 Subject: [PATCH 1/2] fix domain and fix URLs to resources on caching hosts --- files/class.loader.php | 8 ++++---- files/example.config.php | 5 +++-- html/index.php | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/files/class.loader.php b/files/class.loader.php index 25abfa5..83ca0be 100644 --- a/files/class.loader.php +++ b/files/class.loader.php @@ -82,7 +82,7 @@ public function load($type) { $path = "{$this->css_base}min/{$this->theme}/main.css"; if ($this->generate($path, $this->default_css, 'css')) { $buster = filemtime($this->php_base.$path); - $css_includes = "\n"; + $css_includes = "\n"; } //Build custom CSS file, if required @@ -94,7 +94,7 @@ public function load($type) { if ($this->generate($path, $this->custom_css, 'css')) { $buster = filemtime($this->php_base.$path); - $css_includes .= " \n"; + $css_includes .= " \n"; } } @@ -104,7 +104,7 @@ public function load($type) { $path = "{$this->js_base}min/main.js"; if ($this->generate($path, $this->default_js, 'js')) { $buster = filemtime($this->php_base.$path); - $js_includes = "\n"; + $js_includes = "\n"; } //Build custom JS, if required @@ -116,7 +116,7 @@ public function load($type) { if ($this->generate($path, $this->custom_js, 'js')) { $buster = filemtime($this->php_base.$path); - $js_includes .= " \n"; + $js_includes .= " \n"; } } diff --git a/files/example.config.php b/files/example.config.php index 1f853c0..d5f9cff 100644 --- a/files/example.config.php +++ b/files/example.config.php @@ -1,5 +1,6 @@ \ No newline at end of file +?> diff --git a/html/index.php b/html/index.php index 904d176..67d8a82 100644 --- a/html/index.php +++ b/html/index.php @@ -30,7 +30,7 @@ require_once('header.php'); ?>
- HackThis!! - The hackers playground + HackThis!! - The hackers playground
Date: Sun, 20 Oct 2019 20:43:09 +0200 Subject: [PATCH 2/2] make session save path configurable --- files/example.config.php | 1 + files/init.php | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/files/example.config.php b/files/example.config.php index d5f9cff..e689f99 100644 --- a/files/example.config.php +++ b/files/example.config.php @@ -4,6 +4,7 @@ // Site variables $config['path'] = realpath($_SERVER["DOCUMENT_ROOT"] . '/../'); + $config['session-path'] = '/srv/www/hackthis.co.uk/sessions'; // Database configuration $config['db']['driver'] = 'mysql'; diff --git a/files/init.php b/files/init.php index 21cd5f9..50d4c82 100644 --- a/files/init.php +++ b/files/init.php @@ -2,7 +2,8 @@ // session_set_save_handler('redis'); // session_save_path("tcp://gir:9248"); - session_save_path('/srv/www/hackthis.co.uk/sessions'); + require('config.php'); + session_save_path($config['session-path']); ini_set('session.gc_maxlifetime', 3*60*60); // 3 hours ini_set('session.gc_probability', 1); ini_set('session.gc_divisor', 100);