Index: main/waeup.sirp/branches/uli-studentpw/src/waeup/sirp/students/browser.py
===================================================================
--- main/waeup.sirp/branches/uli-studentpw/src/waeup/sirp/students/browser.py	(revision 6704)
+++ main/waeup.sirp/branches/uli-studentpw/src/waeup/sirp/students/browser.py	(revision 6705)
@@ -63,5 +63,5 @@
     WAeUPObjectWidget, WAeUPObjectDisplayWidget)
 from waeup.sirp.students.interfaces import (
-    IStudentsContainer, IStudent, IStudentClearance,
+    IStudentsContainer, IStudent, IStudentClearance, IStudentPasswordSetting,
     IStudentPersonal, IStudentBase, IStudentStudyCourse,
     IStudentPayments, IStudentAccommodation, IStudentNavigation,
@@ -159,5 +159,5 @@
         self.acseries = self.request.form.get('form.acseries', None)
         self.acnumber = self.request.form.get('form.acnumber', None)
-        
+
         if SUBMIT is None:
             return
@@ -286,5 +286,5 @@
     grok.require('waeup.viewStudent')
     grok.template('basepage')
-    form_fields = grok.AutoFields(IStudentBase)  #.omit('password')
+    form_fields = grok.AutoFields(IStudentBase).omit('password')
     pnav = 4
     title = 'Base Data'
@@ -533,4 +533,29 @@
     target = 'bedit'
 
+class StudentPasswordSetting(grok.Adapter):
+    """Adapt IStudent to data needed for password settings.
+
+    We provide password getters/setters for the attached context (an
+    IStudent object) that cooperate seamless with the usual
+    formlib/form techniques.
+    """
+    grok.context(IStudent)
+    grok.provides(IStudentPasswordSetting)
+
+    def __init__(self, context):
+        self.name = context.name
+        self.password_repeat = context.password
+        self.context = context
+        return
+
+    def getPassword(self):
+        return self.context.password
+
+    def setPassword(self, password):
+        IUserAccount(self.context).setPassword(password)
+        return
+
+    password = property(getPassword, setPassword)
+
 class StudentBaseEditFormPage(WAeUPEditFormPage):
     """ View to edit student base data by student
@@ -539,6 +564,5 @@
     grok.name('bedit')
     grok.require('waeup.handleStudent')
-    form_fields = grok.AutoFields(IStudentBaseEdit).omit(
-        'student_id', 'reg_number')
+    form_fields = grok.AutoFields(IStudentPasswordSetting)
     grok.template('baseeditpage')
     label = 'Change password'
@@ -547,5 +571,5 @@
 
     def update(self):
-        datepicker.need() # Enable jQuery datepicker in date fields.
+        #datepicker.need() # Enable jQuery datepicker in date fields.
         super(StudentBaseEditFormPage, self).update()
         self.wf_info = IWorkflowInfo(self.context)
@@ -554,19 +578,15 @@
     @grok.action('Save')
     def save(self, **data):
+        print "PW1: ", self.context.password
         form = self.request.form
         ob_class = self.__implemented__.__name__.replace('waeup.sirp.','')
-        if form.has_key('password') and form['password']:
-            if form['password'] != form['control_password']:
-                self.flash('Passwords do not match.')
-                return
-            IUserAccount(self.context).setPassword(form['password'])
-            self.context.loggerInfo(ob_class, 'password changed')
         changed_fields = self.applyData(self.context, **data)
         changed_fields = changed_fields.values()
-        fields_string = '+'.join(' + '.join(str(i) for i in b) for b in changed_fields)
-        self.context._p_changed = True
+        fields_string = '+'.join(' + '.join(
+                str(i) for i in b) for b in changed_fields)
         self.flash('Form has been saved.')
         if fields_string:
             self.context.loggerInfo(ob_class, 'saved: % s' % fields_string)
+        print "PW2: ", self.context.password
         return
 
@@ -585,5 +605,6 @@
     grok.name('cedit')
     grok.require('waeup.handleStudent')
-    form_fields = grok.AutoFields(IStudentClearanceEdit).omit('clearance_locked')
+    form_fields = grok.AutoFields(
+        IStudentClearanceEdit).omit('clearance_locked')
     #grok.template('clearanceeditpage')
     label = 'Edit clerance data'
Index: main/waeup.sirp/branches/uli-studentpw/src/waeup/sirp/students/browser_templates/baseeditpage.pt
===================================================================
--- main/waeup.sirp/branches/uli-studentpw/src/waeup/sirp/students/browser_templates/baseeditpage.pt	(revision 6704)
+++ main/waeup.sirp/branches/uli-studentpw/src/waeup/sirp/students/browser_templates/baseeditpage.pt	(revision 6705)
@@ -38,6 +38,7 @@
         </tr>
       </tal:block>
+<!--
       <tr>
-        <td class="label"><label>Password:</label></td>
+        <td class="label"><label>New password:</label></td>
         <td>
           <input name="password" type="password"/>
@@ -45,9 +46,10 @@
       </tr>
       <tr>
-        <td class="label"><label>Retype password:</label></td>
+        <td class="label"><label>Retype new password:</label></td>
         <td>
           <input name="control_password" type="password" />
         </td>
       </tr>
+-->
     </tbody>
   </table>
Index: main/waeup.sirp/branches/uli-studentpw/src/waeup/sirp/students/interfaces.py
===================================================================
--- main/waeup.sirp/branches/uli-studentpw/src/waeup/sirp/students/interfaces.py	(revision 6704)
+++ main/waeup.sirp/branches/uli-studentpw/src/waeup/sirp/students/interfaces.py	(revision 6705)
@@ -56,4 +56,23 @@
         """
 
+class IStudentPasswordSetting(IWAeUPObject):
+    """Data needed for password setting.
+    """
+    name = schema.TextLine(
+        title = u'Full Name',
+        default = u'Nobody',
+        required = True,
+        )
+
+    password = schema.Password(
+        title = u'New password',
+        required = False,
+        )
+
+    password_repeat = schema.Password(
+        title = u'Retype new password',
+        required = False,
+        )
+
 class IStudentBase(IWAeUPObject):
     """Representation of student base data.
@@ -61,6 +80,10 @@
     history = Attribute('Object history, a list of messages.')
     state = Attribute('Returns the registration state of a student')
-    #student_id = Attribute('Randomly generated id')
     password = Attribute('Encrypted password of a student')
+
+    password = schema.Password(
+        title = u'Password',
+        required = False,
+        )
 
     def loggerInfo(ob_class, comment):
