Update LDAP mail attribute when re-confirming email

This commit is contained in:
Râu Cao
2023-05-25 16:55:27 +02:00
parent 61f12c2741
commit 7b321577db
3 changed files with 25 additions and 5 deletions

View File

@@ -58,13 +58,19 @@ class User < ApplicationRecord
end
def devise_after_confirmation
enable_service %w[ discourse gitea mediawiki xmpp ]
if ldap_entry[:mail] != self.email
# E-Mail update confirmed
LdapManager::UpdateEmail.call(self.dn, self.email)
else
# E-Mail from signup confirmed (i.e. account activation)
enable_service %w[ discourse gitea mediawiki xmpp ]
#TODO enable in development when we have easy setup of ejabberd etc.
return if Rails.env.development? || !Setting.ejabberd_enabled?
#TODO enable in development when we have easy setup of ejabberd etc.
return if Rails.env.development? || !Setting.ejabberd_enabled?
XmppExchangeContactsJob.perform_later(inviter, self) if inviter.present?
XmppSetDefaultBookmarksJob.perform_later(self)
XmppExchangeContactsJob.perform_later(inviter, self) if inviter.present?
XmppSetDefaultBookmarksJob.perform_later(self)
end
end
def send_devise_notification(notification, *args)