- Timestamp:
- 22 Feb 2007, 10:48:52 (18 years ago)
- Location:
- WAeUP_SRP/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
WAeUP_SRP/trunk/WAeUPTool.py
r1462 r1467 96 96 97 97 security.declarePublic('checkPassword') ###( 98 def checkPassword(self, password):98 def checkPassword(self,student_id,password): 99 99 "return a student password" 100 100 student_entry = getattr(self.portal_directories.students,student_id,None) … … 102 102 return False 103 103 return getattr(student_entry,"password","not set") == password 104 ###) 105 106 security.declarePublic('editPassword') ###( 107 def editPassword(self,student_id,password): 108 "edit a student password" 109 student_entry = getattr(self.portal_directories.students,student_id,None) 110 if student_entry is None: 111 return 112 setattr(student_entry,'password',password) 104 113 ###) 105 114 -
WAeUP_SRP/trunk/profiles/default/layouts/student_change_password.xml
r1461 r1467 13 13 <element value="old_password"/> 14 14 </property> 15 <property name="is_required">True</property> 15 16 <property name="label">Old Password</property> 16 17 <property name="label_edit">Old Password</property> … … 18 19 <property name="hidden_layout_modes"/> 19 20 <property name="hidden_readonly_layout_modes"/> 20 <property name="password_widget"> password</property>21 <property name="check_digit"> True</property>21 <property name="password_widget"></property> 22 <property name="check_digit">False</property> 22 23 <property name="size_min">6</property> 23 24 </widget> … … 41 42 <element value="repeat_password"/> 42 43 </property> 44 <property name="is_required">True</property> 43 45 <property name="label">Repeat Password</property> 44 46 <property name="label_edit">Repeat Password</property> -
WAeUP_SRP/trunk/skins/waeup_student/change_password.py
r1461 r1467 7 7 request = context.REQUEST 8 8 import DateTime,logging 9 9 try: 10 from Products.zdb import set_trace 11 except: 12 def set_trace(): 13 pass 14 10 15 current = DateTime.DateTime() 11 16 #pr = context.portal_registration … … 14 19 students_dir = context.portal_directories.students 15 20 lt = context.portal_layouts 21 wt = context.waeup_tool 22 student_id = context.getStudentId() 16 23 res,psm,ds = lt.renderLayout(layout_id= 'student_change_password', 17 24 schema_id= 'student_change_password', … … 34 41 psm = "Please correct your input!" 35 42 return context.change_password_form(rendered = res, 36 psm = None,43 psm = psm, 37 44 ds = ds, 38 45 mode = "edit", … … 41 48 ) 42 49 else: 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" 50 pass 51 old_password = request.get('widget__old_password') 52 if not wt.checkPassword(student_id,old_password): 53 psm = "Old Password is not correct" 49 54 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 ) 55 psm = psm, 56 ds = ds, 57 mode = "edit", 58 formaction = "change_password", 59 button = "Change Password", 60 ) 61 #set_trace() 62 password = request.get('widget__password') 63 wt.editPassword(student_id,password) 64 args = {} 65 args['__ac_name'] = student_id 66 args['__ac_password'] = password 67 from urllib import urlencode 68 url = "%s/logged_in?%s" % (context.absolute_url(),urlencode(args)) 69 return request.RESPONSE.redirect(url)
Note: See TracChangeset for help on using the changeset viewer.