Prado\Security\TUserManager::getPasswordMode PHP Method

getPasswordMode() public method

public getPasswordMode ( ) : TUserManagerPasswordMode
return TUserManagerPasswordMode how password is stored, clear text, or MD5 or SHA1 hashed. Default to TUserManagerPasswordMode::MD5.
    public function getPasswordMode()
    {
        return $this->_passwordMode;
    }

Usage Example

Esempio n. 1
0
 public function testPasswordMode()
 {
     $userManager = new TUserManager();
     $userManager->setPasswordMode('Clear');
     self::assertEquals('Clear', $userManager->getPasswordMode());
     $userManager->setPasswordMode('MD5');
     self::assertEquals('MD5', $userManager->getPasswordMode());
     $userManager->setPasswordMode('SHA1');
     self::assertEquals('SHA1', $userManager->getPasswordMode());
     try {
         $userManager->setPasswordMode('Invalid');
         self::fail('Exception TInvalidDataValueException not thrown');
     } catch (TInvalidDataValueException $e) {
     }
 }