#NEWLINE# def set_password( self , raw_value , curvalue = None ) : #NEWLINE# #INDENT# "Password update\n\n        Update the current mailbox's password with the given clear\n        value. This value is encrypted according to the defined method\n        before it is saved.\n\n        :param raw_value: the new password's value\n        :param curvalue: the current password (for LDAP authentication)\n        " #NEWLINE# if self . is_local : #NEWLINE# #INDENT# self . password = self . _crypt_password ( raw_value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not ldap_available ) : #NEWLINE# #INDENT# raise InternalError ( _ ( 'Failed to update password: LDAP module not installed' ) ) #NEWLINE# #UNINDENT# LDAPAuthBackend ( ) . update_user_password ( curvalue . username , curvalue , raw_value ) #NEWLINE# #UNINDENT# events . raiseEvent ( 'PasswordUpdated' , self , raw_value , ( self . pk is None ) )