Skip to content

Commit

Permalink
Use component instead of deprecated module
Browse files Browse the repository at this point in the history
  • Loading branch information
eluhr committed Jul 2, 2020
1 parent c4710bf commit e0541ba
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions UsuarioLdapComponent.php
Expand Up @@ -24,7 +24,7 @@
use yii\db\ActiveRecord;

/**
* Class Module
* Class UsuarioLdapComponent
* @package dmstr\usuarioLdapExtension
*
* @property Provider $ldapProvider
Expand Down Expand Up @@ -283,8 +283,7 @@ public function events() {
$user->confirmed_at = time();
if (!$user->save()) {
Yii::error('Could not create default user', __METHOD__);
var_dump($user->getErrors());
die;
Yii::error($user->getErrors(), __METHOD__);
//FIXME handle save error
return;
}
Expand Down Expand Up @@ -416,7 +415,7 @@ public function events() {
// these case typically happens when the sync is enabled and we already have users
if (!empty($user->password)) {
$this->createLdapUser($user);
Event::trigger(Module::class,LdapEvent::EVENT_AFTER_INITAL_PASSWORD_RESET);
Event::trigger(UsuarioLdapComponent::class,LdapEvent::EVENT_AFTER_INITAL_PASSWORD_RESET);
}
return;
}
Expand All @@ -428,7 +427,7 @@ public function events() {
if (!$ldapUser->save()) {
throw new ErrorException("Impossible to modify the LDAP user");
}
Event::trigger(Module::class, LdapEvent::EVENT_AFTER_PASSWORD_RESET);
Event::trigger(UsuarioLdapComponent::class, LdapEvent::EVENT_AFTER_PASSWORD_RESET);
Yii::info('LDAP Password reset completed', __METHOD__);
});
Event::on(AdminController::class, ActiveRecord::EVENT_BEFORE_DELETE, function (UserEvent $event) {
Expand Down

0 comments on commit e0541ba

Please sign in to comment.