From 613ef13e809c3f083a76797c7706935d3bbfcb29 Mon Sep 17 00:00:00 2001
From: Malf Furious <m@lfurio.us>
Date: Tue, 6 Jun 2017 12:29:02 -0400
Subject: Revert "Add global function sendEmail()"

This reverts commit 45889e98e7a12b22cbaaceedd5531d4158888530.
This reverts commit 6b643d4bbb469d35c6664176bc1aa641d130d99f.
This reverts commit 7872377be7a0fc97316fc20d28a4bcfec15c6111.

This feature was moved to another file.
---
 app/class/globals.php | 42 ------------------------------------------
 1 file changed, 42 deletions(-)

(limited to 'app')

diff --git a/app/class/globals.php b/app/class/globals.php
index 0d4b0ac..615efa6 100644
--- a/app/class/globals.php
+++ b/app/class/globals.php
@@ -12,10 +12,6 @@
  * For more information, please refer to UNLICENSE
  */
 
-require_once "class/settings.class.php";
-require_once "class/phpmailer.class.php";
-require_once "class/smtp.class.php";
-
 /*
  * This file defines various functions which exist in the global namespace.
  * These are utility functions and constants for the Scrott application.
@@ -148,42 +144,4 @@ function saveFile(array $file, string $path, int $maxsize, ?array $allowedMime =
     return true;
 }
 
-/*
- * Send an email message using database-stored configuration
- * parameters.  If config is not established, delivery is
- * not attempted.  Send status (t/f) is returned.
- */
-function sendEmail(string $subject, user $rcpt, string $mesg,
-    ?string $attachPath = NULL, ?string $attachName = NULL,
-    bool $overrideEmailConf = false) : bool
-{
-    if (settings::smtpServer() == "")
-        return false;
-
-    if (!$overrideEmailConf && !$rcpt->emailConf)
-        return true;
-
-    if ($rcpt->email == "")
-        return true;
-
-    $mail = new PHPMailer();
-    $mail->isSMTP();
-    $mail->SMTPAuth = true;
-    $mail->Host = settings::smtpServer();
-    $mail->Username = settings::smtpUname();
-    $mail->Password = settings::smtpPasswd();
-    $mail->SMTPSecure = settings::smtpSecurity();
-    $mail->Port = settings::smtpPort();
-
-    $mail->setFrom(settings::smtpEmailAddress());
-    $mail->addAddress($rcpt->email, $rcpt->getDisplayName());
-    $mail->Subject = $subject;
-    $mail->Body = $mesg;
-
-    if ($attachPath && $attachName)
-        $mail->addAttachment($attachPath, $attachName);
-
-    return $mail->send();
-}
-
 ?>
-- 
cgit v1.2.3