~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/webapp/security/views.py

  • Committer: David Coles
  • Date: 2009-08-13 21:28:32 UTC
  • mto: This revision was merged to the branch mainline in revision 1318.
  • Revision ID: coles.david@gmail.com-20090813212832-o3dq367fwa0d2y75
Set project.deadline to NOT NULL since it is required for submits.

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
    # This needs to be importable from outside Apache.
26
26
    pass
27
27
 
28
 
import ivle.util
29
28
import ivle.pulldown_subj
30
29
import ivle.webapp.security
31
30
from ivle.auth import authenticate, AuthError
62
61
        else:
63
62
            query_string = '?url=' + urllib.quote(nexturl, safe="/~")
64
63
 
65
 
        ctx['path'] = ivle.util.make_path('+login') + query_string
 
64
        ctx['path'] = req.make_path('+login') + query_string
66
65
 
67
66
        # If this succeeds, the user is invalid.
68
67
        user = ivle.webapp.security.get_user_details(req)
73
72
                # if you are not planning to display a ToS page - the ToS
74
73
                # acceptance process actually calls usrmgt to create the user
75
74
                # jails and related stuff.
76
 
                req.throw_redirect(ivle.util.make_path('+tos') + query_string)
 
75
                req.throw_redirect(req.make_path('+tos') + query_string)
77
76
            elif user.state == "pending":
78
77
                # FIXME: this isn't quite the right answer, but it
79
78
                # should be more robust in the short term.
102
101
                else:
103
102
                    user = None
104
103
                    try:
105
 
                        user = authenticate.authenticate(req.store,
 
104
                        user = authenticate.authenticate(req.config, req.store,
106
105
                                    username.value, password.value)
107
106
                    except AuthError, msg:
108
107
                        badlogin = msg
128
127
                                          plugin.cookies[cookie](user), path='/'))
129
128
 
130
129
                        # Add any new enrolments.
131
 
                        ivle.pulldown_subj.enrol_user(req.store, user)
 
130
                        ivle.pulldown_subj.enrol_user(req.config, req.store, user)
132
131
                        req.store.commit()
133
132
 
134
133
                        req.throw_redirect(nexturl)
152
151
        if req.method == "POST":
153
152
            req.logout()
154
153
        else:
155
 
            ctx['path'] =  ivle.util.make_path('+logout')
 
154
            ctx['path'] =  req.make_path('+logout')