a guest May 22nd, 2017 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     def alterUser(self, username, password="", level=""):
  2.         query = "alterUser query garbage)"
  3.         if level:
  4.             q = "UPDATE remote_users SET level = '%s', time_edit = UNIX_TIMESTAMP() WHERE username='%s'" % (str(level), username)
  5.             self.query(q)
  6.         if password:
  7.             if len(password) != 40:
  8.                 return Exception('password hash is not an sha-1 hash')
  9.             q = "UPDATE remote_users SET password = '%s', time_edit = UNIX_TIMESTAMP() WHERE username='%s'" % (password, username)
  10.         return self.packageResult(query, True, "")
  12. >>> s.alterUser('admin', sha('password').hexdigest(), 'admin', level=101)
  13. Traceback (most recent call last):
  14.   File "<stdin>", line 1, in <module>
  15. TypeError: __call__() got an unexpected keyword argument 'level'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand