コード例 #1
0
 /**
  * Returns the login attempts for the given username.
  *
  * Returns NULL in case there are no current failed login attempts for the given user.
  *
  * @param string $username Username to return the login attempts for
  * @return \Ableron\Plugins\BruteForceProtector\Model\Entities\LoginAttemptsEntity|null
  */
 public static function getLoginAttemptsByUsername($username)
 {
     return Application::getPersistenceManager()->getRepository('LoginAttemptsEntity', BruteForceProtectorPlugin::getNamespace())->findOneBy(array('username' => $username));
 }
コード例 #2
0
 public function testGetNamespace()
 {
     $this->assertSame('Core', CoreModule::getNamespace());
     $this->assertSame('BruteForceProtector', BruteForceProtectorPlugin::getNamespace());
 }