/system/application/controllers/log.php
PHP | 52 lines | 41 code | 6 blank | 5 comment | 6 complexity | a2fc601a80f9b62a3bbc3f8845d90fc6 MD5 | raw file
Possible License(s): Apache-2.0
- <?php
- class Log extends Controller {
- function index()
- {
- $this->load->helper('text');
- $this->template->set('page_title', 'Logs');
- $this->template->set('nav_links', array('log/clear' => 'Clear Log'));
- $this->template->load('template', 'log/index');
- /* Check access */
- if ( ! check_access('view log'))
- {
- $this->messages->add('Permission denied.', 'error');
- redirect('');
- return;
- }
- return;
- }
- function clear()
- {
- /* Check access */
- if ( ! check_access('clear log'))
- {
- $this->messages->add('Permission denied.', 'error');
- redirect('log');
- return;
- }
- /* Check for account lock */
- if ($this->config->item('account_locked') == 1)
- {
- $this->messages->add('Account is locked.', 'error');
- redirect('log');
- return;
- }
- if ($this->db->truncate('logs'))
- {
- $this->messages->add('Log cleared.', 'success');
- redirect('log');
- } else {
- $this->messages->add('Error clearing Log.', 'error');
- redirect('log');
- }
- return;
- }
- }
- /* End of file log.php */
- /* Location: ./system/application/controllers/log.php */