From e3d060196b819c632ea9f1b695cc89ba1527cb42 Mon Sep 17 00:00:00 2001 From: Peter Goodhall Date: Fri, 19 Aug 2011 22:10:53 +0100 Subject: [PATCH] Improvements to the contest pages layout and added auth to it --- application/controllers/contest.php | 30 ++++++------------- application/views/contest/log.php | 45 ++++++++++++++++++++++++----- application/views/layout/header.php | 15 +++++++++- 3 files changed, 61 insertions(+), 29 deletions(-) diff --git a/application/controllers/contest.php b/application/controllers/contest.php index d9ca6eb7..11e5afb8 100644 --- a/application/controllers/contest.php +++ b/application/controllers/contest.php @@ -6,15 +6,9 @@ class Contest extends CI_Controller { // Displays available contests public function index() { - $this->load->model('user_model'); - if(!$this->user_model->authorize($this->config->item('auth_mode'))) { - if($this->user_model->validate_session()) { - $this->user_model->clear_session(); - show_error('Access denied

Click here to log in as another user', 403); - } else { - redirect('user/login'); - } - } + $this->load->model('logbook_model'); + $this->load->model('user_model'); + if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } // Load database items $this->load->model('contests'); @@ -30,15 +24,9 @@ class Contest extends CI_Controller { Displays contest logging view based on the ID provided, allowing users to log in contest mode giving them serial numbers and scoring information. */ public function view($id) { - $this->load->model('user_model'); - if(!$this->user_model->authorize($this->config->item('auth_mode'))) { - if($this->user_model->validate_session()) { - $this->user_model->clear_session(); - show_error('Access denied

Click here to log in as another user', 403); - } else { - redirect('user/login'); - } - } + $this->load->model('logbook_model'); + $this->load->model('user_model'); + if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } // Load database information $this->load->model('contests'); @@ -94,11 +82,10 @@ class Contest extends CI_Controller { Create a contest, these are linked to templates for scoring information. contests are per entry like a weekly RSGB Club contest etc. */ public function create() { - - // Load database items - $this->load->model('contests'); + $this->load->model('logbook_model'); $this->load->model('user_model'); if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } + $data['templates'] = $this->contests->list_templates(); $this->load->helper(array('form', 'url')); @@ -127,6 +114,7 @@ class Contest extends CI_Controller { $this->load->model('user_model'); if(!$this->user_model->authorize(2)) { $this->session->set_flashdata('notice', 'You\'re not allowed to do that!'); redirect('dashboard'); } + $this->load->helper(array('form', 'url')); $this->load->library('form_validation'); diff --git a/application/views/contest/log.php b/application/views/contest/log.php index 0543ba73..6da41d28 100644 --- a/application/views/contest/log.php +++ b/application/views/contest/log.php @@ -198,10 +198,10 @@ function settime () { -

+
+ - @@ -295,22 +295,53 @@ function settime () { - + - + qra == "Y") { ?> - +
Time Callsign
+ +
- +
+ + + - \ No newline at end of file + + + \ No newline at end of file diff --git a/application/views/layout/header.php b/application/views/layout/header.php index ab503a98..bf03f746 100644 --- a/application/views/layout/header.php +++ b/application/views/layout/header.php @@ -121,6 +121,19 @@ margin: 10px 0; width: 30%; float: right; margin: 0 auto; +} +.contest_qso_box { +width: 695px; +margin: 5px; +padding: 5px; +border: 1px solid #dddddd; +border-radius: 10px; +-moz-border-radius: 10px; +-webkit-border-radius: 10px; +} + +.contest_qso_box table { + width: 695px; } @@ -139,8 +152,8 @@ margin: 10px 0;
  • Search
  • config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE) { ?>
  • Add QSO
  • -
  • Contests
  • + config->item('use_auth') && ($this->session->userdata('user_type') >= 2)) || $this->config->item('use_auth') === FALSE){ ?>
  • Notes