Skip to content

Commit

Permalink
Added E-mail testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Schmidt committed Sep 23, 2018
1 parent 10f3a78 commit a899ee8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
4 changes: 3 additions & 1 deletion config.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
$db_password = '';
$db_database = '';

// maak de database-verbinding
$db = mysqli_connect($db_hostname, $db_username, $db_password, $db_database);

// Google Recaptcha Settings
Expand All @@ -27,3 +26,6 @@
$mail_port = "587"; // Do not change (TLS Only)
$mail_from = "[email protected]";
$mail_to = "[email protected]";

// Testing Settings
$testMail = false; // If true, SSLChecker will send mail for every entry in database. (I don't recommend adding more as 2 monitored certificates while testing.)
1 change: 1 addition & 0 deletions cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

$getdata->useMail = $useMail;
$getdata->usePush = $usePush;
$getdata->testMail = $testMail;

$getdata->mail_username = $mail_username;
$getdata->mail_password = $mail_password;
Expand Down
2 changes: 1 addition & 1 deletion footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<p class='text-center text-md-left'>Copyright © 2018 <a href='https://peppercloud.nl'>Robin Schmidt</a>. All rights reserved.</p>
</div>
<div class='col-md-6 text-center text-md-right'>
<p>Version: 0.6.2</p>
<p>Version: 0.6.3</p>
</div>
</div>
</footer>
Expand Down
7 changes: 7 additions & 0 deletions lib/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class getData {
public $mail_to = '';
public $useMail = '';
public $usePush = '';
public $testMail = '';


public function getSSL(){
Expand Down Expand Up @@ -146,6 +147,8 @@ private function calculateSSL($read){

private function sendNotification($dDiff, $auth6){

$trigger = false;

if ($dDiff->days == 30 && $auth6 != "Lets Encrypt Authority X3") {

$trigger = true;
Expand All @@ -165,6 +168,10 @@ private function sendNotification($dDiff, $auth6){

$trigger = true;
$nmessage = "The certificate $this->url from $auth6 is about to expire. You have 1 day left before expiration.";

} elseif ($this->testMail == true) {
$trigger = true;
$nmessage = "$this->url Test mail";
}

if ($this->useMail == true && $trigger == true) {
Expand Down

0 comments on commit a899ee8

Please sign in to comment.