Implemented secure variable in the module, removed request variable and will potentially add it back in at a later time.
This commit is contained in:
parent
985deaf18a
commit
14f0efbea0
2 changed files with 12 additions and 15 deletions
|
@ -138,6 +138,18 @@ class Controller extends Object
|
|||
$module = new Module();
|
||||
}
|
||||
|
||||
// Determines if we need to serve over HTTP or HTTPS
|
||||
if ($module->secure == false && isset($_SERVER['HTTPS']))
|
||||
{
|
||||
header('Location: http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
||||
exit;
|
||||
}
|
||||
elseif ($module->secure == true && !isset($_SERVER['HTTPS']))
|
||||
{
|
||||
header('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Establishes the session
|
||||
if (ini_get('session.auto_start') == 0)
|
||||
{
|
||||
|
|
|
@ -66,7 +66,6 @@ class Module extends Object
|
|||
*
|
||||
* @access protected
|
||||
* @var boolean, null by default
|
||||
* @todo Implement this functionality
|
||||
*/
|
||||
protected $secure = null;
|
||||
|
||||
|
@ -123,20 +122,6 @@ class Module extends Object
|
|||
*/
|
||||
protected $template = 'index';
|
||||
|
||||
/**
|
||||
* Request Data
|
||||
*
|
||||
* Modules should not interact with $_REQUEST, $_POST or $_GET directly as
|
||||
* the contents could be unsafe. The Controller cleanses this data and sets
|
||||
* it into this variable for safe access by the module.
|
||||
*
|
||||
* @access protected
|
||||
* @var array, null by default
|
||||
* @todo Currently the super globals are not being cleared out
|
||||
* @todo Not even sure I want to implement this at this point
|
||||
*/
|
||||
protected $request = null;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue