public static function changePasshash($user = null, $passhash)
	{
		// Get config values for min, max, and warning
		$config        = \Component::params('com_members');
		$shadowMin     = $config->get('shadowMin', '0');
		$shadowMax     = $config->get('shadowMax', null);
		$shadowWarning = $config->get('shadowWarning', '7');

		// Translate empty shadowMax to mean NULL
		$shadowMax = ($shadowMax == '') ? null : $shadowMax;

		$hzup = self::getInstance($user);

		// Make sure we found a record
		if (!$hzup)
		{
			return false;
		}

		$oldhash = $hzup->__get('passhash');

		$hzup->__set('passhash', $passhash);
		$hzup->__set('shadowFlag', null);
		$hzup->__set('shadowLastChange', intval(time() / 86400));
		$hzup->__set('shadowMin', $shadowMin);
		$hzup->__set('shadowMax', $shadowMax);
		$hzup->__set('shadowWarning', $shadowWarning);
		$hzup->__set('shadowInactive', '0');
		$hzup->__set('shadowExpire', null);
		$hzup->update();

		$db = \App::get('db');

		$db->setQuery("UPDATE `#__xprofiles` SET userPassword=" . $db->quote($passhash) . " WHERE uidNumber=" . $db->quote($hzup->get('user_id')));
		$db->query();

		$db->setQuery("UPDATE `#__users` SET password=" . $db->quote($passhash) . " WHERE id=" . $db->quote($hzup->get('user_id')));
		$db->query();

		if (!empty($oldhash))
		{
			History::addPassword($oldhash, $user);
		}

		return true;
	}
public static function changePasshash($user = null, $passhash)
	{
		// Get config values for min, max, and warning
		$config        = \Component::params('com_members');
		$shadowMin     = $config->get('shadowMin', '0');
		$shadowMax     = $config->get('shadowMax', null);
		$shadowWarning = $config->get('shadowWarning', '7');

		// Translate empty shadowMax to mean NULL
		$shadowMax = ($shadowMax == '') ? null : $shadowMax;

		$hzup = self::getInstance($user);

		// Make sure we found a record
		if (!$hzup)
		{
			return false;
		}

		$oldhash = $hzup->__get('passhash');

		$hzup->__set('passhash', $passhash);
		$hzup->__set('shadowFlag', null);
		$hzup->__set('shadowLastChange', intval(time() / 86400));
		$hzup->__set('shadowMin', $shadowMin);
		$hzup->__set('shadowMax', $shadowMax);
		$hzup->__set('shadowWarning', $shadowWarning);
		$hzup->__set('shadowInactive', '0');
		$hzup->__set('shadowExpire', null);
		$hzup->update();

		$db = \App::get('db');

		$db->setQuery("UPDATE `#__xprofiles` SET userPassword=" . $db->quote($passhash) . " WHERE uidNumber=" . $db->quote($hzup->get('user_id')));
		$db->query();

		$db->setQuery("UPDATE `#__users` SET password=" . $db->quote($passhash) . " WHERE id=" . $db->quote($hzup->get('user_id')));
		$db->query();

		if (!empty($oldhash))
		{
			History::addPassword($oldhash, $user);
		}

		return true;
	}
public static function changePasshash ( $ user = null , $ passhash ) { // Get config values for min, max, and warning $ config = \ Component :: params ( 'com_members' ) ; $ shadowMin = $ config -> get ( 'shadowMin' , '0' ) ; $ shadowMax = $ config -> get ( 'shadowMax' , null ) ; $ shadowWarning = $ config -> get ( 'shadowWarning' , '7' ) ; // Translate empty shadowMax to mean NULL $ shadowMax = ( $ shadowMax == '' ) ? null : $ shadowMax ; $ hzup = self :: getInstance ( $ user ) ; // Make sure we found a record if ( ! $ hzup ) { return false ; } $ oldhash = $ hzup -> __get ( 'passhash' ) ; $ hzup -> __set ( 'passhash' , $ passhash ) ; $ hzup -> __set ( 'shadowFlag' , null ) ; $ hzup -> __set ( 'shadowLastChange' , intval ( time ( ) / 86400 ) ) ; $ hzup -> __set ( 'shadowMin' , $ shadowMin ) ; $ hzup -> __set ( 'shadowMax' , $ shadowMax ) ; $ hzup -> __set ( 'shadowWarning' , $ shadowWarning ) ; $ hzup -> __set ( 'shadowInactive' , '0' ) ; $ hzup -> __set ( 'shadowExpire' , null ) ; $ hzup -> update ( ) ; $ db = \ App :: get ( 'db' ) ; $ db -> setQuery ( "UPDATE `#__xprofiles` SET userPassword=" . $ db -> quote ( $ passhash ) . " WHERE uidNumber=" . $ db -> quote ( $ hzup -> get ( 'user_id' ) ) ) ; $ db -> query ( ) ; $ db -> setQuery ( "UPDATE `#__users` SET password=" . $ db -> quote ( $ passhash ) . " WHERE id=" . $ db -> quote ( $ hzup -> get ( 'user_id' ) ) ) ; $ db -> query ( ) ; if ( ! empty ( $ oldhash ) ) { History :: addPassword ( $ oldhash , $ user ) ; } return true ; }
Change a user's pass hash

@param   mixed   $user
@param   string  $password
@return  bool
Change a user s pass hash