mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-17 05:41:25 +02:00
New events.
This commit is contained in:
@@ -155,16 +155,16 @@ class User(AbstractBaseUser, PermissionsMixin):
|
||||
"""
|
||||
if parameters.get_admin("AUTHENTICATION_TYPE") == "local":
|
||||
self.password = self._crypt_password(raw_value)
|
||||
return
|
||||
else:
|
||||
if not ldap_available:
|
||||
raise AdminError(_("Failed to update password: LDAP module not installed"))
|
||||
|
||||
if not ldap_available:
|
||||
raise AdminError(_("Failed to update password: LDAP module not installed"))
|
||||
|
||||
ab = LDAPAuthBackend()
|
||||
try:
|
||||
ab.update_user_password(self.username, curvalue, raw_value)
|
||||
except LDAPException, e:
|
||||
raise AdminError(_("Failed to update password: %s" % str(e)))
|
||||
ab = LDAPAuthBackend()
|
||||
try:
|
||||
ab.update_user_password(self.username, curvalue, raw_value)
|
||||
except LDAPException, e:
|
||||
raise AdminError(_("Failed to update password: %s" % str(e)))
|
||||
events.raiseEvent("PasswordUpdated", self, raw_value)
|
||||
|
||||
def check_password(self, raw_value):
|
||||
m = self.password_expr.match(self.password)
|
||||
|
||||
@@ -181,7 +181,8 @@ def identity_actions(user, ident):
|
||||
name = ident.__class__.__name__
|
||||
objid = ident.id
|
||||
if name == "User":
|
||||
actions = [
|
||||
actions = events.raiseQueryEvent("ExtraAccountActions", ident)
|
||||
actions += [
|
||||
{"name" : "delaccount",
|
||||
"url" : reverse("modoboa.admin.views.delaccount") + "?selection=%s" % objid,
|
||||
"img" : "icon-trash",
|
||||
|
||||
@@ -33,6 +33,8 @@ events = [
|
||||
"AccountCreated",
|
||||
"AccountModified",
|
||||
"AccountDeleted",
|
||||
"PasswordUpdated",
|
||||
"ExtraAccountActions",
|
||||
|
||||
"PasswordChange",
|
||||
|
||||
|
||||
Reference in New Issue
Block a user