コード例 #1
0
 /**
  * 
  * @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;
     }
 }
コード例 #2
0
ファイル: Session.php プロジェクト: netprogs1/yafop
 /**
  * 
  */
 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;
 }
コード例 #3
0
ファイル: JwtAuth.php プロジェクト: netprogs1/yafop
 public function __construct()
 {
     $this->_key = \application\config\AppConf::get('security.cipher');
 }
コード例 #4
0
ファイル: Hash.php プロジェクト: netprogs1/yafop
 /**
  * 
  */
 public function __construct()
 {
     $this->__encryptionKey = \application\config\AppConf::get('security.encryption_key');
 }
コード例 #5
0
ファイル: Authentication.php プロジェクト: netprogs1/yafop
 /**
  * 
  */
 function __construct()
 {
     $this->__cipher = \application\config\AppConf::get('security.cipher');
     $this->__salt = \application\config\AppConf::get('security.salt');
 }
コード例 #6
0
ファイル: SchemaBuilder.php プロジェクト: netprogs1/yafop
 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;";
 }