Changeset 535785
- Timestamp:
- 04/24/2012 08:10:15 PM (14 years ago)
- Location:
- maven-member/trunk
- Files:
-
- 6 edited
-
controllers/maven-member-import-class.php (modified) (5 diffs)
-
files/example.csv (modified) (1 diff)
-
js/admin/maven-member-import.js (modified) (2 diffs)
-
maven-member.php (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
-
views/admin/import-view.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
maven-member/trunk/controllers/maven-member-import-class.php
r524853 r535785 32 32 $file = $this->get_post_var("file"); 33 33 $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 } 35 40 if ($file_url) 36 41 $file = $file_url; … … 59 64 //$num = count($data); 60 65 // 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)){ 62 67 if ($row>1) 63 68 { … … 66 71 $lname = trim($data[0]); 67 72 $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 } 68 81 //$userid = trim($data[3]); 69 82 … … 71 84 { 72 85 73 $userid = substr($fname, 0,1).$lname;74 75 $password = $userid;76 77 86 // Add a new WP user 78 87 $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 86 89 if ($wp_user_id && (!isset($wp_user_id->errors))) 87 90 { … … 94 97 $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)); 95 98 96 $this->get_users_class()->save_meta($wp_user_id,"enabled", false);99 $this->get_users_class()->save_meta($wp_user_id,"enabled",$active); 97 100 98 101 $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] 1 Lastname|Firstname|Email|Username|Password 2 Smith|Ralph|[email protected]|user_name1|pass_1 3 Doyle|Rebecca|[email protected]|user_name2|123456 4 Looper|Steve|[email protected]|looper_steve|slooper 5 5 jonhson|Tracy|[email protected] -
maven-member/trunk/js/admin/maven-member-import.js
r524853 r535785 32 32 33 33 role_ids = null; 34 35 var active = jQuery("[name='default_active']:checked").val(); 36 34 37 jQuery("[name='default-role[]']:checked").each(function(){ 35 38 … … 41 44 }); 42 45 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){ 44 47 45 48 $("#waiting").hide(); -
maven-member/trunk/maven-member.php
r532074 r535785 4 4 Plugin URI: 5 5 Description: 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.2 56 Version: 1.0.26 7 7 Author: Emiliano Jankowski,Guillermo Tenaschuk,Juan Pablo Baena 8 8 License: … … 11 11 define( 'WBM_MEMBER_PLUGIN_DIR',WP_PLUGIN_DIR."/".str_replace(basename( __FILE__),"",plugin_basename(__FILE__)) ); 12 12 define( 'WBM_MEMBER_PLUGIN_URL',plugins_url()."/".str_replace(basename( __FILE__),"",plugin_basename(__FILE__)) ); 13 define( 'WBM_MEMBER_VERSION',"1.0.2 5" );13 define( 'WBM_MEMBER_VERSION',"1.0.26" ); 14 14 define( 'WBM_MEMBER_KEY',"wbm-maven-member" ); 15 15 -
maven-member/trunk/readme.txt
r532074 r535785 52 52 == Changelog == 53 53 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 54 61 = 1.0.25 = 55 62 -
maven-member/trunk/views/admin/import-view.php
r524853 r535785 23 23 <tr> 24 24 <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> 26 26 </th> 27 27 <td> … … 33 33 <?php endforeach;?> 34 34 </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'> 35 43 </td> 36 44 </tr>
Note: See TracChangeset
for help on using the changeset viewer.