Check current password

@param $user
@return bool
432481
protected function checkCurrentPassword(LoggedUserPasswordUpdate $request, $user)
    {
        return Hash::check($request->current_password, $user->password);
    }
292076
public function isOwner( $user = NULL )
	{
		$user	= $user ? $user : get_current_user();
		if( !function_exists( 'posix_getpwuid' ) )
			return TRUE;
		$uid	= fileowner( $this->fileName );
		if( !$uid )
			return TRUE;
		$owner	= posix_getpwuid( $uid );
		if( !$owner )
			return TRUE;
		print_m( $owner );
		return $user == $owner['name'];
	}
870678
public function _getPasswordFromDB($user)
    {
        $sql  = 'SELECT * FROM users WHERE code = :uname AND state >=1';
        $stmt = $this->db->prepare($sql);
        $stmt->execute(array(':uname' => $token->getUserName()));
        $row = $stmt->fetch(PDO::FETCH_ASSOC);
        return $row['password'];

    }
541110
private function isSecureExpired(User $user)
    {
        // never expired
        if (!$this->expirationPeriod) {
            return false;
        }

        if (!$lastLogin = $user->getLineLastLogin()) {
            return true;
        }

        return (new \DateTime('-'.$this->expirationPeriod)) > $lastLogin;
    }
955410
public static function compare($known, $user)
    {
        if (strlen($known) !== strlen($user)) {
            return false;
        }
        $result      = 0;
        $knownLength = strlen($known);
        for ($i = 0; $i < $knownLength; $i++) {
            $result |= ord($known[$i]) ^ ord($user[$i]);
        }

        return $result == 0;
    }
598602
public function validatePassword($password)
    {
        $model = static::findIdentity($this->username, $password);

        return (bool) $model->id;
    }
629119
public function isAuthorized($user)
    {
        $this->Authorizer->action(['*'], function ($auth, $user) {
            $auth->allowRole([1]);
        });

        return $this->Authorizer->authorize();
    }
700629
public function access($user)
    {
        $user = User::findOrFail($user->id);

        return $user->hasPermission('laralum::users.access') || $user->superAdmin();
    }
1133015
public function actionValidatePassword($user, $password)
    {
        $user = $this->getUser($user);
        $result = $user->validatePassword($password);
        if ($result) {
            echo "Correct.\n";
        } else {
            echo "Incorrect.\n";
        }
        return static::EXIT_CODE_NORMAL;
    }
97008
public static function isSuperUser($user = ''){
		$superUser = self::getSuperUserConfig();
		if(!$user){
			$user = self::getCurrentUsername();
		}
		if($user && in_array($user,$superUser)){
			return true;
		}
		return false;
	}
771261
public function login(User $user, $password)
    {
        if ($user->isPasswordValid($password)) {
            $token = new UsernamePasswordToken($user, null, 'main', $user->getRoles());
            $this->tokenStorage->setToken($token);
            $user->setLastLogin(new \DateTime());
            $this->save($user);

            return true;
        }

        return false;
    }
531420
public static function isUsed($password, $user = null)
    {
        if (!User::isValid($user)) {
            throw new InvalidParamException('User Invalid.');
        }
        $passwords = static::find()->createdBy($user)->all();
        foreach ($passwords as $p) {
            /* @var $p static */
            if ($p->validatePassword($password)) {
                return $p;
            }
        }
        return false;
    }
827923
public function actionPassword($user, $password)
    {
        $user = $this->getUser($user);
        $user->applyForNewPassword();
        $result = $user->resetPassword($password, $user->getPasswordResetToken());
        if ($result) {
            echo "Password changed.\n";
        } else {
            echo "Password not changed.\n";
        }
        return static::EXIT_CODE_NORMAL;
    }
1185618
protected function login($user, $password)
    {
        list($code, $response) = $this->execute('LOGIN', array(
            $this->escape($user), $this->escape($password)), self::COMMAND_CAPABILITY | self::COMMAND_ANONYMIZED);

        // re-set capabilities list if untagged CAPABILITY response provided
        if (preg_match('/\* CAPABILITY (.+)/i', $response, $matches)) {
            $this->parseCapability($matches[1], true);
        }

        if ($code == self::ERROR_OK) {
            return $this->fp;
        }

        return $code;
    }
1244385
public function login($user, $password)
    {
        /* @var $session \Mage_Customer_Model_Session */
        $session = Mage::getSingleton('customer/session');
        return $session->login($user, $password);
    }
202372
protected function _getCurrentUser($user = null)
    {
        $this->_setCurrentUser($user);

        if (!$this->_currentUserInstance &&
            isset($this->_currentUserViewVar) &&
            !empty($this->viewVars[$this->_currentUserViewVar])
        ) {
            $this->_currentUserInstance = $this->viewVars[$this->_currentUserViewVar];
        }

        return $this->_currentUserInstance;
    }
66836
private function encodePassword(User $user)
    {
        $password = $this->encoderFactory
            ->getEncoder($user)
            ->encodePassword($user->getPlainPassword(), $user->getSalt());

        $user->setPassword($password);

        return $password;
    }