Plugin Directory

Changeset 535785


Ignore:
Timestamp:
04/24/2012 08:10:15 PM (14 years ago)
Author:
mustela
Message:

1.0.26

Location:
maven-member/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • maven-member/trunk/controllers/maven-member-import-class.php

    r524853 r535785  
    3232        $file = $this->get_post_var("file");
    3333        $roles = $this->get_post_var("roles");
    34 
     34       
     35        if($this->get_post_var("default_active")==1){
     36            $active = true;
     37        }else{
     38            $active = false;
     39        }
    3540        if ($file_url)
    3641            $file = $file_url;
     
    5964                    //$num = count($data);
    6065                    // This is because the first line is the hedar
    61                     if(is_array($data) && count($data)==3){
     66                    if(is_array($data) && (count($data)==3 || count($data)==5)){
    6267                        if ($row>1)
    6368                        {
     
    6671                            $lname = trim($data[0]);
    6772                            $email = trim($data[2]);
     73                           
     74                            if(count($data)==5){
     75                                $userid = trim($data[3]);
     76                                $password = trim($data[4]);
     77                            }else{
     78                                $userid = substr($fname, 0,1).$lname;
     79                                $password = $userid;
     80                            }
    6881                            //$userid = trim($data[3]);
    6982
     
    7184                            {
    7285
    73                                 $userid = substr($fname, 0,1).$lname;
    74 
    75                                 $password = $userid;
    76 
    7786                                // Add a new WP user
    7887                                $wp_user_id = $this->get_users_class()->add_user($userid,$password,$email);
    79     //                          while (isset($wp_user_id->errors))
    80     //                          {
    81     //                              $email = wp_generate_password()."@maven-member-import.org";
    82     //
    83     //                              // Add a new WP user
    84     //                              $wp_user_id = $this->get_users_class()->add_user($userid,$password,$email);
    85     //                          }
     88                               
    8689                                if ($wp_user_id && (!isset($wp_user_id->errors)))
    8790                                {
     
    9497                                    $user_info = $this->get_users_class()->update_user_info(array("ID"=>$wp_user_id,"first_name"=>$wp_user->first_name,"last_name"=>$wp_user->last_name));
    9598
    96                                     $this->get_users_class()->save_meta($wp_user_id,"enabled",false);
     99                                    $this->get_users_class()->save_meta($wp_user_id,"enabled",$active);
    97100
    98101                                    $this->get_users_class()->save_meta($wp_user_id,"import",true);
  • maven-member/trunk/files/example.csv

    r494835 r535785  
    1 Lastname|Firstname|Email
    2 Smith|Ralph|[email protected]
    3 Doyle|Rebecca|[email protected]
    4 Looper|Steve|[email protected]
     1Lastname|Firstname|Email|Username|Password
     2Smith|Ralph|[email protected]|user_name1|pass_1
     3Doyle|Rebecca|[email protected]|user_name2|123456
     4Looper|Steve|[email protected]|looper_steve|slooper
    55jonhson|Tracy|[email protected]
  • maven-member/trunk/js/admin/maven-member-import.js

    r524853 r535785  
    3232
    3333            role_ids = null;
     34           
     35            var active = jQuery("[name='default_active']:checked").val();
     36           
    3437            jQuery("[name='default-role[]']:checked").each(function(){
    3538
     
    4144            });
    4245
    43             mavenBase.post("import_import_users","roles="+role_ids+"&file="+path ,function(data){
     46            mavenBase.post("import_import_users","default_active="+active+"&roles="+role_ids+"&file="+path ,function(data){
    4447               
    4548                $("#waiting").hide();
  • maven-member/trunk/maven-member.php

    r532074 r535785  
    44Plugin URI: 
    55Description: This plugin gives you the ability to create roles to protect pages, and posts under categories. It also let you manage user registration, in a very easy way.
    6 Version:     1.0.25
     6Version:     1.0.26
    77Author:      Emiliano Jankowski,Guillermo Tenaschuk,Juan Pablo Baena
    88License:     
     
    1111define( 'WBM_MEMBER_PLUGIN_DIR',WP_PLUGIN_DIR."/".str_replace(basename( __FILE__),"",plugin_basename(__FILE__)) );
    1212define( 'WBM_MEMBER_PLUGIN_URL',plugins_url()."/".str_replace(basename( __FILE__),"",plugin_basename(__FILE__)) );
    13 define( 'WBM_MEMBER_VERSION',"1.0.25" );
     13define( 'WBM_MEMBER_VERSION',"1.0.26" );
    1414define( 'WBM_MEMBER_KEY',"wbm-maven-member" );
    1515
  • maven-member/trunk/readme.txt

    r532074 r535785  
    5252== Changelog ==
    5353
     54= 1.0.26 =
     55
     56* Import users:
     57    -Now is possible add username and password in the CSV user file. (check the example file)
     58    -Added "Default Active" to set the default status of the users imported.
     59* Fixed some minor issues
     60
    5461= 1.0.25 =
    5562
  • maven-member/trunk/views/admin/import-view.php

    r524853 r535785  
    2323                                            <tr>
    2424                                                <th scope="row">
    25                                                     <label for="new-category-name"><?php _e("Default roles"); ?></label>
     25                                                    <label for="new-category-name"><?php _e("Default Roles"); ?></label>
    2626                                                </th>
    2727                                                <td>
     
    3333                                                        <?php endforeach;?>
    3434                                                    </ul>
     35                                                </td>
     36                                            </tr>
     37                                            <tr>
     38                                                <th scope="row">
     39                                                    <label for="new-category-name"><?php _e("Default Active"); ?></label>
     40                                                </th>
     41                                                <td>
     42                                                    <input type="checkbox" id="default_active" name="default_active" value="1" checked='checked'>
    3543                                                </td>
    3644                                            </tr>
Note: See TracChangeset for help on using the changeset viewer.