public function createConfig(PostmanTransport $transport) { // retrieve the hostname and port form the transport $hostname = $transport->getHostname(); $port = $transport->getHostPort(); $securityType = $transport->getSecurityType(); $authType = $transport->getAuthenticationType(); $username = $transport->getCredentialsId(); $password = $transport->getCredentialsSecret(); // create the Configuration structure for Zend_Mail $config = array('port' => $port); $this->logger->debug(sprintf('Using %s:%s ', $hostname, $port)); if ($securityType != PostmanOptions::ENCRYPTION_TYPE_NONE) { $config['ssl'] = $securityType; $this->logger->debug('Using encryption ' . $securityType); } else { $this->logger->debug('Using no encryption'); } if ($authType != PostmanOptions::AUTHENTICATION_TYPE_NONE) { $config['auth'] = $authType; $config['username'] = $username; $config['password'] = $password; $this->logger->debug(sprintf('Using auth %s with username %s and password %s ', $authType, $username, PostmanUtils::obfuscatePassword($password))); } else { $this->logger->debug('Using no authentication'); } // return the Configuration structure return $config; }
/** * Get the settings option array and print one of its values */ public function basic_auth_password_callback() { print '<input tabindex="99" id="fake_password" name="fake[password]" style="position:absolute; top:-500px;" type="password" value="Safari Autofill Me">'; printf('<input type="password" id="input_basic_auth_password" name="postman_options[basic_auth_password]" value="%s" size="40" class="required" placeholder="Required"/>', null !== $this->options->getPassword() ? esc_attr(PostmanUtils::obfuscatePassword($this->options->getPassword())) : ''); print ' <input type="button" id="togglePasswordField" value="Show Password" class="button button-secondary" style="visibility:hidden" />'; }
/** */ public function mandrill_api_key_callback() { printf('<input type="password" autocomplete="off" id="mandrill_api_key" name="postman_options[mandrill_api_key]" value="%s" size="60" class="required" placeholder="%s"/>', null !== $this->options->getMandrillApiKey() ? esc_attr(PostmanUtils::obfuscatePassword($this->options->getMandrillApiKey())) : '', __('Required', Postman::TEXT_DOMAIN)); print ' <input type="button" id="toggleMandrillApiKey" value="Show Password" class="button button-secondary" style="visibility:hidden" />'; }
/** * Get the settings option array and print one of its values */ public function basic_auth_password_callback() { printf('<input type="password" autocomplete="off" id="input_basic_auth_password" name="postman_options[basic_auth_password]" value="%s" size="40" class="required"/>', null !== $this->options->getPassword() ? esc_attr(PostmanUtils::obfuscatePassword($this->options->getPassword())) : ''); print ' <input type="button" id="togglePasswordField" value="Show Password" class="button button-secondary" style="visibility:hidden" />'; }