Skip to content

Commit

Permalink
services.py: Remove autologin() method. Closes rosedu#65.
Browse files Browse the repository at this point in the history
  • Loading branch information
calin-iorgulescu committed Feb 10, 2015
1 parent fe1071b commit 420ecd2
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions web_services/services.py
Expand Up @@ -674,33 +674,6 @@ def login(req, username, password, remember_me=False, locale=websutil.DEFAULT_LO
'fullname' : user,
'info' : 'Succesfully logged in'})

######### @ServiceMethod
def autologin(req, username):
return json.dumps({})
req.content_type = 'text/html'
# don't permit brute force password guessing:
time.sleep(1)

websutil.sanityCheckUsername(username)

s = Session.Session(req)

if not s.is_new():
#TODO take the username from session
return json.dumps({'status':True, 'username':username,
'info':'Already logged in'})

if not req.connection.remote_ip == '127.0.0.1':
s.invalidate()
return json.dumps({'status':False, 'username':"",
'info':req.connection.remote_ip})

s["username"] = username.lower()
s.save()
return json.dumps({'status':True, 'username':username,
'info':'Success!'})


######### @ServiceMethod
def logout(req):
req.content_type = 'text/html'
Expand Down

0 comments on commit 420ecd2

Please sign in to comment.