35
35
from ivle.webapp.base.plugins import CookiePlugin
36
36
import ivle.database
39
# XXX: Move this elsewhere, as it's just in storage now...
41
# User is not logged in or their account is not enabled.
43
# Only possible if no errors occured thus far
44
if user.state == "no_agreement":
45
# User has authenticated but has not accepted the TOS.
46
# Present them with the TOS page.
47
# First set their username for display at the top, but make sure
48
# the apps tabs are not displayed
50
# IMPORTANT NOTE FOR HACKERS: You can't simply disable this check
51
# if you are not planning to display a TOS page - the TOS
52
# acceptance process actually calls usermgt to create the user
53
# jails and related stuff.
54
present_tos(req, user.fullname)
56
elif user.state == "disabled":
57
# User has authenticated but their account is disabled
58
badlogin = "Your account has been disabled."
59
elif user.state == "pending":
60
# FIXME: this isn't quite the right answer, but it
61
# should be more robust in the short term.
62
session = req.get_session()
65
user.state = u'no_agreement'
67
req.throw_redirect(req.uri)
69
38
def get_user_details(req):
70
39
"""Gets the name of the logged in user, without presenting a login box
71
40
or attempting to authenticate.