XDB::execute('INSERT INTO requests (user_id, type, data, stamp) VALUES ({?}, {?}, {?}, {?})',
$this->uid, $this->type, $this, $this->stamp);
+ global $globals;
+ update_NbValid();
return true;
}
public function clean()
{
if ($this->unique) {
- return XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?}',
- $this->uid, $this->type);
+ $success = XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?}',
+ $this->uid, $this->type);
} else {
- return XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?} AND stamp={?}',
- $this->uid, $this->type, $this->stamp);
+ $success = XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?} AND stamp={?}',
+ $this->uid, $this->type, $this->stamp);
}
+ update_NbValid();
+ return $success;
}
// }}}
// envoi d'un mail à hotliners
global $globals;
- $mailer = new PlMailer;
+ $mailer = new PlMailer();
$mailer->setSubject("Commentaires de validation {$this->type}");
$mailer->setFrom("validation+{$this->type}@{$globals->mail->domain}");
- $mailer->addTo($globals->core->admin_emails);
+ $mailer->addTo($globals->core->admin_email);
$body = "Validation {$this->type} pour {$this->prenom} {$this->nom}\n\n"
. S::v('bestalias')." a ajouté le commentaire :\n\n"