Plugin: Whispeak delete wsid when requesting restore password - refs BT#15813

pull/3377/head
Angel Fernando Quiroz Campos 6 years ago
parent bfba4aca11
commit 6fbf41c2a4
  1. 4
      main/auth/lostPassword.php
  2. 22
      plugin/whispeakauth/WhispeakAuthPlugin.php
  3. 8
      plugin/whispeakauth/ajax/record_audio.php

@ -118,6 +118,10 @@ if ($form->validate()) {
exit;
}
if ('true' === api_get_plugin_setting('whispeakauth', WhispeakAuthPlugin::SETTING_ENABLE)) {
WhispeakAuthPlugin::deleteEnrollment($user['uid']);
}
$passwordEncryption = api_get_configuration_value('password_encryption');
if ($passwordEncryption === 'none') {

@ -599,4 +599,26 @@ class WhispeakAuthPlugin extends Plugin implements HookPluginInterface
HookConditionalLogin::create()->detach($observer);
}
/**
* @param int $userId
*
* @throws \Doctrine\ORM\OptimisticLockException
*
* @return bool
*/
public static function deleteEnrollment($userId)
{
$extraFieldValue = self::getAuthUidValue($userId);
if (empty($extraFieldValue)) {
return false;
}
$em = Database::getManager();
$em->remove($extraFieldValue);
$em->flush();
return true;
}
}

@ -172,6 +172,14 @@ if ($isAuthentify) {
} else {
$message .= PHP_EOL.$plugin->get_lang('TryAgain');
}
if ('true' === api_get_setting('allow_lostpassword')) {
$message .= '<br>'
.Display::url(
get_lang('LostPassword'),
api_get_path(WEB_CODE_PATH).'auth/lostPassword.php'
);
}
}
foreach ($qualityNote as $note) {

Loading…
Cancel
Save