50 lines
886 B
PHP
Executable File
50 lines
886 B
PHP
Executable File
<?php
|
|
|
|
/**
|
|
* @class security
|
|
* @brief Manage, verify the security of the panel
|
|
*
|
|
* @author Benjamin Mercier
|
|
* @data 08/03/2009
|
|
* @version 0.1
|
|
*/
|
|
class security
|
|
{
|
|
/**
|
|
* @brief Make security controls
|
|
* @return NULL (but make exception if error is find
|
|
*/
|
|
public function __construct ()
|
|
{
|
|
// Critical verification
|
|
$this->checkMagicQuotesGPC();
|
|
|
|
// Configuration
|
|
$this->initializeTimezone();
|
|
} // End of construct
|
|
|
|
|
|
/**
|
|
* @brief Check magic_quote_gpc. If is activated, throwing exception.
|
|
* @return null
|
|
*/
|
|
private function checkMagicQuotesGPC()
|
|
{
|
|
if ( get_magic_quotes_gpc() == 1 ) {
|
|
throw new myException('PHP variable magic_quotes_gpc must be set on Off');
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @brief Initialize the timezone if not set
|
|
* @return null
|
|
*/
|
|
private function initializeTimezone()
|
|
{
|
|
date_default_timezone_set(TIMEZONE);
|
|
}
|
|
|
|
} // End of class
|
|
|
|
?>
|