Changeset 2244568
- Timestamp:
- 02/14/2020 05:43:50 PM (6 years ago)
- Location:
- ithemes-sync
- Files:
-
- 2 added
- 16 edited
- 1 copied
-
tags/2.1.3 (copied) (copied from ithemes-sync/trunk)
-
tags/2.1.3/api.php (modified) (1 diff)
-
tags/2.1.3/functions.php (modified) (1 diff)
-
tags/2.1.3/history.txt (modified) (1 diff)
-
tags/2.1.3/init.php (modified) (1 diff)
-
tags/2.1.3/lang/ithemes-sync.pot (modified) (2 diffs)
-
tags/2.1.3/readme.txt (modified) (1 diff)
-
tags/2.1.3/request-handler.php (modified) (2 diffs)
-
tags/2.1.3/server.php (modified) (2 diffs)
-
tags/2.1.3/verbs/check-nonce.php (added)
-
trunk/api.php (modified) (1 diff)
-
trunk/functions.php (modified) (1 diff)
-
trunk/history.txt (modified) (1 diff)
-
trunk/init.php (modified) (1 diff)
-
trunk/lang/ithemes-sync.pot (modified) (2 diffs)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/request-handler.php (modified) (2 diffs)
-
trunk/server.php (modified) (2 diffs)
-
trunk/verbs/check-nonce.php (added)
Legend:
- Unmodified
- Added
- Removed
-
ithemes-sync/tags/2.1.3/api.php
r1962339 r2244568 31 31 32 32 private $default_verbs = array( 33 'check-nonce' => 'Ithemes_Sync_Verb_Check_Nonce', 33 34 'db-optimization' => 'Ithemes_Sync_Verb_DB_Optimization', 34 35 'deauthenticate-user' => 'Ithemes_Sync_Verb_Deauthenticate_User', -
ithemes-sync/tags/2.1.3/functions.php
r1669854 r2244568 1009 1009 } 1010 1010 1011 public static function generate_sync_nonce( $name ) { 1012 1013 $nonce = array( 1014 'value' => wp_generate_password( 24 ), 1015 'expiration' => time() + 3600 1016 ); 1017 1018 update_option( 'ithemes-sync-nonce-' . $name, $nonce, false ); 1019 1020 return $nonce; 1021 } 1022 1023 public static function validate_sync_nonce( $name, $supplied_nonce ) { 1024 $nonce = get_option( 'ithemes-sync-nonce-' . $name ); 1025 1026 if ( $nonce !== false && $nonce['expiration'] > time() && hash_equals( $supplied_nonce, $nonce['value'] ) ) { 1027 return true; 1028 } 1029 1030 return false; 1031 } 1011 1032 } -
ithemes-sync/tags/2.1.3/history.txt
r2243350 r2244568 225 225 2.1.2 - 2020-02-10 - Josh Oakes 226 226 Bug Fix: Fix PHP warning when updating plugins & themes on WP 5.3+ 227 2.1.3 - 2020-02-10 - Josh Oakes 228 Bug Fix: Add nonce to authentication request -
ithemes-sync/tags/2.1.3/init.php
r2243350 r2244568 5 5 Description: Manage updates to your WordPress sites easily in one place. 6 6 Author: iThemes 7 Version: 2.1. 27 Version: 2.1.3 8 8 Author URI: http://ithemes.com/ 9 9 Domain Path: /lang/ -
ithemes-sync/tags/2.1.3/lang/ithemes-sync.pot
r2243350 r2244568 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: iThemes Sync 2.1. 2\n"5 "Project-Id-Version: iThemes Sync 2.1.3\n" 6 6 "Report-Msgid-Bugs-To: http://ithemes.com/support/\n" 7 "POT-Creation-Date: 2020-02-1 2 18:00:57+00:00\n"7 "POT-Creation-Date: 2020-02-14 17:34:22+00:00\n" 8 8 "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n" 9 9 "MIME-Version: 1.0\n" … … 351 351 msgstr "" 352 352 353 #: server.php:1 88353 #: server.php:192 354 354 msgid "An unrecognized server response format was received from the iThemes Sync server." 355 355 msgstr "" -
ithemes-sync/tags/2.1.3/readme.txt
r2243350 r2244568 88 88 == Changelog == 89 89 90 = 2.1.3 = 91 * Bug Fix: Add nonce to authentication request 92 90 93 = 2.1.2 = 91 94 * Bug Fix: Fix PHP warning when updating plugins & themes on WP 5.3+ -
ithemes-sync/tags/2.1.3/request-handler.php
r2225554 r2244568 230 230 private function parse_request( $request ) { 231 231 232 if ( empty( $this->options['authentications'] ) && ( ! empty( $request['action'] ) && 'manage-site' != $request['action'] ) ) {233 $this->send_response( new WP_Error( 'site-not-authenticated', 'The site does not have any authenticated users.' ) );234 }235 236 232 $this->request = $request; 237 233 … … 251 247 252 248 // If action is manage-site, stop here 253 if ( 'manage-site' == $request['action'] ) {249 if ( 'manage-site' == $request['action'] || 'check-nonce' == $request['action'] ) { 254 250 return; 255 251 } 256 252 257 if ( ! isset( $this->options['authentications'][$request['user_id']] ) ) {253 if ( empty( $this->options['authentications'] ) || ! isset( $this->options['authentications'][$request['user_id']] ) ) { 258 254 $this->send_response( new WP_Error( 'user-not-authenticated', 'The requested user is not authenticated.' ) ); 259 255 } -
ithemes-sync/tags/2.1.3/server.php
r2186328 r2244568 30 30 31 31 public static function authenticate( $username, $password ) { 32 require_once( $GLOBALS['ithemes_sync_path'] . '/functions.php' ); 33 32 34 $query = array( 33 35 'user' => $username, 34 36 ); 35 37 38 $nonce = Ithemes_Sync_Functions::generate_sync_nonce( 'auth-verification' ); 36 39 $data = array( 37 40 'auth_token' => self::get_password_hash( $username, $password ), 38 ); 39 41 'nonce' => $nonce['value'] 42 ); 43 40 44 return self::request( 'authenticate-user', $query, $data ); 41 45 } … … 237 241 remove_action( 'http_api_curl', array( __CLASS__, 'add_ca_patch_to_curl_opts' ) ); 238 242 } 243 239 244 } -
ithemes-sync/trunk/api.php
r1962339 r2244568 31 31 32 32 private $default_verbs = array( 33 'check-nonce' => 'Ithemes_Sync_Verb_Check_Nonce', 33 34 'db-optimization' => 'Ithemes_Sync_Verb_DB_Optimization', 34 35 'deauthenticate-user' => 'Ithemes_Sync_Verb_Deauthenticate_User', -
ithemes-sync/trunk/functions.php
r1669854 r2244568 1009 1009 } 1010 1010 1011 public static function generate_sync_nonce( $name ) { 1012 1013 $nonce = array( 1014 'value' => wp_generate_password( 24 ), 1015 'expiration' => time() + 3600 1016 ); 1017 1018 update_option( 'ithemes-sync-nonce-' . $name, $nonce, false ); 1019 1020 return $nonce; 1021 } 1022 1023 public static function validate_sync_nonce( $name, $supplied_nonce ) { 1024 $nonce = get_option( 'ithemes-sync-nonce-' . $name ); 1025 1026 if ( $nonce !== false && $nonce['expiration'] > time() && hash_equals( $supplied_nonce, $nonce['value'] ) ) { 1027 return true; 1028 } 1029 1030 return false; 1031 } 1011 1032 } -
ithemes-sync/trunk/history.txt
r2243350 r2244568 225 225 2.1.2 - 2020-02-10 - Josh Oakes 226 226 Bug Fix: Fix PHP warning when updating plugins & themes on WP 5.3+ 227 2.1.3 - 2020-02-10 - Josh Oakes 228 Bug Fix: Add nonce to authentication request -
ithemes-sync/trunk/init.php
r2243350 r2244568 5 5 Description: Manage updates to your WordPress sites easily in one place. 6 6 Author: iThemes 7 Version: 2.1. 27 Version: 2.1.3 8 8 Author URI: http://ithemes.com/ 9 9 Domain Path: /lang/ -
ithemes-sync/trunk/lang/ithemes-sync.pot
r2243350 r2244568 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: iThemes Sync 2.1. 2\n"5 "Project-Id-Version: iThemes Sync 2.1.3\n" 6 6 "Report-Msgid-Bugs-To: http://ithemes.com/support/\n" 7 "POT-Creation-Date: 2020-02-1 2 18:00:57+00:00\n"7 "POT-Creation-Date: 2020-02-14 17:34:22+00:00\n" 8 8 "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n" 9 9 "MIME-Version: 1.0\n" … … 351 351 msgstr "" 352 352 353 #: server.php:1 88353 #: server.php:192 354 354 msgid "An unrecognized server response format was received from the iThemes Sync server." 355 355 msgstr "" -
ithemes-sync/trunk/readme.txt
r2243350 r2244568 88 88 == Changelog == 89 89 90 = 2.1.3 = 91 * Bug Fix: Add nonce to authentication request 92 90 93 = 2.1.2 = 91 94 * Bug Fix: Fix PHP warning when updating plugins & themes on WP 5.3+ -
ithemes-sync/trunk/request-handler.php
r2225554 r2244568 230 230 private function parse_request( $request ) { 231 231 232 if ( empty( $this->options['authentications'] ) && ( ! empty( $request['action'] ) && 'manage-site' != $request['action'] ) ) {233 $this->send_response( new WP_Error( 'site-not-authenticated', 'The site does not have any authenticated users.' ) );234 }235 236 232 $this->request = $request; 237 233 … … 251 247 252 248 // If action is manage-site, stop here 253 if ( 'manage-site' == $request['action'] ) {249 if ( 'manage-site' == $request['action'] || 'check-nonce' == $request['action'] ) { 254 250 return; 255 251 } 256 252 257 if ( ! isset( $this->options['authentications'][$request['user_id']] ) ) {253 if ( empty( $this->options['authentications'] ) || ! isset( $this->options['authentications'][$request['user_id']] ) ) { 258 254 $this->send_response( new WP_Error( 'user-not-authenticated', 'The requested user is not authenticated.' ) ); 259 255 } -
ithemes-sync/trunk/server.php
r2186328 r2244568 30 30 31 31 public static function authenticate( $username, $password ) { 32 require_once( $GLOBALS['ithemes_sync_path'] . '/functions.php' ); 33 32 34 $query = array( 33 35 'user' => $username, 34 36 ); 35 37 38 $nonce = Ithemes_Sync_Functions::generate_sync_nonce( 'auth-verification' ); 36 39 $data = array( 37 40 'auth_token' => self::get_password_hash( $username, $password ), 38 ); 39 41 'nonce' => $nonce['value'] 42 ); 43 40 44 return self::request( 'authenticate-user', $query, $data ); 41 45 } … … 237 241 remove_action( 'http_api_curl', array( __CLASS__, 'add_ca_patch_to_curl_opts' ) ); 238 242 } 243 239 244 }
Note: See TracChangeset
for help on using the changeset viewer.