Changeset 641779
- Timestamp:
- 12/19/2012 03:15:27 PM (13 years ago)
- Location:
- dottoro-theme-updater/trunk
- Files:
-
- 4 edited
-
dottoro-theme-updater.php (modified) (12 diffs)
-
languages/default.mo (modified) (previous)
-
languages/default.po (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
dottoro-theme-updater/trunk/dottoro-theme-updater.php
r543393 r641779 3 3 Plugin Name: Dottoro Theme Updater 4 4 Plugin URI: http://wordpress.org/extend/plugins/dottoro-theme-updater/ 5 Description: Dottoro Updater plugin is an automation tool to update your Dottoro themes migrating their actual skin settings to the updated ones. 6 Version: 1. 45 Description: Dottoro Updater plugin is an automation tool to update your Dottoro themes migrating their actual skin settings to the updated ones. <a href="themes.php?page=dottoro-theme-updater/dottoro-theme-updater.php">Theme Updater configuration page</a> 6 Version: 1.5 7 7 Author: Dottoro.com 8 8 Author URI: http://themeeditor.dottoro.com … … 15 15 16 16 /* 17 Copyright 201 0Dottoro.com (email : [email protected])17 Copyright 2012 Dottoro.com (email : [email protected]) 18 18 19 19 This program is free software; you can redistribute it and/or modify … … 40 40 $this->plugin_path = plugin_basename(__FILE__); 41 41 $this->option_service_key = 'dottoro_updater_service_key'; 42 $this->service_key_cookie = 'dottoro_updater_service_key'; 43 $this->settings_option_key = 'dottoro_updater_settings'; 42 44 $this->theme_update_option_key = 'dottoro_theme_updates'; 43 45 … … 48 50 $this->editor_docs_url = $this->editor_url . 'docs/'; 49 51 52 $this->form_saved = false; 53 50 54 // languages files 51 55 load_plugin_textdomain('dottoro_updater', false, basename( dirname( __FILE__ ) ) . '/languages' ); … … 56 60 } else { 57 61 // single menu 62 add_action ( 'admin_init', array (&$this, 'init_admin') ); 58 63 add_action ( 'admin_menu', array (&$this, 'add_menus') ); 59 64 } … … 69 74 } 70 75 76 function init_admin () { 77 $_POST = stripslashes_deep( $_POST ); 78 $this->form_saved = $this->process_form(); 79 } 80 71 81 function add_mu_menus () { 72 82 add_submenu_page( 'plugins.php', __('Dottoro Updater', 'dottoro_updater'), __('Dottoro Updater', 'dottoro_updater'), 'switch_themes', $this->plugin_path, array( &$this, 'admin_page' ) ); … … 83 93 } 84 94 85 $ _POST = stripslashes_deep( $_POST);86 $ form_saved = $this->process_form();87 88 89 $service_key = get_site_option ($this->option_service_key);95 $settings = $this->get_settings (); 96 $service_key = $this->get_service_key (); 97 if ($this->form_saved) { 98 $service_key = $_POST['service_key']; 99 } 90 100 ?> 91 101 <style> … … 104 114 105 115 <?php 106 if ( $ form_saved ) {116 if ( $this->form_saved ) { 107 117 echo('<p class="notice">' . __('Service Key Saved. Thank You.', 'dottoro_updater') . '</p>'); 108 118 } … … 123 133 <div> 124 134 <small><?php __('Here you can set your service key.', 'dottoro_updater'); ?></small> 135 </div> 136 </td> 137 </tr> 138 <tr valign="top"> 139 <th scope="row"> 140 <label for="save_in_cookie"> 141 <?php _e('Store service key in a cookie', 'dottoro_updater'); ?> 142 </label> 143 </th> 144 <td> 145 <input name="save_in_cookie" id="save_in_cookie" <?php checked ($settings['save_in_cookie']); ?> type="checkbox"/> 146 <div> 147 <small><?php __('Check if you want to store the service key in a cookie. Please select this checkbox, if you want to give someone full control of the site to ensure the security of your service key. The cookie is deleted on logout.', 'dottoro_updater'); ?></small> 125 148 </div> 126 149 </td> … … 197 220 return; 198 221 } 199 update_site_option ( $this->option_service_key, trim ( $_POST['service_key'] ) ); 222 223 $settings = $this->save_settings ( $_POST ); 224 $this->set_service_key ( trim ( $_POST['service_key'] ), $settings['save_in_cookie'] ); 200 225 return true; 201 226 } … … 203 228 } 204 229 205 230 function get_settings () 231 { 232 $settings = array ( 233 'save_in_cookie' => false, 234 ); 235 236 $saved_settings = get_site_option ($this->settings_option_key); 237 if ($saved_settings) { 238 $settings = array_merge ($settings, $saved_settings); 239 } 240 return $settings; 241 } 242 243 function save_settings ( $datas = array () ) 244 { 245 $settings = array ( 246 'save_in_cookie' => false, 247 ); 248 249 if ( isset( $datas['save_in_cookie'] ) ) { 250 $settings['save_in_cookie'] = true; 251 } 252 update_site_option ( $this->settings_option_key, $settings ); 253 254 return $settings; 255 } 256 257 function get_service_key ( ) 258 { 259 $service_key = ''; 260 $settings = $this->get_settings (); 261 if ( $settings['save_in_cookie'] ) { 262 if ( isset ($_COOKIE[$this->service_key_cookie]) && $_COOKIE[$this->service_key_cookie] ) { 263 $service_key = $_COOKIE[$this->service_key_cookie]; 264 $service_key = $this->basic_decrypt ($service_key); 265 } 266 } else { 267 $service_key = get_site_option ($this->option_service_key); 268 } 269 return $service_key; 270 } 271 272 function set_service_key ( $service_key, $in_cookie = false ) 273 { 274 $service_key = $service_key ? $service_key : ''; 275 276 if ( $in_cookie ) { 277 $service_key = $this->basic_encrypt ($service_key); 278 setcookie ($this->service_key_cookie, $service_key, 0, SITECOOKIEPATH, COOKIE_DOMAIN, false, true); 279 return delete_site_option ( $this->option_service_key ); 280 } 281 282 setcookie ($this->service_key_cookie, "", time() - 3600, SITECOOKIEPATH, COOKIE_DOMAIN, false, true); 283 return update_site_option ( $this->option_service_key, trim ( $service_key ) ); 284 } 285 286 function basic_encrypt ( $str, $key = '' ) 287 { 288 $key = $this->get_basic_crypt_key ( $key ); 289 $iv_size = mcrypt_get_iv_size ( MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB ); 290 $iv = mcrypt_create_iv ( $iv_size, MCRYPT_RAND ); 291 return base64_encode ( mcrypt_encrypt ( MCRYPT_RIJNDAEL_256, $key, $str, MCRYPT_MODE_ECB, $iv ) ); 292 } 293 294 function basic_decrypt ( $str, $key = '' ) 295 { 296 $key = $this->get_basic_crypt_key ( $key ); 297 $iv_size = mcrypt_get_iv_size ( MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB ); 298 $iv = mcrypt_create_iv ( $iv_size, MCRYPT_RAND ); 299 return rtrim ( mcrypt_decrypt ( MCRYPT_RIJNDAEL_256, $key, base64_decode ($str), MCRYPT_MODE_ECB, $iv ), "\0" ); 300 } 301 302 function get_basic_crypt_key ( $key = '' ) 303 { 304 if ($key == '') { 305 $key = wp_salt (); 306 $key = substr ($key, 0, mcrypt_get_key_size (MCRYPT_RIJNDAEL_256, MCRYPT_MODE_CBC)); 307 } 308 return $key; 309 } 206 310 207 311 /************************** … … 427 531 } 428 532 429 $service_key = get_site_option ( $this->option_service_key);533 $service_key = $this->get_service_key (); 430 534 431 535 $settings = array ( -
dottoro-theme-updater/trunk/languages/default.po
r543393 r641779 3 3 "Project-Id-Version: Dottoro Updater\n" 4 4 "Report-Msgid-Bugs-To: \n" 5 "POT-Creation-Date: 2012- 05-12 19:46+0100\n"6 "PO-Revision-Date: 2012- 05-12 19:46+0100\n"5 "POT-Creation-Date: 2012-12-19 01:03+0100\n" 6 "PO-Revision-Date: 2012-12-19 01:04+0100\n" 7 7 "Last-Translator: Dottoro <[email protected]>\n" 8 "Language-Team: Dottoro <[email protected]>\n"8 "Language-Team: \n" 9 9 "MIME-Version: 1.0\n" 10 10 "Content-Type: text/plain; charset=UTF-8\n" … … 12 12 "X-Poedit-KeywordsList: _;__;_e\n" 13 13 "X-Poedit-Basepath: ./../\n" 14 "X-Generator: Poedit 1.5.4\n" 14 15 "X-Poedit-SearchPath-0: .\n" 15 16 16 #: dottoro-theme-updater.php:72 17 #: dottoro-theme-updater.php:76 17 #: dottoro-theme-updater.php:82 dottoro-theme-updater.php:86 18 18 msgid "Dottoro Updater" 19 19 msgstr "" 20 20 21 #: dottoro-theme-updater.php: 8221 #: dottoro-theme-updater.php:92 22 22 msgid "You do not have sufficient permissions to see this page." 23 23 msgstr "" 24 24 25 #: dottoro-theme-updater.php: 9825 #: dottoro-theme-updater.php:108 26 26 msgid "Dottoro Theme Updater" 27 27 msgstr "" 28 28 29 #: dottoro-theme-updater.php:1 0129 #: dottoro-theme-updater.php:111 30 30 #, php-format 31 msgid "You need a service key to use Dottoro Theme Updater. You can request a service key on your account page on Dottoro.com under <a href=\"%1$s\" target=\"_blank\">Service Keys</a>" 31 msgid "" 32 "You need a service key to use Dottoro Theme Updater. You can request a " 33 "service key on your account page on Dottoro.com under <a href=\"%1$s\" " 34 "target=\"_blank\">Service Keys</a>" 32 35 msgstr "" 33 36 34 #: dottoro-theme-updater.php:1 0737 #: dottoro-theme-updater.php:117 35 38 msgid "Service Key Saved. Thank You." 36 39 msgstr "" 37 40 38 #: dottoro-theme-updater.php:1 1841 #: dottoro-theme-updater.php:128 39 42 msgid "Service Key" 40 43 msgstr "" 41 44 42 #: dottoro-theme-updater.php:1 2445 #: dottoro-theme-updater.php:134 43 46 msgid "Here you can set your service key." 44 47 msgstr "" 45 48 46 #: dottoro-theme-updater.php:133 49 #: dottoro-theme-updater.php:141 50 msgid "Store service key in a cookie" 51 msgstr "" 52 53 #: dottoro-theme-updater.php:147 54 msgid "" 55 "Check if you want to store the service key in a cookie. Please select this " 56 "checkbox, if you want to give someone full control of the site to ensure the " 57 "security of your service key. The cookie is deleted on logout." 58 msgstr "" 59 60 #: dottoro-theme-updater.php:156 47 61 msgid "Save Service Key" 48 62 msgstr "" 49 63 50 #: dottoro-theme-updater.php:137 51 msgid "<b>Important:</b> The service key is a security code; treat it like you treat your passwords. With the service key, anyone can download and modify your skins. If you suspect that someone might have got access to your service key, delete it and request a new one on your account page on Dottoro.com." 64 #: dottoro-theme-updater.php:160 65 msgid "" 66 "<b>Important:</b> The service key is a security code; treat it like you " 67 "treat your passwords. With the service key, anyone can download and modify " 68 "your skins. If you suspect that someone might have got access to your " 69 "service key, delete it and request a new one on your account page on Dottoro." 70 "com." 52 71 msgstr "" 53 72 54 #: dottoro-theme-updater.php:1 4273 #: dottoro-theme-updater.php:165 55 74 msgid "Dottoro Theme Updater checks for updates every 12 hours." 56 75 msgstr "" 57 76 58 #: dottoro-theme-updater.php:143 59 msgid "If you want to force it to check for updates immediately, click on this button:" 77 #: dottoro-theme-updater.php:166 78 msgid "" 79 "If you want to force it to check for updates immediately, click on this " 80 "button:" 60 81 msgstr "" 61 82 62 #: dottoro-theme-updater.php:1 4783 #: dottoro-theme-updater.php:170 63 84 msgid "Check Now" 64 85 msgstr "" 65 86 66 #: dottoro-theme-updater.php:1 5787 #: dottoro-theme-updater.php:180 67 88 msgid "<b>The following themes have new versions available:</b>" 68 89 msgstr "" 69 90 70 #: dottoro-theme-updater.php: 17891 #: dottoro-theme-updater.php:201 71 92 #, php-format 72 93 msgid "Go to <a href=\"%1$s\">WordPress Updates</a> to update your themes." 73 94 msgstr "" 74 95 75 #: dottoro-theme-updater.php: 18196 #: dottoro-theme-updater.php:204 76 97 msgid "<b>No updates were found.</b>" 77 98 msgstr "" 78 99 79 #: dottoro-theme-updater.php: 400100 #: dottoro-theme-updater.php:504 80 101 #, php-format 81 102 msgid "Theme %s not found." 82 103 msgstr "" 83 104 84 #: dottoro-theme-updater.php: 420105 #: dottoro-theme-updater.php:524 85 106 msgid "Could not create Temporary file." 86 107 msgstr "" 87 108 88 #: dottoro-theme-updater.php: 426109 #: dottoro-theme-updater.php:530 89 110 msgid "No skins found." 90 111 msgstr "" 91 -
dottoro-theme-updater/trunk/readme.txt
r543393 r641779 3 3 Tags: dottoro, theme, update, updater, skin 4 4 Requires at least: 3.2 5 Tested up to: 3. 3.26 Stable tag: 1. 45 Tested up to: 3.5 6 Stable tag: 1.5 7 7 8 8 Dottoro Updater plugin is an automation tool to update your Dottoro themes migrating their actual skin settings to the updated ones. … … 41 41 == Changelog == 42 42 43 = 1.5 = 44 * new option added: Store service key in a cookie 45 43 46 = 1.4 = 44 47 * skin settings update fix
Note: See TracChangeset
for help on using the changeset viewer.