Bugfix in saveRequest()
This commit is contained in:
parent
baafad49ed
commit
5f62b03a4d
|
@ -35,7 +35,7 @@ class Request extends BaseClass {
|
|||
return false;
|
||||
}
|
||||
|
||||
$this->log->d("Request started for nick: {$_POST['login']}");
|
||||
$this->log->i("Request started for nick: {$_POST['login']}");
|
||||
if (false === $this->checkCaptcha()) {
|
||||
$message = "Captcha invalid";
|
||||
return false;
|
||||
|
@ -65,12 +65,17 @@ class Request extends BaseClass {
|
|||
|
||||
/**
|
||||
* Veranlaßt die Speicherung der Anfrage in der Tabelle requests.
|
||||
* TODO: Exceptions behandeln.
|
||||
* Bekommt aus der Datenbank (auch im Falle einer PDO Exception)
|
||||
* einen Boolean zurück.
|
||||
*/
|
||||
|
||||
$response = $this->db->saveRequest($this->token);
|
||||
if (!$response) {
|
||||
return false;
|
||||
try {
|
||||
$response = $this->db->saveRequest($this->token);
|
||||
} catch (Exception $e) {
|
||||
$this->log->e("Error: Database returns: {$e->getMessage()}");
|
||||
}
|
||||
if ($response === true) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -89,6 +94,7 @@ class Request extends BaseClass {
|
|||
$mailFrom = $this->config->getMailFrom();
|
||||
$mailSubject = $this->config->getMailSubject();
|
||||
$mailClosure = $this->config->getMailClosure();
|
||||
$this->log->d("Try to send verification mail");
|
||||
|
||||
$link = $baseurl . $validator . $this->token . "\r\n\r\n";
|
||||
$mailbody = MAILTEXT1 . $mxdomain . MAILTEXT2 . "\r\n\r\n" . $link . $mailClosure;
|
||||
|
|
Loading…
Reference in a new issue