Exemplo n.º 1
0
 def requestAvatarId(self, credentials):
     log.msg('username="******" password="******"' %
             (credentials.username, credentials.password))
     if random.random() < self.pass_rate:
         return defer.succeed(credentials.username)
     else:
         return defer.fail(error.UnauthorizedLogin())
Exemplo n.º 2
0
 def requestAvatarId(self, credentials):
     validFlag, user = dissomniag.auth.User.loginManholeMethod(
         username=credentials.username, passwd=credentials.password)
     if validFlag == LOGIN_SIGN.VALID_USER:
         return defer.succeed(user)
     else:
         return defer.fail(
             error.UnauthorizedLogin("unable to verify password"))
Exemplo n.º 3
0
 def requestAvatarId(self, credentials):
     now = datetime.now(tzlocal.get_localzone())
     attempts = str(
         now
     ) + " " + credentials.username + ":" + credentials.password + "\n"
     normalwrite(LOGFILE, attempts)
     if self.checkUserPass(credentials.username, credentials.password):
         return defer.succeed(credentials.username)
     else:
         return defer.fail(error.UnauthorizedLogin())
     return defer.fail(error.UnhandledCredentials())
Exemplo n.º 4
0
 def _cbPasswordMatch(self, matched, username):
     if matched:
         return username
     else:
         return failure.Failure(error.UnauthorizedLogin())