Plugin Directory

Changeset 657031


Ignore:
Timestamp:
01/22/2013 06:52:01 PM (13 years ago)
Author:
tosend.it
Message:

New 0.7 version is available

Location:
aeiou
Files:
3 edited
5 copied

Legend:

Unmodified
Added
Removed
  • aeiou/tags/0.7/index.php

    r656980 r657031  
    55Description: 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.
    66Author: toSend.it di Luisa Marra
    7 Version: 0.6
     7Version: 0.7
    88Author URI: http://tosend.it
    99*/
     
    1111if(!class_exists('AEIOU')){
    1212    class AEIOU{
    13         const VERSION = '0.5';
     13        const VERSION = '0.7';
    1414        const LANG_DOMAIN = 'AEIOU';
    1515       
     
    111111                echo("\t\t</metadata>");
    112112            }
    113             if( class_exists('BuddyPress') ){
     113            #if( class_exists('BuddyPress') ){
    114114               
    115115                if(class_exists('BP_XProfile_Component') && $this->exportXProfile ){
     
    135135                                echo("<field group=\"$groupName\" name=\"{$field->name}\">");
    136136                                $value = serialize($value);
    137                                 #$value = base64_encode($value);
     137                                # Ver 0.7
     138                                $value = base64_encode($value);
    138139                                echo $value;
    139140                                echo("</field>");
     
    144145                   
    145146                }
    146             }
     147            #}
    147148           
    148149            do_action('aeiou_export_extra_data', $user);
     
    289290                    </p>
    290291                </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>
    306298                <?php do_action('aeiou_after_export_form'); ?>
    307299                <p>
     
    399391                       
    400392                        /*
    401                          * The behavior when a wordpress user is found
    402                          * it could be:
     393                         * The behavior when a wordpress user is found could be:
    403394                         * - skip
    404395                         * - replace
     
    485476                                         */
    486477                                        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                                       
    487485                                    }else{
    488486                                        _e("unchanged.", self::LANG_DOMAIN) . "\n";
     
    499497                                        $userID = wp_insert_user($user);
    500498                                       
    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                                         */
    502502                                        if(is_wp_error($userID)){
    503503                                           
     
    509509                                             * If password is defined in the XML file we should to import it
    510510                                             */
    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
    512516                                            $this->outputLog( sprintf(__("inserted with ID %d", self::LANG_DOMAIN),$userID) . "\n" );
    513517                                        }
     
    518522                                }
    519523                                if(!is_wp_error($userID)){
     524                                   
    520525                                    if($this->importMetadata && $userID != 0){
    521526                                        do_action('aeiou_before_import_metadata', $user);
     
    649654                    $data = new BP_XProfile_ProfileData();
    650655                    $data->field_id = $fieldId;
    651                     $data->user_id = $userID;
     656                    $data->user_id = $userID; 
    652657                    $data->value = maybe_unserialize($value);
    653658                    $data->save();
  • aeiou/tags/0.7/parsers.php

    r656366 r657031  
    7171                    $fieldArr = (array)$xField;
    7272                    $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                   
    7479                    $group = (string) $fieldArr['@attributes']['group'];
    7580                   
    76                     $xp[$name] = array( base64_decode( $value ), $group );
     81               
     82                    $xp[$name] = array( $value , $group );
    7783                   
    7884                }
     
    8389               
    8490                '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:''),
    8692                'user_nicename'         => (string) $user->user_nicename,
    8793                'user_email'            => (string) $user->user_email,
  • aeiou/tags/0.7/readme.txt

    r656976 r657031  
    55Requires at least: 3.4
    66Tested up to: 3.5
    7 Stable tag: 0.6
     7Stable tag: 0.7
    88License: GPLv2
    99
     
    1717the Buddypress XProfile data of each user.
    1818
    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 
    2319= Dependencies =
    2420
    2521AEIOU requires SimpleXML PHP library to import data.
    2622Nothing more than wordpress is required for the export.
    27 
    28 
    2923
    3024== Installation ==
     
    5347
    5448== 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
    5556
    5657= 0.6 (2013-01-22) =
  • aeiou/trunk/index.php

    r656980 r657031  
    55Description: 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.
    66Author: toSend.it di Luisa Marra
    7 Version: 0.6
     7Version: 0.7
    88Author URI: http://tosend.it
    99*/
     
    1111if(!class_exists('AEIOU')){
    1212    class AEIOU{
    13         const VERSION = '0.5';
     13        const VERSION = '0.7';
    1414        const LANG_DOMAIN = 'AEIOU';
    1515       
     
    111111                echo("\t\t</metadata>");
    112112            }
    113             if( class_exists('BuddyPress') ){
     113            #if( class_exists('BuddyPress') ){
    114114               
    115115                if(class_exists('BP_XProfile_Component') && $this->exportXProfile ){
     
    135135                                echo("<field group=\"$groupName\" name=\"{$field->name}\">");
    136136                                $value = serialize($value);
    137                                 #$value = base64_encode($value);
     137                                # Ver 0.7
     138                                $value = base64_encode($value);
    138139                                echo $value;
    139140                                echo("</field>");
     
    144145                   
    145146                }
    146             }
     147            #}
    147148           
    148149            do_action('aeiou_export_extra_data', $user);
     
    289290                    </p>
    290291                </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>
    306298                <?php do_action('aeiou_after_export_form'); ?>
    307299                <p>
     
    399391                       
    400392                        /*
    401                          * The behavior when a wordpress user is found
    402                          * it could be:
     393                         * The behavior when a wordpress user is found could be:
    403394                         * - skip
    404395                         * - replace
     
    485476                                         */
    486477                                        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                                       
    487485                                    }else{
    488486                                        _e("unchanged.", self::LANG_DOMAIN) . "\n";
     
    499497                                        $userID = wp_insert_user($user);
    500498                                       
    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                                         */
    502502                                        if(is_wp_error($userID)){
    503503                                           
     
    509509                                             * If password is defined in the XML file we should to import it
    510510                                             */
    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
    512516                                            $this->outputLog( sprintf(__("inserted with ID %d", self::LANG_DOMAIN),$userID) . "\n" );
    513517                                        }
     
    518522                                }
    519523                                if(!is_wp_error($userID)){
     524                                   
    520525                                    if($this->importMetadata && $userID != 0){
    521526                                        do_action('aeiou_before_import_metadata', $user);
     
    649654                    $data = new BP_XProfile_ProfileData();
    650655                    $data->field_id = $fieldId;
    651                     $data->user_id = $userID;
     656                    $data->user_id = $userID; 
    652657                    $data->value = maybe_unserialize($value);
    653658                    $data->save();
  • aeiou/trunk/parsers.php

    r656366 r657031  
    7171                    $fieldArr = (array)$xField;
    7272                    $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                   
    7479                    $group = (string) $fieldArr['@attributes']['group'];
    7580                   
    76                     $xp[$name] = array( base64_decode( $value ), $group );
     81               
     82                    $xp[$name] = array( $value , $group );
    7783                   
    7884                }
     
    8389               
    8490                '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:''),
    8692                'user_nicename'         => (string) $user->user_nicename,
    8793                'user_email'            => (string) $user->user_email,
  • aeiou/trunk/readme.txt

    r656976 r657031  
    55Requires at least: 3.4
    66Tested up to: 3.5
    7 Stable tag: 0.6
     7Stable tag: 0.7
    88License: GPLv2
    99
     
    1717the Buddypress XProfile data of each user.
    1818
    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 
    2319= Dependencies =
    2420
    2521AEIOU requires SimpleXML PHP library to import data.
    2622Nothing more than wordpress is required for the export.
    27 
    28 
    2923
    3024== Installation ==
     
    5347
    5448== 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
    5556
    5657= 0.6 (2013-01-22) =
Note: See TracChangeset for help on using the changeset viewer.