function getPassword()  - Return the hashed user password

Cyril Ogana <cogana@gmail.com> - 2014-02-13

@param  $unhashed - flag if true, return unhashed

@return mixed - the hashed password

@access public
556807
public function getPassword($unhashed = false) {
        if((bool) $unhashed === true){
            return $this->_inputPassword;
        }else{
            return \password_hash($this->_inputPassword, \PASSWORD_DEFAULT);
        }
    }
746776
static public function forgotpassword( $userID, $passwordHash, $time )
    {
        $user = eZUser::fetch( $userID );

        if ( $user instanceof eZUser )
        {
            $forgotPasswdObj = eZForgotPassword::createNew( $userID, $passwordHash, $time );
            $forgotPasswdObj->store();
            return array( 'status' => true );
        }
        else
        {
            eZDebug::writeError( "Failed to generate password hash for user $userID (could not fetch user)", __METHOD__ );
            return array( 'status' => false );
        }
    }
795168
public function hashPassword($password, $staticSalt = null)
    {
        $dynamicSalt = UtilityAlgorithms::generateRandomString(22, 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789./');
        return crypt($password, '$2a$' . $this->cost . '$' . $dynamicSalt);
    }
830123
public static function getToken($hash = 'md5')
    {
        return hash(
            $hash,
            (array_key_exists('REMOTE_ADDR', $_SERVER) ? $_SERVER['REMOTE_ADDR'] : null)
            .uniqid(mt_rand())
        );
    }
1276763
public function hashPassword($password)
    {
        if ($this->mode == self::MODE_BCRYPT) {
            return $this->hashModeBcrypt($password);
        } elseif ($this->mode == self::MODE_PBKDF2) {
            return $this->hashModePbkdf2($password);
        }

        $this->error = 'You have to set the mode...';
        $this->cwsDebug->error($this->error);
    }
592854
public function getPasswordRequestData($hash) 
    {
        $table = $this->getServiceLocator()->get('MelisLostPasswordTable');
        $data = $table->getEntryByField('rh_hash', $hash);
        
        if($data) 
            return $data;
    }
189154
protected function getHashedPassword($username)
	{
		$password = $this->db->setQuery(
			$this->db->getQuery(true)
				->select($this->dbOptions['password_column'])
				->from($this->dbOptions['database_table'])
				->where($this->dbOptions['username_column'] . ' = ' . $this->db->quote($username))
		)->loadResult();

		if (!$password)
		{
			return false;
		}

		return $password;
	}
1158950
public function getHashCode() {
		if ($this->_isSupervisor) {
			return $this->getSharedComponent()->getHashCode();
		}
    	return md5(
    		  $this->_locked
    		. $this->_hidden
    		. __CLASS__
    	);
    }
1103639
public function checkPassword($password)
    {
        $valid = static::$dispatcher->until(new CheckingPassword($this, $password));

        if ($valid !== null) {
            return $valid;
        }

        return static::$hasher->check($password, $this->password);
    }
911910
public function getPassword($uuid)
	{
		if($this->entries != null)
		{
			foreach($this->entries as &$entry)
			{
				if($entry->uuid === $uuid)
					return $entry->password;
			}
		}
		if($this->groups != null)
		{
			foreach($this->groups as &$group)
			{
				$value = $group->getPassword($uuid);
				if($value != null)
					return $value;
			}
		}
		return null;
	}
687121
public function getHashCode()
    {
        if ($this->isSupervisor) {
            return $this->getSharedComponent()->getHashCode();
        }
        return md5(
            $this->name .
            $this->size .
            ($this->bold ? 't' : 'f') .
            ($this->italic ? 't' : 'f') .
            ($this->superScript ? 't' : 'f') .
            ($this->subScript ? 't' : 'f') .
            $this->underline .
            ($this->strikethrough ? 't' : 'f') .
            $this->color->getHashCode() .
            __CLASS__
        );
    }
311626
public static function getPasshash($password)
	{
		// Get the password encryption/hashing mechanism
		$config = \Component::params('com_members');
		$type   = $config->get('passhash_mechanism', 'CRYPT_SHA512');

		switch ($type)
		{
			case 'MD5':
				$passhash = "{MD5}" . base64_encode(pack('H*', md5($password)));
				break;

			case 'CRYPT_SHA512':
			default:
				$encrypted = crypt($password, '$6$' . self::genRandomPassword(8) . '$');
				$passhash = "{CRYPT}" . $encrypted;
				break;
		}

		return $passhash;
	}
1262235
public function ntPasswordHash($password = null)
    {
        //if (isset($password)) {
        if (!is_null($password)) {
            return pack('H*',hash('md4', $this->str2unicode($password)));
        } else {
            return pack('H*',hash('md4', $this->str2unicode($this->password)));
        }
    }
288161
public function passwordRehash($password)
    {
        if (password_needs_rehash(
            $password,
            $this->config[ 'password' ][ 'algorithm' ],
            $this->config[ 'password' ][ 'options' ]
        )) {
            return $this->passwordHash($password);
        }

        return $password;
    }
997566
public function getPassword(): ?PasswordBroker
    {
        if (!$this->hasPassword()) {
            $this->setPassword($this->getDefaultPassword());
        }
        return $this->password;
    }
1053047
public function getPasswordHasher()
    {
        if ($this->_passwordHasher === null) {
            $passwordHasher = $this->getConfig('passwordHasher');
            if ($passwordHasher !== null) {
                $passwordHasher = PasswordHasherFactory::build($passwordHasher);
            } else {
                $passwordHasher = $this->_getPasswordHasher();
            }
            $this->_passwordHasher = $passwordHasher;
        }

        return $this->_passwordHasher;
    }
841104
public function checkPassword($password, $storedHash)
    {
        $hash = $this->_crypt($password, $storedHash);

        return ($hash == $storedHash);
    }