Changeset 1251311
- Timestamp:
- 09/22/2015 03:43:29 PM (11 years ago)
- Location:
- freshmail-newsletter/trunk
- Files:
-
- 6 edited
-
CHANGELOG.md (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
src/Plugin/Newsletter/Freshmail.php (modified) (4 diffs)
-
templates/admin_connect_page.php (modified) (1 diff)
-
vendor/class.rest.php (modified) (5 diffs)
-
wp-freshmail.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
freshmail-newsletter/trunk/CHANGELOG.md
r1235259 r1251311 1 1 ### Changelog 2 3 - 2.1.5 - 2015-09-22 4 * Fix: Add possibility to disable SSL verification. 2 5 3 6 - 2.1.4 - 2015-09-01 -
freshmail-newsletter/trunk/readme.txt
r1205963 r1251311 5 5 Requires at least: 3.0 6 6 Tested up to: 4.2.2 7 Stable tag: 2.1. 37 Stable tag: 2.1.5 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 174 174 == Changelog == 175 175 176 - 2.1.5 - 2015-09-22 177 * Fix: Add possibility to disable SSL verification. 178 179 - 2.1.4 - 2015-09-01 180 * Fix: Now ApiKey and ApiSecret are checking only once per day or if they were changed. 181 176 182 - 2.1.3 - 2015-07-24 177 183 * Add: Option to display popout on every single page, post, product. -
freshmail-newsletter/trunk/src/Plugin/Newsletter/Freshmail.php
r1235259 r1251311 7 7 class Freshmail 8 8 { 9 private $fmApiKey, $fmApiSecret, $ api, $connect, $fmSettings, $reportType, $reportArray;9 private $fmApiKey, $fmApiSecret, $fmVerifySSL, $api, $connect, $fmSettings, $reportType, $reportArray; 10 10 11 11 public function __construct() … … 34 34 $this->fmApiKey = get_option('freshmail_api_key'); 35 35 $this->fmApiSecret = get_option('freshmail_api_secret'); 36 $this->fmVerifySSL = (get_option('freshmail_dont_verify_ssl', 'false') == 'false'); 36 37 $this->connect = $this->connect(); 37 38 … … 147 148 $this->api->setApiKey($this->fmApiKey); 148 149 $this->api->setApiSecret($this->fmApiSecret); 150 $this->api->setVerifySSL($this->fmVerifySSL); 149 151 150 152 $date = new \DateTime('+1 day'); … … 230 232 update_option('freshmail_uninstall_all', 'false'); 231 233 } 234 235 if (isset($_POST['freshmail_dont_verify_ssl'])) { 236 if ($_POST['freshmail_dont_verify_ssl'] == 'true') { 237 update_option('freshmail_dont_verify_ssl', 'true'); 238 } 239 } else { 240 update_option('freshmail_dont_verify_ssl', 'false'); 241 } 232 242 } 233 243 234 244 $uninstallAll = get_option('freshmail_uninstall_all', 'false'); 245 $doNotVerifySSL = get_option('freshmail_dont_verify_ssl', 'false'); 235 246 require_once(WP_FRESHMAIL_DIR.'/templates/admin_connect_page.php'); 236 247 } -
freshmail-newsletter/trunk/templates/admin_connect_page.php
r1187394 r1251311 57 57 </p> 58 58 <p> 59 <label><input type="checkbox" name="freshmail_dont_verify_ssl" value="true" <?php echo ($doNotVerifySSL == 'true') ? 'checked="checked"' : null; ?>><?php echo __('Do not verify the SSL certificates (at your own risk).', 'wp_freshmail'); ?></label> 60 </p> 61 <p> 59 62 <input type="submit" value="<?php echo __('Save settings', 'wp_freshmail'); ?>" class="button button_fm" name="freshmail_save_settings"> 60 63 </p> -
freshmail-newsletter/trunk/vendor/class.rest.php
r1181908 r1251311 15 15 private $httpCode = null; 16 16 private $contentType = 'application/json'; 17 private $boolVerifySSL = true; 17 18 const host = 'https://api.freshmail.com/'; 18 19 const prefix = 'rest/'; … … 57 58 58 59 /** 60 * 61 * @return bool 62 */ 63 public function getVerifySSL() 64 { 65 return $this->boolVerifySSL; 66 } 67 68 /** 59 69 * Metoda ustawia secret do API 60 70 * … … 90 100 }//setApiKey 91 101 102 /** 103 * 104 * @param bool $boolVerifySSL 105 * @return rest_api 106 */ 107 public function setVerifySSL($boolVerifySSL) 108 { 109 $this->boolVerifySSL = $boolVerifySSL; 110 111 return $this; 112 } 113 114 92 115 public function doRequest($strUrl, $arrParams = array(), $boolRawResponse = false) 93 116 { … … 114 137 curl_setopt($resCurl, CURLOPT_POSTFIELDS, $strPostData); 115 138 }//endif 139 if(!$this->boolVerifySSL) { 140 curl_setopt($resCurl, CURLOPT_SSL_VERIFYPEER, false); 141 } 116 142 $this->rawResponse = curl_exec($resCurl); 117 143 $this->httpCode = curl_getinfo($resCurl, CURLINFO_HTTP_CODE); … … 129 155 }//endif 130 156 if (is_array($this->response) == false) { 131 throw new Exception('Connection error - curl error message: '.curl_error($resCurl).' ('.curl_errno($resCurl).')'); 157 if(curl_errno($resCurl) == 60) { 158 throw new Exception('There was an error with SSL certificate verification, to fix it please go to FreshMail settings and disable SSL verification. [Curl error message: '.curl_error($resCurl).' ('.curl_errno($resCurl).')]'); 159 } else { 160 throw new Exception('Connection error - curl error message: '.curl_error($resCurl).' ('.curl_errno($resCurl).')'); 161 } 132 162 }//endif 133 163 return $this->response; -
freshmail-newsletter/trunk/wp-freshmail.php
r1235259 r1251311 4 4 * Plugin URI: http://freshmail.com/plugin/wordpress-newsletter/ 5 5 * Description: FreshMail is an email marketing tool for creating and sending amazing newsletters. Our intuitive system leads users from campaign planning and creation to final reports. A free account lets you send up to 2000 messages to a maximum of 500 recipients each month. 6 * Version: 2.1. 46 * Version: 2.1.5 7 7 * Author: Borbis Media 8 8 * Author URI: http://www.borbis.com
Note: See TracChangeset
for help on using the changeset viewer.