summaryrefslogtreecommitdiff
path: root/Postman
diff options
context:
space:
mode:
authoryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2018-04-17 05:33:53 +0000
committeryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2018-04-17 05:33:53 +0000
commita09ee0623a67f6e8596929cb008e6c91e31a713f (patch)
tree355ab4b11a9f637e441bc17a59c35be497c0613a /Postman
parent62b95f35576ea9b9178b900f9480fed0466211a2 (diff)
downloadPost-SMTP-a09ee0623a67f6e8596929cb008e6c91e31a713f.zip
* Gmail attahments
* Server name loginc (phpmailer) * Slack notification field bug
Diffstat (limited to 'Postman')
-rw-r--r--Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php2
-rw-r--r--Postman/Postman-Configuration/postman_wizard.js14
-rw-r--r--Postman/Postman-Mail/PostmanGmailApiModuleZendMailTransport.php6
-rw-r--r--Postman/PostmanUtils.php30
4 files changed, 22 insertions, 30 deletions
diff --git a/Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php b/Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php
index 1daedf2..ecd7ec3 100644
--- a/Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php
+++ b/Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php
@@ -424,7 +424,7 @@ class PostmanSettingsRegistry {
}
public function slack_token_callback() {
- printf( '<input type="password" id="slack_token" name="%s[%s]" value="%s" />', PostmanOptions::POSTMAN_OPTIONS, PostmanOptions::SLACK_TOKEN, $this->options->getPushoverToken() );
+ printf( '<input type="password" id="slack_token" name="%s[%s]" value="%s" />', PostmanOptions::POSTMAN_OPTIONS, PostmanOptions::SLACK_TOKEN, $this->options->getSlackToken() );
echo '<a target="_blank" href="https://slack.postmansmtp.com/">' . __( 'Get your webhook URL here', Postman::TEXT_DOMAIN ) . '</a>';
}
diff --git a/Postman/Postman-Configuration/postman_wizard.js b/Postman/Postman-Configuration/postman_wizard.js
index 8e1a68c..c29edb4 100644
--- a/Postman/Postman-Configuration/postman_wizard.js
+++ b/Postman/Postman-Configuration/postman_wizard.js
@@ -494,21 +494,21 @@ function handleConfigurationResponse(response) {
}
jQuery('select#input_notification_service').change(function() {
- var selected = $( this ).val();
+ var selected = jQuery( this ).val();
if ( selected == 'default' ) {
- $('#slack_cred').fadeOut('fast');
- $('#pushover_cred').fadeOut('fast');
+ jQuery('#slack_cred').fadeOut('fast');
+ jQuery('#pushover_cred').fadeOut('fast');
}
if ( selected == 'pushover' ) {
- $('#slack_cred').fadeOut('fast');
- $('#pushover_cred').fadeIn();
+ jQuery('#slack_cred').fadeOut('fast');
+ jQuery('#pushover_cred').fadeIn();
}
if ( selected == 'slack' ) {
- $('#pushover_cred').fadeOut('fast');
- $('#slack_cred').fadeIn();
+ jQuery('#pushover_cred').fadeOut('fast');
+ jQuery('#slack_cred').fadeIn();
}
});
diff --git a/Postman/Postman-Mail/PostmanGmailApiModuleZendMailTransport.php b/Postman/Postman-Mail/PostmanGmailApiModuleZendMailTransport.php
index 4cf9b31..3cb05c9 100644
--- a/Postman/Postman-Mail/PostmanGmailApiModuleZendMailTransport.php
+++ b/Postman/Postman-Mail/PostmanGmailApiModuleZendMailTransport.php
@@ -189,10 +189,10 @@ if (! class_exists ( 'PostmanGmailApiModuleZendMailTransport' )) {
// The message needs to be encoded in Base64URL
$encodedMessage = rtrim ( strtr ( base64_encode ( $message ), '+/', '-_' ), '=' );
$googleApiMessage = new Google_Service_Gmail_Message ();
- $googleApiMessage->setRaw ( $encodedMessage );
$googleService = $this->_config [self::SERVICE_OPTION];
$googleClient = $googleService->getClient();
- //$googleService = new Google_Service_Gmail($googleClient);
+
+ $file_size = strlen($message);
$result = array ();
try {
@@ -210,7 +210,7 @@ if (! class_exists ( 'PostmanGmailApiModuleZendMailTransport' )) {
true,
$chunkSizeBytes
);
- $media->setFileSize(strlen($message));
+ $media->setFileSize($file_size);
$status = false;
while (! $status) {
diff --git a/Postman/PostmanUtils.php b/Postman/PostmanUtils.php
index ed5864e..b70b2b8 100644
--- a/Postman/PostmanUtils.php
+++ b/Postman/PostmanUtils.php
@@ -439,25 +439,17 @@ class PostmanUtils {
}
public static function getServerName() {
- $ip = '';
-
- if ( strpos( $_SERVER['SERVER_SOFTWARE'], 'iis' ) !== false ) {
- $ip = $_SERVER['LOCAL_ADDR'];
- }
-
- if ( empty( $ip ) ) {
- $ip = $_SERVER['SERVER_ADDR'];
- }
-
- if ( filter_var( $ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 ) ) {
- $host = gethostbyaddr( $ip );
- }
-
- if ( $host == $ip || $host == false ) {
- $host = filter_var( $_SERVER['HTTP_HOST'], FILTER_SANITIZE_STRING );
- }
-
- return $host ? $host : 'localhost';
+ $result = 'localhost.localdomain';
+
+ if (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER)) {
+ $result = $_SERVER['SERVER_NAME'];
+ } elseif (function_exists('gethostname') and gethostname() !== false) {
+ $result = gethostname();
+ } elseif (php_uname('n') !== false) {
+ $result = php_uname('n');
+ }
+
+ return $result;
}
public static function getHost( $url ) {