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

« back to all changes in this revision

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

  • Committer: William Grant
  • Date: 2009-06-29 01:55:55 UTC
  • mto: This revision was merged to the branch mainline in revision 1322.
  • Revision ID: grantw@unimelb.edu.au-20090629015555-49xxv0piiieunx8e
Add docs on configuring Apache.

Show diffs side-by-side

added added

removed removed

Lines of Context:
43
43
        fields = req.get_fieldstorage()
44
44
        nexturl = fields.getfirst('url')
45
45
 
46
 
        # XXX Warning that Internet Explorer is unsupported
47
 
        # Test if the user is in Internet Explorer
48
 
        try:
49
 
            useragent = req.headers_in['User-Agent']
50
 
            # A bit of very basic UA string detection
51
 
            ctx['msie'] = ('MSIE' in useragent
52
 
                           and 'AppleWebKit' not in useragent
53
 
                           and 'Gecko' not in useragent
54
 
                           and 'Opera' not in useragent)
55
 
        except KeyError:
56
 
            ctx['msie'] = False
57
 
 
58
46
        if nexturl is None:
59
47
            nexturl = '/'
60
48
 
113
101
                else:
114
102
                    user = None
115
103
                    try:
116
 
                        # Username is case insensitive
117
 
                        user = authenticate.authenticate(req.config, req.store,
118
 
                                    username.value.lower(), password.value)
 
104
                        user = authenticate.authenticate(req.store,
 
105
                                    username.value, password.value)
119
106
                    except AuthError, msg:
120
107
                        badlogin = msg
121
108
                    if user is None:
140
127
                                          plugin.cookies[cookie](user), path='/'))
141
128
 
142
129
                        # Add any new enrolments.
143
 
                        ivle.pulldown_subj.enrol_user(req.config, req.store, user)
 
130
                        ivle.pulldown_subj.enrol_user(req.store, user)
144
131
                        req.store.commit()
145
132
 
146
133
                        req.throw_redirect(nexturl)