Advertisement
Guest User

Untitled

a guest
Feb 24th, 2014
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. @webnotes.whitelist()
  2. def get_login(username,password):
  3. webbrowser.open('http://192.168.5.102:2525/server.py?cmd=login&usr=administrator&pwd=admin')
  4. qr="select password from __Auth where user="+username+" and password=password("+password+")"
  5. res=webnotes.conn.sql(qr)
  6. from webnotes.model.doc import Document
  7. import random
  8. import string
  9. char_set = string.ascii_uppercase + string.digits
  10. if res :
  11. d = Document('auth keys')
  12. d.user_name=username
  13. d.password=password
  14. d.auth_key=''.join(random.sample(char_set*6,9))
  15. d.save(new=1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement