diff --git a/htdocs/application/config/stikked.php b/htdocs/application/config/stikked.php index f4d99f1..455eb3f 100755 --- a/htdocs/application/config/stikked.php +++ b/htdocs/application/config/stikked.php @@ -63,6 +63,14 @@ $config['backup_pass'] = ''; **/ $config['per_page'] = 10; +/** + * Disable public pastes + * + * No recent pastes will be displayed. + * +**/ +$config['private_only'] = false; + /** * Default language * diff --git a/htdocs/application/controllers/main.php b/htdocs/application/controllers/main.php index 3ec6775..c3e1b3a 100755 --- a/htdocs/application/controllers/main.php +++ b/htdocs/application/controllers/main.php @@ -312,21 +312,29 @@ class Main extends CI_Controller function lists() { - $this->load->model('pastes'); - $data = $this->pastes->getLists(); - if ($this->uri->segment(2) == 'rss') + if ($this->config->item('private_only')) { - $this->load->helper('text'); - $data['page_title'] = $this->config->item('site_name'); - $data['feed_url'] = site_url('lists/rss'); - $data['replies'] = $data['pastes']; - unset($data['pastes']); - $this->load->view('view/rss', $data); + show_404(); } else { - $this->load->view('list', $data); + $this->load->model('pastes'); + $data = $this->pastes->getLists(); + + if ($this->uri->segment(2) == 'rss') + { + $this->load->helper('text'); + $data['page_title'] = $this->config->item('site_name'); + $data['feed_url'] = site_url('lists/rss'); + $data['replies'] = $data['pastes']; + unset($data['pastes']); + $this->load->view('view/rss', $data); + } + else + { + $this->load->view('list', $data); + } } } diff --git a/htdocs/application/errors/error_404.php b/htdocs/application/errors/error_404.php index 88ebede..0b2aef9 100755 --- a/htdocs/application/errors/error_404.php +++ b/htdocs/application/errors/error_404.php @@ -23,6 +23,7 @@ header("HTTP/1.1 404 Not Found"); diff --git a/htdocs/application/errors/error_db.php b/htdocs/application/errors/error_db.php index b60afdc..45225c7 100755 --- a/htdocs/application/errors/error_db.php +++ b/htdocs/application/errors/error_db.php @@ -23,6 +23,7 @@ header("HTTP/1.1 404 Not Found"); diff --git a/htdocs/application/errors/error_general.php b/htdocs/application/errors/error_general.php index b60afdc..45225c7 100755 --- a/htdocs/application/errors/error_general.php +++ b/htdocs/application/errors/error_general.php @@ -23,6 +23,7 @@ header("HTTP/1.1 404 Not Found"); diff --git a/htdocs/application/views/defaults/header.php b/htdocs/application/views/defaults/header.php index 8594d3d..25085de 100755 --- a/htdocs/application/views/defaults/header.php +++ b/htdocs/application/views/defaults/header.php @@ -48,7 +48,9 @@ $this->carabiner->display('css'); diff --git a/htdocs/application/views/defaults/paste_form.php b/htdocs/application/views/defaults/paste_form.php index 79b6feb..ccea17f 100644 --- a/htdocs/application/views/defaults/paste_form.php +++ b/htdocs/application/views/defaults/paste_form.php @@ -65,6 +65,7 @@
+config->item('private_only')){ ?> @@ -74,7 +75,8 @@ echo form_checkbox($set); ?>
- + +