Changeset 1484143
- Timestamp:
- 08/26/2016 02:02:30 PM (10 years ago)
- Location:
- pwebonedrive/trunk
- Files:
-
- 4 edited
-
admin.php (modified) (8 diffs)
-
pwebonedrive.php (modified) (1 diff)
-
readme.txt (modified) (4 diffs)
-
site.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pwebonedrive/trunk/admin.php
r1480688 r1484143 1 1 <?php 2 2 /** 3 * @version 2.0. 23 * @version 2.0.3 4 4 * @package OneDrive 5 5 * @copyright © 2016 Perfect Web sp. z o.o., All rights reserved. https://www.perfect-web.co … … 109 109 wp_die(__('You do not have sufficient permissions to access this page.')); 110 110 } 111 112 $errors = array(); 111 113 112 114 // See if the user has posted us some information … … 114 116 if (isset($_POST['submitConfig'])) 115 117 { 116 $errors = array();117 118 118 if (isset($_POST['client_id']) AND $_POST['client_id']) 119 119 { 120 if (preg_match('/^[0-9a-zA-Z\-]+$/', $_POST['client_id'])) 121 { 122 update_option('pweb_onedrive_client_id', preg_replace('/[^0-9a-zA-Z\-]$/', '', trim($_POST['client_id']))); 123 } 124 else 125 { 126 $errors[] = __('Incorrect Client ID.', 'pwebonedrive'); 127 } 120 update_option('pweb_onedrive_client_id', trim($_POST['client_id'])); 128 121 } 129 122 else … … 134 127 if (isset($_POST['client_secret']) AND $_POST['client_secret']) 135 128 { 136 update_option('pweb_onedrive_client_secret', addslashes(preg_replace('/[\'"\/]/', '', trim($_POST['client_secret']))));129 update_option('pweb_onedrive_client_secret', trim($_POST['client_secret'])); 137 130 } 138 131 else … … 141 134 } 142 135 143 if (count($errors)) 144 { 145 ?> 146 <div class="error"><p><strong><?php echo implode('<br>', $errors); ?></strong></p></div> 147 <?php 148 } 149 else 136 if (!count($errors)) 150 137 { 151 138 ?> … … 153 140 <?php 154 141 } 142 } 143 144 $client_id = get_option('pweb_onedrive_client_id'); 145 if ((empty($client_id) OR strpos($client_id, '-') !== false OR strlen($client_id) > 16) AND !is_ssl()) 146 { 147 $errors[] = __('OneDrive API requires website with a vliad SSL certificate. Make sure that you can connect with your website through HTTPS protocol.', 'pwebonedrive'); 148 } 149 150 if (count($errors)) 151 { 152 ?> 153 <div class="error"><p><strong><?php echo implode('<br>', $errors); ?></strong></p></div> 154 <?php 155 155 } 156 156 ?> … … 223 223 <th><label for="pweb-client_id"><?php _e('Client ID', 'pwebonedrive'); ?></label></th> 224 224 <td> 225 <input id="pweb-client_id" name="client_id" type="text" size="15" maxlength="32"value="<?php echo esc_attr(get_option('pweb_onedrive_client_id')); ?>" class="regular-text">225 <input id="pweb-client_id" name="client_id" type="text" size="15" value="<?php echo esc_attr(get_option('pweb_onedrive_client_id')); ?>" class="regular-text"> 226 226 </td> 227 227 </tr> … … 229 229 <th><label for="pweb-client_secret"><?php _e('Client secret', 'pwebonedrive'); ?></label></th> 230 230 <td> 231 <input id="pweb-client_secret" name="client_secret" type="password" size="15" maxlength="50"value="<?php echo esc_attr(get_option('pweb_onedrive_client_secret')); ?>" class="regular-text">231 <input id="pweb-client_secret" name="client_secret" type="password" size="15" value="<?php echo esc_attr(get_option('pweb_onedrive_client_secret')); ?>" class="regular-text"> 232 232 </td> 233 233 </tr> -
pwebonedrive/trunk/pwebonedrive.php
r1480688 r1484143 4 4 * Plugin URI: https://www.perfect-web.co/wordpress/microsoft-onedrive-gallery-file 5 5 * Description: Share easily your photos and files stored on Microsoft OneDrive. You can display a gallery with your photos or a link to a file for download. 6 * Version: 2.0. 26 * Version: 2.0.3 7 7 * Text Domain: pwebonedrive 8 8 * Author: Piotr Moćko -
pwebonedrive/trunk/readme.txt
r1480688 r1484143 5 5 Requires at least: 3.1.0 6 6 Tested up to: 4.6 7 Stable tag: 2.0. 27 Stable tag: 2.0.3 8 8 License: GPLv3 9 9 License URI: http://www.gnu.org/licenses/gpl-3.0.html … … 52 52 = Requirements = 53 53 54 PHP 5.2+ 54 * PHP 5.2+ 55 * SSL certificate 55 56 56 57 57 58 == Installation == 58 59 60 1. Your website has to have a valid SSL certificate. 59 61 1. Install ZIP file or upload plugin files to the `/wp-content/plugins/pwebonedrive` directory. 60 62 1. **Activate the plugin** through the Plugins menu in WordPress. … … 63 65 1. Set **Redirect URL** in Windows Live Application as shown in plugin configuration. 64 66 It should look like this: 65 `http ://yourdomain.com/path-to-wordpress/wp-content/pwebonedrive/callback.php`67 `https://yourdomain.com/path-to-wordpress/wp-content/pwebonedrive/callback.php` 66 68 or if you have enabled Permalinks in WordPress Settings then it should look like this: 67 `http ://yourdomain.com/path-to-wordpress/pwebonedrive/callback`69 `https://yourdomain.com/path-to-wordpress/pwebonedrive/callback` 68 70 1. Set **Mobile client app: No** in Windows Live Application. 69 71 1. If available set **Enhanced redirection security: Enabled** in Windows Live Application (for applications created before June 2014). … … 212 214 213 215 == Changelog == 216 217 = 2.0.3 / 26-08-2016 = 218 * Fixed saving new client ID 219 * Force HTTPS on redirect URI 214 220 215 221 = 2.0.2 / 22-08-2016 = -
pwebonedrive/trunk/site.php
r1479994 r1484143 2 2 3 3 /** 4 * @version 2.0. 14 * @version 2.0.3 5 5 * @package OneDrive 6 6 * @copyright © 2016 Perfect Web sp. z o.o., All rights reserved. https://www.perfect-web.co … … 989 989 if ($ssl === null) 990 990 { 991 $ssl = is_ssl(); 991 $client_id = get_option('pweb_onedrive_client_id'); 992 $ssl = (empty($client_id) || strpos($client_id, '-') !== false || strlen($client_id) > 16) ? true : is_ssl(); 992 993 } 993 994
Note: See TracChangeset
for help on using the changeset viewer.