source: WAeUP_SRP/trunk/skins/waeup_student/change_password.py @ 1464

Last change on this file since 1464 was 1461, checked in by joachim, 18 years ago

start of change_password not yet working

  • Property svn:keywords set to Id
File size: 2.1 KB
Line 
1##parameters=
2# $Id: change_password.py 1461 2007-02-21 17:45:21Z joachim $
3"""
4process the Application Form
5return html renderer + psm
6"""
7request = context.REQUEST
8import DateTime,logging
9
10current = DateTime.DateTime()
11#pr = context.portal_registration
12logger = logging.getLogger('Student.change_password')
13validate = request.has_key("change_password")
14students_dir = context.portal_directories.students
15lt = context.portal_layouts
16res,psm,ds = lt.renderLayout(layout_id= 'student_change_password',
17                      schema_id= 'student_change_password',
18                      context=context,
19                      mapping=validate and request,
20                      ob = {},
21                      layout_mode='edit',
22                      button = "Change Password",
23                      commit = False,
24                      )
25if psm == '':
26    return context.change_password_form(rendered = res,
27                                 psm = None,
28                                 ds = ds,
29                                 mode = "edit",
30                                 formaction = "change_password",
31                                 button = "Change Password",
32                                 )
33elif psm == 'invalid':
34    psm = "Please correct your input!"
35    return context.change_password_form(rendered = res,
36                                 psm = None,
37                                 ds = ds,
38                                 mode = "edit",
39                                 formaction = "change_password",
40                                 button = "Change Password",
41                                 )
42else:
43    student_id = context.getStudentId()
44    old_password = request.get('widget__old_password')
45    password = request.get('widget__password')
46    entry = students_dir.getEntry
47    context.portal_membership.setPassword(password)
48    psm = "Your Password has been changed"
49    return context.change_password_form(rendered = res,
50                                 psm = None,
51                                 ds = ds,
52                                 mode = "edit",
53                                 formaction = "change_password",
54                                 button = "Change Password",
55                                 )
Note: See TracBrowser for help on using the repository browser.