diff options
author | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2019-11-25 07:50:30 +0000 |
---|---|---|
committer | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2019-11-25 07:50:30 +0000 |
commit | 907ce8c044159ca8da6ccce3ec5362ac61e7c142 (patch) | |
tree | 4e4b83a3aa041a1826e4ac876b001195fce3f7c2 /Postman/Postman-Auth/PostmanAuthenticationManagerFactory.php | |
parent | a41b9219a66f4018dc581f561fbe3fedd24e73f2 (diff) | |
download | Post-SMTP-907ce8c044159ca8da6ccce3ec5362ac61e7c142.zip |
deleted by mistake
Diffstat (limited to 'Postman/Postman-Auth/PostmanAuthenticationManagerFactory.php')
-rw-r--r-- | Postman/Postman-Auth/PostmanAuthenticationManagerFactory.php | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/Postman/Postman-Auth/PostmanAuthenticationManagerFactory.php b/Postman/Postman-Auth/PostmanAuthenticationManagerFactory.php deleted file mode 100644 index 799b999..0000000 --- a/Postman/Postman-Auth/PostmanAuthenticationManagerFactory.php +++ /dev/null @@ -1,58 +0,0 @@ -<?php -if ( ! defined( 'ABSPATH' ) ) { - exit; // Exit if accessed directly -} -if (! class_exists ( "PostmanAuthenticationManagerFactory" )) { - - require_once 'PostmanGoogleAuthenticationManager.php'; - require_once 'PostmanMicrosoftAuthenticationManager.php'; - require_once 'PostmanNonOAuthAuthenticationManager.php'; - require_once 'PostmanYahooAuthenticationManager.php'; - - // - class PostmanAuthenticationManagerFactory { - private $logger; - - // singleton instance - public static function getInstance() { - static $inst = null; - if ($inst === null) { - $inst = new PostmanAuthenticationManagerFactory (); - } - return $inst; - } - private function __construct() { - $this->logger = new PostmanLogger ( get_class ( $this ) ); - } - public function createAuthenticationManager() { - $transport = PostmanTransportRegistry::getInstance ()->getSelectedTransport (); - return $this->createManager ( $transport ); - } - private function createManager(PostmanZendModuleTransport $transport) { - $options = PostmanOptions::getInstance (); - $authorizationToken = PostmanOAuthToken::getInstance (); - $authenticationType = $options->getAuthenticationType (); - $hostname = $options->getHostname (); - $clientId = $options->getClientId (); - $clientSecret = $options->getClientSecret (); - $senderEmail = $options->getMessageSenderEmail (); - $scribe = $transport->getScribe (); - $redirectUrl = $scribe->getCallbackUrl (); - if ($transport->isOAuthUsed ( $options->getAuthenticationType () )) { - if ($transport->isServiceProviderGoogle ( $hostname )) { - $authenticationManager = new PostmanGoogleAuthenticationManager ( $clientId, $clientSecret, $authorizationToken, $redirectUrl, $senderEmail ); - } else if ($transport->isServiceProviderMicrosoft ( $hostname )) { - $authenticationManager = new PostmanMicrosoftAuthenticationManager ( $clientId, $clientSecret, $authorizationToken, $redirectUrl ); - } else if ($transport->isServiceProviderYahoo ( $hostname )) { - $authenticationManager = new PostmanYahooAuthenticationManager ( $clientId, $clientSecret, $authorizationToken, $redirectUrl ); - } else { - assert ( false ); - } - } else { - $authenticationManager = new PostmanNonOAuthAuthenticationManager (); - } - $this->logger->debug ( 'Created ' . get_class ( $authenticationManager ) ); - return $authenticationManager; - } - } -}
\ No newline at end of file |