| @@ -10,9 +10,9 @@ | ||
| 10 | 10 | public $account; |
| 11 | 11 | public $bvapi; |
| 12 | 12 | public $db; |
| 13 | 13 | |
| 14 | - const MISC_WING_VERSION = 1.2; | |
| 14 | + const MISC_WING_VERSION = 1.4; | |
| 15 | 15 | |
| 16 | 16 | public function __construct($callback_handler) { |
| 17 | 17 | $this->settings = $callback_handler->settings; |
| 18 | 18 | $this->siteinfo = $callback_handler->siteinfo; |
| @@ -151,8 +151,11 @@ | ||
| 151 | 151 | case "phpinfo": |
| 152 | 152 | phpinfo(); |
| 153 | 153 | die(); |
| 154 | 154 | break; |
| 155 | + case "wpnonce": | |
| 156 | + $resp = array("wpnonce" => wp_create_nonce($params["wpnonce_action"])); | |
| 157 | + break; | |
| 155 | 158 | case "dlttrsnt": |
| 156 | 159 | $resp = array("dlttrsnt" => $settings->deleteTransient($params['key'])); |
| 157 | 160 | break; |
| 158 | 161 | case "optns": |
| @@ -220,8 +223,35 @@ | ||
| 220 | 223 | foreach ( $params['post_ids'] as $id ) { |
| 221 | 224 | $resp[$id]['url'] = get_permalink($id); |
| 222 | 225 | } |
| 223 | 226 | } |
| 227 | + break; | |
| 228 | + case "stwplpwhtlbl": | |
| 229 | + $option = $bvinfo->wp_lp_whitelabel_option; | |
| 230 | + $info = array(); | |
| 231 | + | |
| 232 | + if (isset($params['logoFile'])) { | |
| 233 | + $info['logo'] = $params['logoFile']; | |
| 234 | + } | |
| 235 | + | |
| 236 | + if (isset($params['label'])) { | |
| 237 | + $info['label'] = $params['label']; | |
| 238 | + } | |
| 239 | + | |
| 240 | + if (isset($params['errorMessage'])) { | |
| 241 | + $info['2fa_error_message'] = $params['errorMessage']; | |
| 242 | + } | |
| 243 | + | |
| 244 | + if (isset($params['tooltip'])) { | |
| 245 | + $info['2fa_tooltip'] = $params['tooltip']; | |
| 246 | + } | |
| 247 | + | |
| 248 | + $resp = array("status" => $settings->updateOption($option, $info)); | |
| 249 | + break; | |
| 250 | + case "dsblwplpwhtlbl": | |
| 251 | + $option = $bvinfo->wp_lp_whitelabel_option; | |
| 252 | + $settings->deleteOption($option); | |
| 253 | + $resp = array("status" => !$settings->getOption($option)); | |
| 224 | 254 | break; |
| 225 | 255 | default: |
| 226 | 256 | $resp = false; |
| 227 | 257 | } |