'tlang' => 'en_US',
'tcomment' => _T('Informs admin a member edit his information')
),
+
+ array(
+ 'tref' => 'pwddisabled',
+ 'tsubject' => _T('[{ASSO_NAME}] Account {NAME_ADH} is inactive'),
+ 'tbody' => _T("Hello!{NEWLINE}A password recovery request has been made on your account on {ASSO_NAME}, but it is currently inactive and therefore cannot be processed.{NEWLINE}Please contact an administrator or a staff member if you think this is a mistake.{NEWLINE}See you soon!{NEWLINE}(this email was sent automatically)"),
+ 'tlang' => 'en_US',
+ 'tcomment' => _T('Lost password email (disabled)')
+ ),
);
if ($adh->id != '') {
//account has been found, proceed
if (GaletteMail::isValidEmail($adh->email)) {
- $password = new Password($this->zdb);
- $res = $password->generateNewPassword($adh->id);
- if ($res == true) {
+ $tparams = [
+ 'login_adh' => custom_html_entity_decode(
+ $adh->login,
+ ENT_QUOTES
+ )
+ ];
+
+ //check if account is active
+ if (!$adh->isActive()) { //https://bugs.galette.eu/issues/1529
+ $res = true;
+ $text_id = 'pwddisabled';
+ } else {
+ $password = new Password($this->zdb);
+ $res = $password->generateNewPassword($adh->id);
+ $text_id = 'pwd';
$link_validity = new \DateTime();
$link_validity->add(new \DateInterval('PT24H'));
+ $tparams += [
+ 'change_pass_uri' => $this->preferences->getURL() .
+ $this->router->pathFor(
+ 'password-recovery',
+ ['hash' => base64_encode($password->getHash())]
+ ),
+ 'link_validity' => $link_validity->format(_T("Y-m-d H:i:s")),
+ ];
+ }
+ if ($res === true) {
$texts = new Texts(
$this->preferences,
$this->router,
- array(
- 'change_pass_uri' => $this->preferences->getURL() .
- $this->router->pathFor(
- 'password-recovery',
- ['hash' => base64_encode($password->getHash())]
- ),
- 'link_validity' => $link_validity->format(_T("Y-m-d H:i:s")),
- 'login_adh' => custom_html_entity_decode($adh->login, ENT_QUOTES)
- )
+ $tparams
);
$texts->getTexts($text_id, $adh->language);
*/
public function testGetList()
{
+ $count_texts = 13;
$texts = new \Galette\Entity\Texts(
$this->preferences
);
$texts->installInit();
$list = $texts->getRefs(\Galette\Core\I18n::DEFAULT_LANG);
- $this->array($list)->hasSize(12);
+ $this->array($list)->hasSize($count_texts);
foreach (array_keys($this->i18n->getArrayList()) as $lang) {
$list = $texts->getRefs($lang);
- $this->array($list)->hasSize(12);
+ $this->array($list)->hasSize($count_texts);
}
if ($this->zdb->isPostgres()) {
$results = $this->zdb->execute($select);
$result = $results->current();
$this->integer($result->last_value)
- ->isGreaterThanOrEqualTo(12, 'Incorrect texts sequence ' . $result->last_value);
+ ->isGreaterThanOrEqualTo($count_texts, 'Incorrect texts sequence ' . $result->last_value);
$this->zdb->db->query(
'SELECT setval(\'' . PREFIX_DB . $texts::TABLE . '_id_seq\', 1)',
$texts->installInit(false);
$list = $texts->getRefs(\Galette\Core\I18n::DEFAULT_LANG);
- $this->array($list)->hasSize(12);
+ $this->array($list)->hasSize($count_texts);
if ($this->zdb->isPostgres()) {
$select = $this->zdb->select($texts::TABLE . '_id_seq');