Esempio n. 1
0
 def GET(self):
     if session.uid:
         anUser = MongoElements(databaseTable)
         anUser.alreadyLoggedIn(session.uid)
         currentUser = anUser.getMe()
         print "welcome.anuser %s " %  currentUser
         form = my_form()
         return render.tutorial(form, currentUser['userEmail'], currentUser['tasks'])
     else:
         return "use login screen to log in"
Esempio n. 2
0
 def POST(self):
     loginCredentials = web.input()     # print "user is %s %s" % ( log.user, log.password )
     ongoingLogin = MongoElements(databaseTable)
     anUser = ongoingLogin.login(loginCredentials.user, loginCredentials.password)
     session.uid = anUser
     session.test = 'not test'
     print "session user %s " % session.uid
     if anUser:
         raise web.seeother('/welcome')  #user.login(loginCredentials.user, loginCredentials.password)
     else:
         return "Invalid credentials, please login to continue" #render.index(login)
Esempio n. 3
0
 def POST(self):
     form = my_form()
     form.validates()
     s = form['textfield'].value
     print "text was %s" % (s)
     if session.uid:
         anUser = MongoElements(databaseTable)
         anUser.alreadyLoggedIn(session.uid)
         if str(s):
             anUser.addTask(s)
         else:
             print "ceva e in neregula [" +s + "]"
         currentUser = anUser.getMe()
         return render.tutorial(form, currentUser['userEmail'], currentUser['tasks'])
     else:
         return "use login to log in"