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

« back to all changes in this revision

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

  • Committer: Matt Giuca
  • Date: 2010-07-22 00:45:05 UTC
  • mto: This revision was merged to the branch mainline in revision 1818.
  • Revision ID: matt.giuca@gmail.com-20100722004505-ny4h7rytlexyjxby
Project page: Late submissions are now shown in red (the whole line, not just the date), rather than italics.
Required a bit of CSS hackery (see comments in coremedia/ivle.css).

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
 
46
58
        if nexturl is None:
47
59
            nexturl = '/'
48
60
 
101
113
                else:
102
114
                    user = None
103
115
                    try:
 
116
                        # Username is case insensitive
104
117
                        user = authenticate.authenticate(req.config, req.store,
105
 
                                    username.value, password.value)
 
118
                                    username.value.lower(), password.value)
106
119
                    except AuthError, msg:
107
120
                        badlogin = msg
108
121
                    if user is None: