~ubuntu-branches/ubuntu/oneiric/moin/oneiric-security

« back to all changes in this revision

Viewing changes to MoinMoin/userprefs/changepass.py

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-03-30 12:55:34 UTC
  • mfrom: (0.1.17 sid)
  • Revision ID: james.westby@ubuntu.com-20100330125534-4c2ufc1rok24447l
Tags: 1.9.2-2ubuntu1
* Merge from Debian testing (LP: #521834). Based on work by Stefan Ebner.
  Remaining changes:
 - Remove python-xml from Suggests field, the package isn't anymore in
   sys.path.
 - Demote fckeditor from Recommends to Suggests; the code was previously
   embedded in moin, but it was also disabled, so there's no reason for us
   to pull this in by default currently. Note: This isn't necessary anymore
   but needs a MIR for fckeditor, so postpone dropping this change until
   lucid+1
* debian/rules:
  - Replace hardcoded python2.5 with python* and hardcore python2.6 for ln
* debian/control.in: drop versioned depends on cdbs

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
    @license: GNU GPL, see COPYING for details.
9
9
"""
10
10
 
11
 
from MoinMoin import user
 
11
from MoinMoin import user, wikiutil
12
12
from MoinMoin.widget import html
13
13
from MoinMoin.userprefs import UserPrefBase
14
14
 
40
40
        if form.has_key('cancel'):
41
41
            return
42
42
 
43
 
        if request.request_method != 'POST':
44
 
            return
45
 
 
46
 
        password = form.get('password1', [''])[0]
47
 
        password2 = form.get('password2', [''])[0]
 
43
        if request.method != 'POST':
 
44
            return
 
45
 
 
46
        if not wikiutil.checkTicket(request, form['ticket']):
 
47
            return
 
48
 
 
49
        password = form.get('password1', '')
 
50
        password2 = form.get('password2', '')
48
51
 
49
52
        # Check if password is given and matches with password repeat
50
53
        if password != password2:
78
81
        self.make_row(_('Password repeat'),
79
82
                      [html.INPUT(type="password", size=36, name="password2")])
80
83
 
 
84
        ticket = wikiutil.createTicket(self.request)
 
85
        form.append(html.INPUT(type="hidden", name="ticket", value="%s" % ticket))
 
86
 
81
87
        # Add buttons
82
88
        self.make_row('', [
83
89
                html.INPUT(type="submit", name='save', value=_("Change password")),