mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Making changes to Security class
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3353 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
905117bbc6
commit
36ae60d0e7
2 changed files with 61 additions and 57 deletions
|
@ -43,7 +43,7 @@ class Security extends Object{
|
||||||
function &getInstance() {
|
function &getInstance() {
|
||||||
static $instance = array();
|
static $instance = array();
|
||||||
if (!$instance) {
|
if (!$instance) {
|
||||||
$instance[0] = &new Security;
|
$instance[0] =& new Security;
|
||||||
}
|
}
|
||||||
return $instance[0];
|
return $instance[0];
|
||||||
}
|
}
|
||||||
|
@ -53,6 +53,7 @@ class Security extends Object{
|
||||||
* @return unknown
|
* @return unknown
|
||||||
*/
|
*/
|
||||||
function inactiveMins() {
|
function inactiveMins() {
|
||||||
|
$_this =& Security::getInstance();
|
||||||
switch(CAKE_SECURITY) {
|
switch(CAKE_SECURITY) {
|
||||||
case 'high':
|
case 'high':
|
||||||
return 10;
|
return 10;
|
||||||
|
@ -82,6 +83,7 @@ class Security extends Object{
|
||||||
* @return unknown
|
* @return unknown
|
||||||
*/
|
*/
|
||||||
function validateAuthKey($authKey) {
|
function validateAuthKey($authKey) {
|
||||||
|
$_this =& Security::getInstance();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -92,6 +94,7 @@ class Security extends Object{
|
||||||
* @return unknown
|
* @return unknown
|
||||||
*/
|
*/
|
||||||
function hash($string, $type = 'sha1') {
|
function hash($string, $type = 'sha1') {
|
||||||
|
$_this =& Security::getInstance();
|
||||||
$type = strtolower($type);
|
$type = strtolower($type);
|
||||||
if ($type == 'sha1') {
|
if ($type == 'sha1') {
|
||||||
if (function_exists('sha1')) {
|
if (function_exists('sha1')) {
|
||||||
|
@ -124,6 +127,7 @@ class Security extends Object{
|
||||||
* @return unknown
|
* @return unknown
|
||||||
*/
|
*/
|
||||||
function cipher($text, $key) {
|
function cipher($text, $key) {
|
||||||
|
$_this =& Security::getInstance();
|
||||||
if (!defined('CIPHER_SEED')) {
|
if (!defined('CIPHER_SEED')) {
|
||||||
//This is temporary will change later
|
//This is temporary will change later
|
||||||
define('CIPHER_SEED', '76859309657453542496749683645');
|
define('CIPHER_SEED', '76859309657453542496749683645');
|
||||||
|
|
Loading…
Add table
Reference in a new issue