aboutsummaryrefslogtreecommitdiff
path: root/h-source/Application/Controllers
diff options
context:
space:
mode:
Diffstat (limited to 'h-source/Application/Controllers')
-rw-r--r--h-source/Application/Controllers/BaseController.php7
-rw-r--r--h-source/Application/Controllers/GenericController.php4
-rw-r--r--h-source/Application/Controllers/UsersController.php9
3 files changed, 11 insertions, 9 deletions
diff --git a/h-source/Application/Controllers/BaseController.php b/h-source/Application/Controllers/BaseController.php
index eb8042d..0954d2f 100644
--- a/h-source/Application/Controllers/BaseController.php
+++ b/h-source/Application/Controllers/BaseController.php
@@ -29,6 +29,7 @@ class BaseController extends Controller
protected $isadmin = false;
protected $querySanitized = true;
protected $token = 'token';
+ protected $_updating;
protected $_topMenuClasses = array(
"home" => null,
@@ -50,6 +51,7 @@ class BaseController extends Controller
$this->model('BoxesModel');
$this->model('HistoryModel');
+ $this->model('ParamsModel');
$this->load('header');
$this->load('footer','last');
@@ -102,6 +104,11 @@ class BaseController extends Controller
$data['querySanitized'] = $this->querySanitized;
$data['queryString'] = Url::createUrl($this->_queryString);
+ //check it they are updating the website
+ $updating = $this->m['ParamsModel']->select('updating')->where(array('id_par'=>1))->toList('updating')->send();
+ $data['updating_flag'] = $updating[0];
+ $this->_updating = $data['updating_flag'];
+
$this->append($data);
}
diff --git a/h-source/Application/Controllers/GenericController.php b/h-source/Application/Controllers/GenericController.php
index 829fe05..4ac197c 100644
--- a/h-source/Application/Controllers/GenericController.php
+++ b/h-source/Application/Controllers/GenericController.php
@@ -63,7 +63,9 @@ class GenericController extends BaseController
protected function insert($lang = 'en', $token = '')
{
$this->shift(2);
-
+
+ if ( strcmp($this->_updating,'no') !== 0 ) $this->redirect('users/login/'.$this->lang,0);
+
$clean['token'] = sanitizeAlphanum($token);
$data['descriptionPreview'] = null; //contains the HTML of the preview of the description entry
diff --git a/h-source/Application/Controllers/UsersController.php b/h-source/Application/Controllers/UsersController.php
index b8fe57e..0e00523 100644
--- a/h-source/Application/Controllers/UsersController.php
+++ b/h-source/Application/Controllers/UsersController.php
@@ -23,8 +23,6 @@ if (!defined('EG')) die('Direct access not allowed!');
class UsersController extends BaseController
{
- private $_updating;
-
public function __construct($model, $controller, $queryString)
{
parent::__construct($model, $controller, $queryString);
@@ -32,12 +30,7 @@ class UsersController extends BaseController
$this->model('UsersModel');
$this->model('ProfileModel');
$this->model('HardwareModel');
- $this->model('ParamsModel');
-
- $updating = $this->m['ParamsModel']->select('updating')->where(array('id_par'=>1))->toList('updating')->send();
- $data['updating_flag'] = $updating[0];
- $this->_updating = $data['updating_flag'];
-
+
$data['title'] = 'Login';
$this->append($data);
}