From 009ff4a5b6c62239744102717136560b750e95c0 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Wed, 15 Feb 2017 04:25:09 -0500 Subject: Add settings class --- app/class/settings.class.php | 94 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 app/class/settings.class.php (limited to 'app/class/settings.class.php') diff --git a/app/class/settings.class.php b/app/class/settings.class.php new file mode 100644 index 0000000..5609605 --- /dev/null +++ b/app/class/settings.class.php @@ -0,0 +1,94 @@ + -- cgit v1.2.3 From dce33112a2e2a73acd08ee0dc80ca567f34c7065 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Mon, 29 May 2017 00:59:09 -0400 Subject: Add SMTP configuration variables --- app/class/settings.class.php | 50 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'app/class/settings.class.php') diff --git a/app/class/settings.class.php b/app/class/settings.class.php index 5609605..abafd0a 100644 --- a/app/class/settings.class.php +++ b/app/class/settings.class.php @@ -89,6 +89,56 @@ abstract class settings { return self::option("allowPublicSignup", false, $value); } + + /* + * SMTP email address + */ + public static function smtpEmailAddress(?string $value = NULL) : string + { + return self::option("smtpEmailAddress", "", $value); + } + + /* + * SMTP server address + */ + public static function smtpServer(?string $value = NULL) : string + { + return self::option("smtpServer", "", $value); + } + + /* + * SMTP port number + */ + public static function smtpPort(?int $value = NULL) : int + { + return self::option("smtpPort", 0, $value); + } + + /* + * SMTP security + * Should be '', 'ssl', or 'tls'. See the 'SMTPSecure' property + * from PHP Mailer module. + */ + public static function smtpSecurity(?string $value = NULL) : string + { + return self::option("smtpSecurity", "", $value); + } + + /* + * SMTP username + */ + public static function smtpUname(?string $value = NULL) : string + { + return self::option("smtpUname", "", $value); + } + + /* + * SMTP password + */ + public static function smtpPasswd(?string $value = NULL) : string + { + return self::option("smtpPasswd", "", $value); + } } ?> -- cgit v1.2.3 From 8d382d0d86da37c9019de1717a75dc6e003f6388 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Mon, 29 May 2017 01:08:41 -0400 Subject: Change default SMTP port to 25 --- app/class/settings.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/class/settings.class.php') diff --git a/app/class/settings.class.php b/app/class/settings.class.php index abafd0a..5b7cdeb 100644 --- a/app/class/settings.class.php +++ b/app/class/settings.class.php @@ -111,7 +111,7 @@ abstract class settings */ public static function smtpPort(?int $value = NULL) : int { - return self::option("smtpPort", 0, $value); + return self::option("smtpPort", 25, $value); } /* -- cgit v1.2.3 From ae71ff561fb0e469b00dbe0942144f8a0b771246 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Mon, 19 Jun 2017 23:35:30 -0400 Subject: Add setting parameter 'smtpFrom' This is the name to give on FROM headers to generated email messages. --- app/class/settings.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/class/settings.class.php') diff --git a/app/class/settings.class.php b/app/class/settings.class.php index 5b7cdeb..19fba6a 100644 --- a/app/class/settings.class.php +++ b/app/class/settings.class.php @@ -98,6 +98,14 @@ abstract class settings return self::option("smtpEmailAddress", "", $value); } + /* + * SMTP FROM name + */ + public static function smtpFrom(?string $value = NULL) : string + { + return self::option("smtpFrom", "", $value); + } + /* * SMTP server address */ -- cgit v1.2.3 From 652a62ede6849d04302153d8a3a7fad492b18c5b Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Fri, 21 Sep 2018 22:49:15 -0400 Subject: settings: Add key 'smtpResult' This is not meant to be a user (admin) configurable key. Rather, this is a mechanism for success/failure results from interactions with PHPMailer to make their way back to the UI. Down the road, email sending functions should publish their true/false return value to this configuration key. The initial default value of "NULL" means no mail send attempts have taken place. --- app/class/settings.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'app/class/settings.class.php') diff --git a/app/class/settings.class.php b/app/class/settings.class.php index 19fba6a..d936a62 100644 --- a/app/class/settings.class.php +++ b/app/class/settings.class.php @@ -147,6 +147,14 @@ abstract class settings { return self::option("smtpPasswd", "", $value); } + + /* + * SMTP result of last attempted send - 'true', 'false', 'NULL' + */ + public static function smtpResult(?string $value = NULL) : string + { + return self::option("smtpResult", "NULL", $value); + } } ?> -- cgit v1.2.3