Пример #1
0
 public function __construct($name = null)
 {
     if (Value::SetAndNotNull($name)) {
         $this->_name = $name;
     } else {
         do {
             $this->_name = UUID::Create();
         } while (file_exists($this->GetLocalFile()));
     }
 }
Пример #2
0
 public function hashUserNameAndPassword($_password)
 {
     $md5UserName = md5($this->userName);
     $md5UserNameAndPassword = md5($this->userName . $_password);
     //$userName.$password
     $this->userNameHashed = hash('sha512', $md5UserName);
     //userNameHash $sha512Ofmd5UserName
     $this->personalSalt = hash("sha512", UUID::Create());
     // dynamic salt personal salt sha512OfUUID
     $this->passwordHashed = hash("sha512", STATIC_SALT . $md5UserNameAndPassword . $this->personalSalt . $this->userNameHashed);
 }
Пример #3
0
 /**
  * Creates a Security token to secure a form against XSRF.
  */
 public static function CreateSecurityToken()
 {
     $token = md5(utf8_encode(UUID::Create()));
     return $_SESSION[SECURITY_TOKEN] = $token;
 }