diff --git a/application/controllers/Debug.php b/application/controllers/Debug.php new file mode 100644 index 00000000..25bffcb6 --- /dev/null +++ b/application/controllers/Debug.php @@ -0,0 +1,69 @@ +load->model('user_model'); + if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } + } + + /* User Facing Links to Backup URLs */ + public function index() + { + $this->load->helper('file'); + + // Test writing to backup folder + if ( ! write_file('backup/myfile.txt', "dummydata")) + { + $data['backup_folder'] = false; + } + else + { + if(unlink(realpath('backup/myfile.txt'))) { + $data['backup_folder'] = true; + } else { + $data['backup_folder'] = false; + } + } + + // Test writing to updates folder + if ( ! write_file('updates/myfile.txt', "dummydata")) + { + $data['updates_folder'] = false; + } + else + { + if(unlink(realpath('updates/myfile.txt'))) { + $data['updates_folder'] = true; + } else { + $data['updates_folder'] = false; + } + } + + // Test writing to uploads folder + if ( ! write_file('uploads/myfile.txt', "dummydata")) + { + $data['uploads_folder'] = false; + } + else + { + if(unlink(realpath('uploads/myfile.txt'))) { + $data['uploads_folder'] = true; + } else { + $data['uploads_folder'] = false; + } + } + + + + $data['page_title'] = "Debug"; + + $this->load->view('interface_assets/header', $data); + $this->load->view('debug/main'); + $this->load->view('interface_assets/footer'); + } + + +} \ No newline at end of file diff --git a/application/views/debug/main.php b/application/views/debug/main.php new file mode 100644 index 00000000..354b5845 --- /dev/null +++ b/application/views/debug/main.php @@ -0,0 +1,132 @@ +
+ +

+ +
+
+ +
+
Server Information
+
+ + + + + + + + + + +
Server Software
PHP Version
+
+
+ +
+
Folder Perimissions
+
+

This checks the folders Cloudlog uses are read and writeable by PHP.

+ + + + + + + + + + + + + + + +
/backup + + Success + + Failed + +
/updates + + Success + + Failed + +
/uploads + + Success + + Failed + +
+
+
+
+ +
+
+
PHP Modules
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
curl + + Installed + + Not Installed + +
MySQL + + Installed + + Not Installed + +
mbstring + + Installed + + Not Installed + +
xml + + Installed + + Not Installed + +
openssl + + Installed + + Not Installed + +
+
+
+
+
+ +
\ No newline at end of file diff --git a/application/views/interface_assets/header.php b/application/views/interface_assets/header.php index b2f7dffe..28f3627d 100644 --- a/application/views/interface_assets/header.php +++ b/application/views/interface_assets/header.php @@ -146,6 +146,9 @@ Update Country Files + + + Debug Information diff --git a/assets/css/general.css b/assets/css/general.css index 851d9a32..6edef258 100644 --- a/assets/css/general.css +++ b/assets/css/general.css @@ -224,4 +224,12 @@ color: #ffffff; #create_station_profile .row { margin-bottom: 10px; -} \ No newline at end of file +} + +/* +* Debug CSS +*/ + + .debug_main .card { + margin-bottom: 10px; + } \ No newline at end of file