/** * (non-PHPdoc) * * @see PostmanAbstractZendModuleTransport::validateTransportConfiguration() */ protected function validateTransportConfiguration() { $messages = parent::validateTransportConfiguration(); if (empty($messages)) { $this->setReadyForOAuthGrant(); if ($this->isPermissionNeeded()) { /* translators: %1$s is the Client ID label, and %2$s is the Client Secret label */ $message = sprintf(__('You have configured OAuth 2.0 authentication, but have not received permission to use it.', Postman::TEXT_DOMAIN), $this->getScribe()->getClientIdLabel(), $this->getScribe()->getClientSecretLabel()); $message .= sprintf(' <a href="%s">%s</a>.', PostmanUtils::getGrantOAuthPermissionUrl(), $this->getScribe()->getRequestPermissionLinkText()); array_push($messages, $message); $this->setNotConfiguredAndReady(); } } return $messages; }
/** * (non-PHPdoc) * * @see PostmanTransport::getMisconfigurationMessage() */ protected function validateTransportConfiguration() { $messages = parent::validateTransportConfiguration(); if (!$this->isHostConfigured($this->options)) { array_push($messages, __('Outgoing Mail Server Hostname and Port can not be empty.', Postman::TEXT_DOMAIN)); $this->setNotConfiguredAndReady(); } if (!$this->isEnvelopeFromConfigured()) { array_push($messages, __('Envelope-From Email Address can not be empty', Postman::TEXT_DOMAIN) . '.'); $this->setNotConfiguredAndReady(); } if ($this->options->isAuthTypePassword() && !$this->isPasswordAuthenticationConfigured($this->options)) { array_push($messages, __('Username and password can not be empty.', Postman::TEXT_DOMAIN)); $this->setNotConfiguredAndReady(); } if ($this->getAuthenticationType() == PostmanOptions::AUTHENTICATION_TYPE_OAUTH2) { if (!$this->isOAuth2SupportedHostConfigured()) { /* translators: %1$s is the Client ID label, and %2$s is the Client Secret label (e.g. Warning: OAuth 2.0 authentication requires an OAuth 2.0-capable Outgoing Mail Server, Sender Email Address, Client ID, and Client Secret.) */ array_push($messages, sprintf(__('OAuth 2.0 authentication requires a supported OAuth 2.0-capable Outgoing Mail Server.', Postman::TEXT_DOMAIN))); $this->setNotConfiguredAndReady(); } } if (empty($messages)) { $this->setReadyForOAuthGrant(); if ($this->isPermissionNeeded($this->options, $this->getOAuthToken())) { /* translators: %1$s is the Client ID label, and %2$s is the Client Secret label */ $message = sprintf(__('You have configured OAuth 2.0 authentication, but have not received permission to use it.', Postman::TEXT_DOMAIN), $this->getScribe()->getClientIdLabel(), $this->getScribe()->getClientSecretLabel()); $message .= sprintf(' <a href="%s">%s</a>.', PostmanUtils::getGrantOAuthPermissionUrl(), $this->getScribe()->getRequestPermissionLinkText()); array_push($messages, $message); $this->setNotConfiguredAndReady(); } } return $messages; }