Index: main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py	(revision 8856)
+++ main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py	(revision 8857)
@@ -2125,6 +2125,10 @@
         kofa_utils = getUtility(IKofaUtils)
         pwd = kofa_utils.genPassword()
+
+        ###: To be changed
         IUserAccount(user).setPassword(pwd)
-        # Send email with new redentials
+
+
+        # Send email with new credentials
         msg = _('You have successfully changed your password for the')
         login_url = self.url(grok.getSite(), 'login')
Index: main/waeup.kofa/trunk/src/waeup/kofa/mandates/mandate.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/mandates/mandate.py	(revision 8856)
+++ main/waeup.kofa/trunk/src/waeup/kofa/mandates/mandate.py	(revision 8857)
@@ -50,14 +50,19 @@
         return _('Nothing to do.')
 
-class StudentPasswordMandate(Mandate):
+class PasswordMandate(Mandate):
     """This is a mandate which can set a student password.
     """
 
-    def _setStudentPassword(self):
-        student_id = self.params.get('student_id', None)
+    def _setPassword(self):
+        user_id = self.params.get('user_id', None)
         pwd = self.params.get('password', None)
-        student = grok.getSite()['students'].get(student_id, None)
-        if student and pwd:
-            IUserAccount(student).setPassword(pwd)
+        user_type = self.params.get('user_type', None)
+        user = None
+        if user_type == 'student':
+            user = grok.getSite()['students'].get(user_id, None)
+        elif user_type == 'officer':
+            user = grok.getSite()['users'].get(user_id, None)
+        if user and pwd:
+            IUserAccount(user).setPassword(pwd)
             return True
         return False
@@ -67,5 +72,5 @@
         if self.expires < datetime.utcnow():
             msg = _('Mandate expired.')
-        if self._setStudentPassword():
+        if self._setPassword():
             msg = _('Password has been successfully set. '
                     'Proceed to the login page and enter your credentials.')
Index: main/waeup.kofa/trunk/src/waeup/kofa/mandates/tests.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/mandates/tests.py	(revision 8856)
+++ main/waeup.kofa/trunk/src/waeup/kofa/mandates/tests.py	(revision 8857)
@@ -31,5 +31,5 @@
     IMandatesContainer, IMandate)
 from waeup.kofa.mandates.container import MandatesContainer
-from waeup.kofa.mandates.mandate import StudentPasswordMandate
+from waeup.kofa.mandates.mandate import PasswordMandate
 from waeup.kofa.testing import (FunctionalLayer, FunctionalTestCase)
 
@@ -50,9 +50,9 @@
         self.assertTrue(
             verifyClass(
-                IMandate, StudentPasswordMandate)
+                IMandate, PasswordMandate)
             )
         self.assertTrue(
             verifyObject(
-                IMandate, StudentPasswordMandate())
+                IMandate, PasswordMandate())
             )
         return
@@ -84,21 +84,22 @@
         shutil.rmtree(self.dc_root)
 
-    def test_set_password(self):
+    def test_set_student_password(self):
         student = createObject('waeup.Student')
         self.app['students'].addStudent(student)
         # Add and execute a mandate with missing parameters.
-        mandate = StudentPasswordMandate()
+        mandate = PasswordMandate()
         self.app['mandates'].addMandate(mandate)
         msg = mandate.execute()
         self.assertEqual(msg, u'Wrong mandate parameters.')
         # Add and execute an expired mandate.
-        mandate = StudentPasswordMandate(days=0)
+        mandate = PasswordMandate(days=0)
         self.app['mandates'].addMandate(mandate)
         msg = mandate.execute()
         self.assertEqual(msg, u'Mandate expired.')
         # Add and execute a perfect mandate
-        mandate = StudentPasswordMandate()
-        mandate.params['student_id'] = student.student_id
+        mandate = PasswordMandate()
+        mandate.params['user_id'] = student.student_id
         mandate.params['password'] = 'mypwd1'
+        mandate.params['user_type'] = 'student'
         self.app['mandates'].addMandate(mandate)
         msg = mandate.execute()
@@ -110,10 +111,24 @@
         self.assertEqual(len(self.app['mandates'].keys()), 0)
 
+    def test_set_officer_password(self):
+        self.app['users'].addUser('bob', 'bobssecret')
+        officer = self.app['users']['bob']
+        mandate = PasswordMandate()
+        mandate.params['user_id'] = 'bob'
+        mandate.params['password'] = 'mypwd1'
+        mandate.params['user_type'] = 'officer'
+        self.app['mandates'].addMandate(mandate)
+        msg = mandate.execute()
+        # Password has been set.
+        self.assertEqual(msg, 'Password has been successfully set. Proceed to '
+            'the login page and enter your credentials.')
+        self.assertTrue(IUserAccount(officer).checkPassword('mypwd1'))
+
     def test_remove_expired(self):
         # mandate1 is an old mandate which just expired.
-        mandate1 = StudentPasswordMandate(days=0)
+        mandate1 = PasswordMandate(days=0)
         self.app['mandates'].addMandate(mandate1)
         # mandate2 is a new mandate with default time delta.
-        mandate2 = StudentPasswordMandate(mandate_id='23456')
+        mandate2 = PasswordMandate(mandate_id='23456')
         self.app['mandates'].addMandate(mandate2)
         self.assertEqual(len(self.app['mandates'].keys()), 2)
@@ -126,6 +141,7 @@
         student = createObject('waeup.Student')
         self.app['students'].addStudent(student)
-        mandate = StudentPasswordMandate()
-        mandate.params['student_id'] = student.student_id
+        mandate = PasswordMandate()
+        mandate.params['user_id'] = student.student_id
+        mandate.params['user_type'] = 'student'
         mandate.params['password'] = 'mypwd1'
         self.app['mandates'].addMandate(mandate)
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py	(revision 8856)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py	(revision 8857)
@@ -64,5 +64,5 @@
 from waeup.kofa.hostels.hostel import NOT_OCCUPIED
 from waeup.kofa.utils.helpers import get_current_principal, to_timezone
-from waeup.kofa.mandates.mandate import StudentPasswordMandate
+from waeup.kofa.mandates.mandate import PasswordMandate
 
 grok.context(IKofaObject) # Make IKofaObject the default context
@@ -1987,7 +1987,8 @@
         kofa_utils = getUtility(IKofaUtils)
         password = kofa_utils.genPassword()
-        mandate = StudentPasswordMandate()
+        mandate = PasswordMandate()
         mandate.params['password'] = password
         mandate.params['student_id'] = student.student_id
+        mandate.params['user_type'] = 'student'
         site = grok.getSite()
         site['mandates'].addMandate(mandate)
