Changeset 1946150
- Timestamp:
- 09/24/2018 01:56:44 PM (8 years ago)
- Location:
- unisender-integration/trunk
- Files:
-
- 4 edited
-
class/UnisenderActivation.php (modified) (2 diffs)
-
class/UnisenderApi.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
tpl/Activation/login_form.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
unisender-integration/trunk/class/UnisenderActivation.php
r1200288 r1946150 9 9 return; 10 10 } 11 if (!get_option('unisender_api_key') || !get_option('unisender_login')) {11 if (!get_option('unisender_api_key')) { 12 12 add_management_page( 13 13 'Unisender Integration', … … 81 81 public function actionLogin() 82 82 { 83 if (empty($_POST['api_key']) || empty($_POST['login'])) {83 if (empty($_POST['api_key'])) { 84 84 die(self::setResponse(false, __('Not all required fields are filled', $this->textdomain))); 85 85 } 86 86 87 87 $apiKey = $_POST['api_key']; 88 $login = $_POST['login']; 89 90 $api = UnisenderApi::getInstance($apiKey, $login); 88 89 $api = UnisenderApi::getInstance($apiKey); 91 90 $result = $api->getUserInfo(); 92 91 if ($result['status'] === 'success') { 93 92 update_option('unisender_api_key', $apiKey); 94 update_option('unisender_login', $login);95 93 96 94 UnisenderContactList::actionSync(1); -
unisender-integration/trunk/class/UnisenderApi.php
r1590989 r1946150 12 12 13 13 private $apiKey; 14 private $login; 15 16 protected function __construct($apiKey, $login) 14 15 protected function __construct($apiKey) 17 16 { 18 17 $this->apiKey = $apiKey; 19 $this->login = $login;20 18 } 21 19 22 20 /** 23 21 * @param mixed $apiKey 24 * @param mixed $login25 22 * 26 23 * @return null|UnisenderApi 27 24 */ 28 public static function getInstance($apiKey = null , $login = null)25 public static function getInstance($apiKey = null) 29 26 { 30 27 if (self::$instance === null) { 31 if (!$apiKey && !$login) {28 if (!$apiKey) { 32 29 $apiKey = get_option('unisender_api_key'); 33 $login = get_option('unisender_login'); 34 } 35 36 if ($apiKey === null || $login === null) { 30 } 31 32 if ($apiKey === null) { 37 33 return null; 38 34 } 39 35 40 self::$instance = new self($apiKey , $login);36 self::$instance = new self($apiKey); 41 37 } 42 38 … … 138 134 $method = 'getUserInfo'; 139 135 $params['api_key'] = $this->apiKey; 140 $params['login'] = $this->login;141 136 142 137 $response = self::exec($method, $params); -
unisender-integration/trunk/readme.txt
r1674371 r1946150 3 3 Contributors: UniSender Inc 4 4 Tags: рассылка, рассылки, программа для имейл рассылки, имейл рассылка, email рассылка, e-mail рассылка, массовая рассылка, e mail рассылка, unisender, юнисендер 5 Stable tag: 2.0. 56 Tested up to: 4. 7.55 Stable tag: 2.0.6 6 Tested up to: 4.9.8 7 7 License: GPLv2 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 62 62 == Changelog == 63 63 64 2.0.6 65 66 1. Убрано поле Login из формы авторизации. 67 64 68 2.0.5 65 69 -
unisender-integration/trunk/tpl/Activation/login_form.php
r1200288 r1946150 3 3 <input name="action" type="hidden" value="unisender_login"> 4 4 <table class="form-table"> 5 <tr class="form-field">6 <th scope="row">7 <span class="description">*</span> <label for="login"><?php _e('Login', $this->textdomain); ?></label>8 </th>9 <td>10 <input name="login" type="text" id="login" value="" aria-required="true"11 placeholder="<?php _e('Login', $this->textdomain)?>" required>12 </td>13 </tr>14 5 <tr class="form-field"> 15 6 <th scope="row">
Note: See TracChangeset
for help on using the changeset viewer.