Changeset 657031
- Timestamp:
- 01/22/2013 06:52:01 PM (13 years ago)
- Location:
- aeiou
- Files:
-
- 3 edited
- 5 copied
-
tags/0.7 (copied) (copied from aeiou/trunk)
-
tags/0.7/index.php (copied) (copied from aeiou/trunk/index.php) (12 diffs)
-
tags/0.7/languages (copied) (copied from aeiou/trunk/languages)
-
tags/0.7/parsers.php (copied) (copied from aeiou/trunk/parsers.php) (2 diffs)
-
tags/0.7/readme.txt (copied) (copied from aeiou/trunk/readme.txt) (3 diffs)
-
trunk/index.php (modified) (12 diffs)
-
trunk/parsers.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
aeiou/tags/0.7/index.php
r656980 r657031 5 5 Description: AEIOU is a powerfull plugin that export all wordpress users info into an XML file including user metadatas and allow to import the same xml file into a new wordpress keeping the metadata of each user. The plugin is able to export buddypress xprofile data too. 6 6 Author: toSend.it di Luisa Marra 7 Version: 0. 67 Version: 0.7 8 8 Author URI: http://tosend.it 9 9 */ … … 11 11 if(!class_exists('AEIOU')){ 12 12 class AEIOU{ 13 const VERSION = '0. 5';13 const VERSION = '0.7'; 14 14 const LANG_DOMAIN = 'AEIOU'; 15 15 … … 111 111 echo("\t\t</metadata>"); 112 112 } 113 if( class_exists('BuddyPress') ){113 #if( class_exists('BuddyPress') ){ 114 114 115 115 if(class_exists('BP_XProfile_Component') && $this->exportXProfile ){ … … 135 135 echo("<field group=\"$groupName\" name=\"{$field->name}\">"); 136 136 $value = serialize($value); 137 #$value = base64_encode($value); 137 # Ver 0.7 138 $value = base64_encode($value); 138 139 echo $value; 139 140 echo("</field>"); … … 144 145 145 146 } 146 }147 #} 147 148 148 149 do_action('aeiou_export_extra_data', $user); … … 289 290 </p> 290 291 </div> 291 <?php 292 if(class_exists('BP_XProfile_Component')){ 293 /* 294 * New in 0.2 version (export Buddy Press XPorfile Data) 295 */ 296 ?> 297 <div> 298 <p> 299 <input type="checkbox" name="xprofile" id="aeiou_xprofile" /> 300 <label for="aeiou_xprofile"><?php _e('Include the BuddyPress Extended Profile data too', self::LANG_DOMAIN) ?></label> 301 </p> 302 </div> 303 <?php 304 } 305 ?> 292 <div> 293 <p> 294 <input type="checkbox" name="xprofile" id="aeiou_xprofile" /> 295 <label for="aeiou_xprofile"><?php _e('Include the BuddyPress Extended Profile data too', self::LANG_DOMAIN) ?></label> 296 </p> 297 </div> 306 298 <?php do_action('aeiou_after_export_form'); ?> 307 299 <p> … … 399 391 400 392 /* 401 * The behavior when a wordpress user is found 402 * it could be: 393 * The behavior when a wordpress user is found could be: 403 394 * - skip 404 395 * - replace … … 485 476 */ 486 477 wp_update_user($user); 478 global $wpdb; 479 480 if(isset($usr['user_pass'])) 481 $wpdb->query( 482 $wpdb->prepare("update {$wpdb->prefix}_users set user_pass='%s' where ID=%d", $user['user_pass'], $user['ID']) 483 ); 484 487 485 }else{ 488 486 _e("unchanged.", self::LANG_DOMAIN) . "\n"; … … 499 497 $userID = wp_insert_user($user); 500 498 501 # TODO: Gestire il caso in cui non è riusito ad inserire l'utente 499 /* 500 * If i was unable to import the user I will give the error message to the admin. 501 */ 502 502 if(is_wp_error($userID)){ 503 503 … … 509 509 * If password is defined in the XML file we should to import it 510 510 */ 511 wp_update_user($user); 511 if(isset($usr['user_pass'])) 512 $wpdb->query( 513 $wpdb->prepare("update {$wpdb->prefix}_users set user_pass='%s' where ID=%d", $user['user_pass'], $user['ID']) 514 ); 515 512 516 $this->outputLog( sprintf(__("inserted with ID %d", self::LANG_DOMAIN),$userID) . "\n" ); 513 517 } … … 518 522 } 519 523 if(!is_wp_error($userID)){ 524 520 525 if($this->importMetadata && $userID != 0){ 521 526 do_action('aeiou_before_import_metadata', $user); … … 649 654 $data = new BP_XProfile_ProfileData(); 650 655 $data->field_id = $fieldId; 651 $data->user_id = $userID; 656 $data->user_id = $userID; 652 657 $data->value = maybe_unserialize($value); 653 658 $data->save(); -
aeiou/tags/0.7/parsers.php
r656366 r657031 71 71 $fieldArr = (array)$xField; 72 72 $name = (string) $fieldArr['@attributes']['name']; 73 $value = (string) $xField; 73 74 if(version_compare($aeiou_version, '0.7')==-1) 75 $value = (string) $xField; 76 else 77 $value = (string) base64_decode($xField); 78 74 79 $group = (string) $fieldArr['@attributes']['group']; 75 80 76 $xp[$name] = array( base64_decode( $value ), $group ); 81 82 $xp[$name] = array( $value , $group ); 77 83 78 84 } … … 83 89 84 90 'user_login' => (string) $user->user_login, 85 'user_pass' => (string) isset($user->user_pass)?$user->user_pass:'',91 'user_pass' => (string) (isset($user->user_pass)?$user->user_pass:''), 86 92 'user_nicename' => (string) $user->user_nicename, 87 93 'user_email' => (string) $user->user_email, -
aeiou/tags/0.7/readme.txt
r656976 r657031 5 5 Requires at least: 3.4 6 6 Tested up to: 3.5 7 Stable tag: 0. 67 Stable tag: 0.7 8 8 License: GPLv2 9 9 … … 17 17 the Buddypress XProfile data of each user. 18 18 19 = Known Issues =20 21 It seems that in some circumstances the password were stored in the new database in a wrong way. We are investigating on that.22 23 19 = Dependencies = 24 20 25 21 AEIOU requires SimpleXML PHP library to import data. 26 22 Nothing more than wordpress is required for the export. 27 28 29 23 30 24 == Installation == … … 53 47 54 48 == Changelog == 49 50 = 0.7 (2013-01-22) = 51 52 * **New:** Xprofile bugfix granted for backcompatibility 53 * **Update:** XML file Version updated to 0.7 54 * **Bugfix:** Xprofile data was wrongly decode from base64 55 * **Bugfix:** Now the password is imported as is 55 56 56 57 = 0.6 (2013-01-22) = -
aeiou/trunk/index.php
r656980 r657031 5 5 Description: AEIOU is a powerfull plugin that export all wordpress users info into an XML file including user metadatas and allow to import the same xml file into a new wordpress keeping the metadata of each user. The plugin is able to export buddypress xprofile data too. 6 6 Author: toSend.it di Luisa Marra 7 Version: 0. 67 Version: 0.7 8 8 Author URI: http://tosend.it 9 9 */ … … 11 11 if(!class_exists('AEIOU')){ 12 12 class AEIOU{ 13 const VERSION = '0. 5';13 const VERSION = '0.7'; 14 14 const LANG_DOMAIN = 'AEIOU'; 15 15 … … 111 111 echo("\t\t</metadata>"); 112 112 } 113 if( class_exists('BuddyPress') ){113 #if( class_exists('BuddyPress') ){ 114 114 115 115 if(class_exists('BP_XProfile_Component') && $this->exportXProfile ){ … … 135 135 echo("<field group=\"$groupName\" name=\"{$field->name}\">"); 136 136 $value = serialize($value); 137 #$value = base64_encode($value); 137 # Ver 0.7 138 $value = base64_encode($value); 138 139 echo $value; 139 140 echo("</field>"); … … 144 145 145 146 } 146 }147 #} 147 148 148 149 do_action('aeiou_export_extra_data', $user); … … 289 290 </p> 290 291 </div> 291 <?php 292 if(class_exists('BP_XProfile_Component')){ 293 /* 294 * New in 0.2 version (export Buddy Press XPorfile Data) 295 */ 296 ?> 297 <div> 298 <p> 299 <input type="checkbox" name="xprofile" id="aeiou_xprofile" /> 300 <label for="aeiou_xprofile"><?php _e('Include the BuddyPress Extended Profile data too', self::LANG_DOMAIN) ?></label> 301 </p> 302 </div> 303 <?php 304 } 305 ?> 292 <div> 293 <p> 294 <input type="checkbox" name="xprofile" id="aeiou_xprofile" /> 295 <label for="aeiou_xprofile"><?php _e('Include the BuddyPress Extended Profile data too', self::LANG_DOMAIN) ?></label> 296 </p> 297 </div> 306 298 <?php do_action('aeiou_after_export_form'); ?> 307 299 <p> … … 399 391 400 392 /* 401 * The behavior when a wordpress user is found 402 * it could be: 393 * The behavior when a wordpress user is found could be: 403 394 * - skip 404 395 * - replace … … 485 476 */ 486 477 wp_update_user($user); 478 global $wpdb; 479 480 if(isset($usr['user_pass'])) 481 $wpdb->query( 482 $wpdb->prepare("update {$wpdb->prefix}_users set user_pass='%s' where ID=%d", $user['user_pass'], $user['ID']) 483 ); 484 487 485 }else{ 488 486 _e("unchanged.", self::LANG_DOMAIN) . "\n"; … … 499 497 $userID = wp_insert_user($user); 500 498 501 # TODO: Gestire il caso in cui non è riusito ad inserire l'utente 499 /* 500 * If i was unable to import the user I will give the error message to the admin. 501 */ 502 502 if(is_wp_error($userID)){ 503 503 … … 509 509 * If password is defined in the XML file we should to import it 510 510 */ 511 wp_update_user($user); 511 if(isset($usr['user_pass'])) 512 $wpdb->query( 513 $wpdb->prepare("update {$wpdb->prefix}_users set user_pass='%s' where ID=%d", $user['user_pass'], $user['ID']) 514 ); 515 512 516 $this->outputLog( sprintf(__("inserted with ID %d", self::LANG_DOMAIN),$userID) . "\n" ); 513 517 } … … 518 522 } 519 523 if(!is_wp_error($userID)){ 524 520 525 if($this->importMetadata && $userID != 0){ 521 526 do_action('aeiou_before_import_metadata', $user); … … 649 654 $data = new BP_XProfile_ProfileData(); 650 655 $data->field_id = $fieldId; 651 $data->user_id = $userID; 656 $data->user_id = $userID; 652 657 $data->value = maybe_unserialize($value); 653 658 $data->save(); -
aeiou/trunk/parsers.php
r656366 r657031 71 71 $fieldArr = (array)$xField; 72 72 $name = (string) $fieldArr['@attributes']['name']; 73 $value = (string) $xField; 73 74 if(version_compare($aeiou_version, '0.7')==-1) 75 $value = (string) $xField; 76 else 77 $value = (string) base64_decode($xField); 78 74 79 $group = (string) $fieldArr['@attributes']['group']; 75 80 76 $xp[$name] = array( base64_decode( $value ), $group ); 81 82 $xp[$name] = array( $value , $group ); 77 83 78 84 } … … 83 89 84 90 'user_login' => (string) $user->user_login, 85 'user_pass' => (string) isset($user->user_pass)?$user->user_pass:'',91 'user_pass' => (string) (isset($user->user_pass)?$user->user_pass:''), 86 92 'user_nicename' => (string) $user->user_nicename, 87 93 'user_email' => (string) $user->user_email, -
aeiou/trunk/readme.txt
r656976 r657031 5 5 Requires at least: 3.4 6 6 Tested up to: 3.5 7 Stable tag: 0. 67 Stable tag: 0.7 8 8 License: GPLv2 9 9 … … 17 17 the Buddypress XProfile data of each user. 18 18 19 = Known Issues =20 21 It seems that in some circumstances the password were stored in the new database in a wrong way. We are investigating on that.22 23 19 = Dependencies = 24 20 25 21 AEIOU requires SimpleXML PHP library to import data. 26 22 Nothing more than wordpress is required for the export. 27 28 29 23 30 24 == Installation == … … 53 47 54 48 == Changelog == 49 50 = 0.7 (2013-01-22) = 51 52 * **New:** Xprofile bugfix granted for backcompatibility 53 * **Update:** XML file Version updated to 0.7 54 * **Bugfix:** Xprofile data was wrongly decode from base64 55 * **Bugfix:** Now the password is imported as is 55 56 56 57 = 0.6 (2013-01-22) =
Note: See TracChangeset
for help on using the changeset viewer.