function check_email($email, $message)
{
- $res = XDB::query("SELECT state, description
- FROM email_watch
- WHERE state != 'safe' AND email = {?}", $email);
- if ($res->numRows()) {
+ $res = XDB::fetchOneCell('SELECT COUNT(*)
+ FROM email_watch
+ WHERE state != \'safe\' AND email = {?}',
+ $email);
+ if ($res) {
send_warning_mail($message);
return true;
}
}
}
-function send_warning_mail($title)
+function send_warning_mail($title, $body = '')
{
global $globals;
$mailer = new PlMailer();
$mailer->setFrom("webmaster@" . $globals->mail->domain);
$mailer->addTo($globals->core->admin_email);
$mailer->setSubject("[Plat/al Security Alert] $title");
- $mailer->setTxtBody("Identifiants de session :\n" . var_export($_SESSION, true) . "\n\n"
+ $mailer->setTxtBody($body . "Identifiants de session :\n" . var_export($_SESSION, true) . "\n\n"
."Identifiants de connexion :\n" . var_export($_SERVER, true));
$mailer->send();
}