/** * * @param string $value * @return boolean */ function _getHashedValue($value) { $secret_word = AppConf::get('security.salt'); list($value, $hash) = explode('#@#', $value); if (sha1($secret_word . $value) == $hash) { return $value; } else { return false; } }
/** * */ public function __construct() { if (ServiceLocator::$called_class == 'system\\security\\Authentication') { // Forces sessions to only use cookies. if (ini_set('session.use_only_cookies', 1) === FALSE) { exit('Could not initiate a safe session'); } $cookieParams = session_get_cookie_params(); session_set_cookie_params($cookieParams["lifetime"], $cookieParams["path"], $cookieParams["domain"], false, true); session_name(AppConf::get('session.name')); session_save_path(realpath(path('application/tmp/sess'))); session_start(); session_regenerate_id(true); } else { session_name(AppConf::get('session.name')); session_save_path(realpath(path('application/tmp/sess'))); session_start(); } $this->session =& $_SESSION; }
public function __construct() { $this->_key = \application\config\AppConf::get('security.cipher'); }
/** * */ public function __construct() { $this->__encryptionKey = \application\config\AppConf::get('security.encryption_key'); }
/** * */ function __construct() { $this->__cipher = \application\config\AppConf::get('security.cipher'); $this->__salt = \application\config\AppConf::get('security.salt'); }
public function foreignKey($foreign_key, $ref_table, $ref_col) { $db_name = \application\config\AppConf::get('db.name'); $this->_foreign_key_query .= "ALTER TABLE `{$this->table}` ADD FOREIGN KEY (`{$foreign_key}`) REFERENCES `{$db_name}`.`{$ref_table}`(`{$ref_col}`) ON DELETE CASCADE ON UPDATE CASCADE;"; }