Get all password histories sorted by creation time in descending order.
@return boolean|PasswordHistory[] False if password history class is invalid.
184194
public function getPasswordHistories()
    {
        if (empty($this->passwordHistoryClass) || !class_exists($this->passwordHistoryClass)) {
            return false;
        }
        $class = $this->passwordHistoryClass;
        return $class::find()->createdBy($this)->orderByCreatedAt(SORT_DESC)->all();
    }
243922
protected function restoreCredentials() {
		if (!$this->authenticated) {
			if ($this->hasState('auth_consumer') && $this->hasState('auth_token')) {
				$this->auth->getProvider()->consumer = $this->getState('auth_consumer');
				$this->auth->getProvider()->token = $this->getState('auth_token');
				$this->authenticated = true;
			}
			else {
				$this->authenticated = false;
			}
		}

		return $this->authenticated;
	}
1010461
protected function passwordExpired()
    {
        if (($minutes = $this->config('lifetime')) !== 0 && $this->minutesSinceLastActivity() > $minutes) {
            event(new OneTimePasswordExpired($this->getUser()));

            $this->logout();

            return true;
        }

        $this->keepAlive();

        return false;
    }
359852
public function getPasswordHashRules()
    {
        if (!is_string($this->passwordHashAttribute) || empty($this->passwordHashAttribute)) {
            return [];
        }
        if (empty($this->passwordHashRules) || !is_array($this->passwordHashRules)) {
            $this->passwordHashRules = [
                [[$this->passwordHashAttribute], 'string', 'max' => $this->passwordHashAttributeLength],
            ];
        }
        return $this->passwordHashRules;
    }
1146025
public function getPasswordAge()
    {
        $date = \MUtil_Date::ifDate(
                $this->_getVar('user_password_last_changed'),
                array(\Gems_Tracker::DB_DATETIME_FORMAT, \Gems_Tracker::DB_DATE_FORMAT, \Zend_Date::ISO_8601)
                );
        if ($date instanceof \MUtil_Date) {
            return abs($date->diffDays());
        } else {
            return 0;
        }
    }
207347
protected function getMinTimeArchiveProcessed()
    {
        $endDateTimestamp = self::determineIfArchivePermanent($this->params->getDateEnd());
        $isArchiveTemporary = ($endDateTimestamp === false);
        $this->temporaryArchive = $isArchiveTemporary;

        if ($endDateTimestamp) {
            // Permanent archive
            return $endDateTimestamp;
        }

        $dateStart = $this->params->getDateStart();
        $period    = $this->params->getPeriod();
        $segment   = $this->params->getSegment();
        $site      = $this->params->getSite();

        // Temporary archive
        return Rules::getMinTimeProcessedForTemporaryArchive($dateStart, $period, $segment, $site);
    }
981089
public function getAskOld()
    {
        if (null === $this->askOld) {
            // By default only ask for the old password if the user just entered
            // it but is required to change it.
            $this->askOld = (! $this->user->isPasswordResetRequired());
        }

        // Never ask for the old password if it does not exist
        //
        // A password does not always exist, e.g. when using embedded login in Pulse
        // or after creating a new user.
        return $this->askOld && $this->user->hasPassword();
    }
561341
protected function getTimestampedTraitHooks(): array
	{
		return
		[
			'beforeInsert' =>
			[
				function(array $values, $query): array
				{
					$dateTime = new DateTime;

					$createdAtColumn = $this->getCreatedAtColumn();

					$updatedAtColumn = $this->getUpdatedAtColumn();

					$this->columns[$createdAtColumn] = $dateTime;

					$this->columns[$updatedAtColumn] = $dateTime;

					return [$createdAtColumn => $dateTime, $updatedAtColumn => $dateTime] + $values;
				},
			],
			'afterInsert' =>
			[
				function($inserted): void
				{
					if($this->shouldTouchOnInsert() && $inserted && $this->isPersisted)
					{
						$this->touchRelated();
					}
				},
			],
			'beforeUpdate' =>
			[
				function(array $values, $query): array
				{
					$dateTime = new DateTime;

					$updatedAtColumn = $this->getUpdatedAtColumn();

					$this->columns[$updatedAtColumn] = $dateTime;

					return [$updatedAtColumn => $dateTime] + $values;
				},
			],
			'afterUpdate' =>
			[
				function($updated): void
				{
					if($this->shouldTouchOnUpdate() && $updated > 0 && $this->isPersisted)
					{
						$this->touchRelated();
					}
				},
			],
			'afterDelete' =>
			[
				function($deleted): void
				{
					if($this->shouldTouchOnDelete() && $deleted > 0 && $this->isPersisted)
					{
						$this->touchRelated();
					}
				},
			],
		];
	}
1259009
protected function getHistoryHandle()
    {
        $handle = get_called_class();

        // Create entry if it doesn't exist yet
        if (!isset($this->history[$handle])) {
            $this->history[$handle] = [
                'history' => [],
                'output' => [],
            ];
        }

        return $handle;
    }
976102
public function login()
    {
        if ($this->validate()) {
            UserLoginHistory::createAsync(['user_id' => $this->user->getId(), 'ip' => Yii::$app->request->userIP]);
            return Yii::$app->user->login($this->user, $this->rememberMe ? Yii::$app->settings->get('rememberFor', 'user') : 0);
        } else {
            return false;
        }
    }
155135
public function rules()
    {
        return array_merge(
            parent::rules(),
            $this->getPasswordHashRules(),
            $this->getPasswordResetTokenRules(),
            $this->getSourceRules(),
            $this->getStatusRules(),
            $this->getAuthKeyRules(),
            $this->getAccessTokenRules()
        );
    }
703897
public function getPrev()
    {
        end($this->groups);
        while ($key = key($this->groups)) {
            $prevGroup = prev($this->groups);

            if ($this->groups[$key] === $this->group && $prevGroup) {
                return $prevGroup;
            }
        }

        return $this->group;
    }
501438
protected function getPassThruParams()
    {

        if ($this->passThruParams !== null) {
            return $this->passThruParams;
        }

        $this->passThruParams = [];

        $all = Input::all();

        $filtered = array_except($all, ['sync','uploadedFile','folderName']);

        // Security check
        if (count($filtered) > 30) {
            throw new RuntimeException('Too many query params');
        }

        foreach ($filtered as $key=>$value) {
            $this->passThruParams[$key] = strip_tags($value);
        }

        return $this->passThruParams;

    }
868707
public function getPassWordHash()
    {
        if (empty($this->wpPassWordHash)) {
            $this->wpPassWordHash = new PasswordHash(8, true);
        }

        return $this->wpPassWordHash;
    }
1094677
public function getLastLoggedIn()
    {
        $lastTime = LoginAttempt::get()
            ->filter([
                'MemberID' => $this->owner->ID,
                'Status' => 'Success',
            ])
            ->sort('Created', 'DESC')
            ->first();

        if ($lastTime) {
            return $lastTime->dbObject('Created')->format(DBDatetime::ISO_DATETIME);
        }
        return _t(__CLASS__ . '.NEVER', 'Never');
    }
995096
protected function getPasswordAttempts()
    {
        if ($this->_user == NULL)
            return false;

        $this->_attempts = UserMetadata::model()->getPrototype('UserMetadata', array(
                'user_id' => $this->getUser()->id,
                'key' => 'passwordAttempts'
            ), array(
                'user_id' => $this->getUser()->id,
                'key' => 'passwordAttempts',
                'value' => 0
        ));

        return $this->_attempts;
    }
765584
public static function listOrderByKeys()
    {
        $classMethods = get_class_methods(get_class());
        $calledClassMethods = get_class_methods(get_called_class());

        $filteredMethods = array_filter(
            $calledClassMethods, function ($calledClassMethod) use ($classMethods) {
                return !in_array($calledClassMethod, $classMethods, true);
            }
        );

        $list = [];
        foreach ($filteredMethods as $k => $v) {
            $list[$v] = $v;
        }

        return $list;
    }