summaryrefslogtreecommitdiff
path: root/Postman/PostmanOptions.php
diff options
context:
space:
mode:
authoryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2018-07-22 09:34:11 +0000
committeryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2018-07-22 09:34:11 +0000
commit18dd31c4715cbf949236e087ceac361a360e09d4 (patch)
tree3f9554701f62ca90d863241c632b780b748c9477 /Postman/PostmanOptions.php
parent1058be7a3e0ea827ed02266b0af9d40e794d041c (diff)
downloadPost-SMTP-18dd31c4715cbf949236e087ceac361a360e09d4.zip
Better support for secure delivery and auth contacts (wp-config)
git-svn-id: https://plugins.svn.wordpress.org/post-smtp/trunk@1912939 b8457f37-d9ea-0310-8a92-e5e31aec5664
Diffstat (limited to 'Postman/PostmanOptions.php')
-rw-r--r--Postman/PostmanOptions.php34
1 files changed, 30 insertions, 4 deletions
diff --git a/Postman/PostmanOptions.php b/Postman/PostmanOptions.php
index 193f8c9..20d3a04 100644
--- a/Postman/PostmanOptions.php
+++ b/Postman/PostmanOptions.php
@@ -260,16 +260,42 @@ if ( ! class_exists( 'PostmanOptions' ) ) {
return $this->options [ PostmanOptions::AUTHENTICATION_TYPE ]; }
}
public function getEncryptionType() {
- if ( isset( $this->options [ PostmanOptions::SECURITY_TYPE ] ) ) {
- return $this->options [ PostmanOptions::SECURITY_TYPE ]; }
+ $port = $this->getPort();
+ switch ($port):
+ case 25:
+ return 'none';
+ break;
+ case 465:
+ return 'ssl';
+ break;
+ case 587:
+ return 'tls';
+ break;
+ case 2525:
+ return 'tls';
+ break;
+ default:
+ return isset( $this->options [ PostmanOptions::SECURITY_TYPE ] ) ? $this->options [ PostmanOptions::SECURITY_TYPE ] : 'none';
+ endswitch;
}
public function getUsername() {
+ if ( defined( POST_SMTP_AUTH_USERNAME ) ) {
+ return POST_SMTP_AUTH_USERNAME;
+ }
+
if ( isset( $this->options [ PostmanOptions::BASIC_AUTH_USERNAME ] ) ) {
- return $this->options [ PostmanOptions::BASIC_AUTH_USERNAME ]; }
+ return $this->options [ PostmanOptions::BASIC_AUTH_USERNAME ];
+ }
}
public function getPassword() {
+
+ if ( defined( POST_SMTP_AUTH_PASSWORD ) ) {
+ return POST_SMTP_AUTH_PASSWORD;
+ }
+
if ( isset( $this->options [ PostmanOptions::BASIC_AUTH_PASSWORD ] ) ) {
- return base64_decode( $this->options [ PostmanOptions::BASIC_AUTH_PASSWORD ] ); }
+ return base64_decode( $this->options [ PostmanOptions::BASIC_AUTH_PASSWORD ] );
+ }
}
public function getMandrillApiKey() {
if ( isset( $this->options [ PostmanOptions::MANDRILL_API_KEY ] ) ) {