From ffbe8c5b1a7ee87e5cdbfb916daac6e5549c0c76 Mon Sep 17 00:00:00 2001 From: Olusesan Ameye Date: Sat, 22 Oct 2022 23:17:52 +0000 Subject: [PATCH 1/6] Remove GLOBALS dump --- www/backend.php | 1 - 1 file changed, 1 deletion(-) diff --git a/www/backend.php b/www/backend.php index d15e8249..cc19cf61 100644 --- a/www/backend.php +++ b/www/backend.php @@ -1,5 +1,4 @@ Date: Sat, 22 Oct 2022 23:30:01 +0000 Subject: [PATCH 2/6] writable directory --- www/writable/index.php | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 www/writable/index.php diff --git a/www/writable/index.php b/www/writable/index.php new file mode 100644 index 00000000..e69de29b From 4c09a25d720f0ddff17713f704ad3ea816b22ed3 Mon Sep 17 00:00:00 2001 From: Olusesan Ameye Date: Sat, 22 Oct 2022 23:33:36 +0000 Subject: [PATCH 3/6] Writable subdirectories --- www/writable/cache/index.php | 0 www/writable/logs/index.php | 0 www/writable/session/index.php | 0 www/writable/uploads/index.php | 0 4 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 www/writable/cache/index.php create mode 100644 www/writable/logs/index.php create mode 100644 www/writable/session/index.php create mode 100644 www/writable/uploads/index.php diff --git a/www/writable/cache/index.php b/www/writable/cache/index.php new file mode 100644 index 00000000..e69de29b diff --git a/www/writable/logs/index.php b/www/writable/logs/index.php new file mode 100644 index 00000000..e69de29b diff --git a/www/writable/session/index.php b/www/writable/session/index.php new file mode 100644 index 00000000..e69de29b diff --git a/www/writable/uploads/index.php b/www/writable/uploads/index.php new file mode 100644 index 00000000..e69de29b From 64d482bcf57b705f09966abd6eab9ca0ee8872ca Mon Sep 17 00:00:00 2001 From: Olusesan Ameye Date: Sun, 23 Oct 2022 00:03:17 +0000 Subject: [PATCH 4/6] Ignore writable directory --- www/.gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/www/.gitignore b/www/.gitignore index bcad0a61..e59af500 100644 --- a/www/.gitignore +++ b/www/.gitignore @@ -459,6 +459,9 @@ composer.phar # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file composer.lock +##### CodeIgniter +/writable/ + ##### PHP CodeSniffer # gitignore for the PHP Codesniffer framework # website: https://github.com/squizlabs/PHP_CodeSniffer From 294230f850a4bda020c206d2aa3322fef50e06e9 Mon Sep 17 00:00:00 2001 From: Olusesan Ameye Date: Sun, 23 Oct 2022 00:09:44 +0000 Subject: [PATCH 5/6] Use writable path for logs, cache and session --- www/application/config/config.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/www/application/config/config.php b/www/application/config/config.php index d47b01ec..d25a18ee 100644 --- a/www/application/config/config.php +++ b/www/application/config/config.php @@ -247,7 +247,7 @@ $config['log_threshold'] = 0; | application/logs/ directory. Use a full server path with trailing slash. | */ -$config['log_path'] = ''; +$config['log_path'] = APPPATH.'../writable/logs/'; /* |-------------------------------------------------------------------------- @@ -306,7 +306,7 @@ $config['error_views_path'] = ''; | application/cache/ directory. Use a full server path with trailing slash. | */ -$config['cache_path'] = ''; +$config['cache_path'] = APPPATH.'../writable/cache/'; /* |-------------------------------------------------------------------------- @@ -393,7 +393,7 @@ $config['encryption_key'] = ''; $config['sess_driver'] = 'files'; $config['sess_cookie_name'] = 'ci_session'; $config['sess_expiration'] = 7200; -$config['sess_save_path'] = NULL; +$config['sess_save_path'] = APPPATH.'../writable/session'; $config['sess_match_ip'] = FALSE; $config['sess_time_to_update'] = 300; $config['sess_regenerate_destroy'] = FALSE; From e94a351fd27168f4176bdab6805b1e9c7d06fbb1 Mon Sep 17 00:00:00 2001 From: Olusesan Ameye Date: Sun, 23 Oct 2022 00:10:07 +0000 Subject: [PATCH 6/6] Fix backend model wrapper --- www/application/models/Backend_model.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/www/application/models/Backend_model.php b/www/application/models/Backend_model.php index cfc19582..cb390d4b 100644 --- a/www/application/models/Backend_model.php +++ b/www/application/models/Backend_model.php @@ -56,7 +56,7 @@ class Backend_model extends CI_Model { $stack = debug_backtrace(); $log = json_encode($stack); error_log($log); - error_log(json_encode($in)); + error_log($str); } $ret = $this->wrenchboard->logMessage($str); return $ret; @@ -71,7 +71,7 @@ class Backend_model extends CI_Model { $stack = debug_backtrace(); $log = json_encode($stack); error_log($log); - error_log(json_encode($in)); + error_log($str); } $ret = $this->wrenchboard->cfgReadChar($str); return $ret; @@ -86,14 +86,14 @@ class Backend_model extends CI_Model { $stack = debug_backtrace(); $log = json_encode($stack); error_log($log); - error_log(json_encode($in)); + error_log($str); } $ret = $this->wrenchboard->cfgReadLong($str); return $ret; } private function wrenchboard_load() { - global $wrenchboard; + //global $wrenchboard; // $this->$USER = $_SERVER['SCRIPT_FILENAME']; $wrenchboard_class = 'wrenchboard_api_' . $this->USER . '\\WrenchBoard'; /* if (is_object($wrenchboard) && is_object($wrenchboard->wrenchboard)) {