Changeset 581
- Timestamp:
- Apr 19, 2010, 2:46:47 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/xpressme_integration_kit/wp-content/plugins/xpressme/include/user_sync_xoops.php
r578 r581 128 128 * WP User ID exists is checked.. 129 129 */ 130 function set_user_role($uid=0,$new_user = false){ 131 $roles = get_xoops_group_role($uid); 130 function set_user_role($uid=0,$roles,$new_user = false){ 132 131 133 132 foreach($roles as $role){ … … 211 210 $wp_user_id = get_wp_user_id($xoops_user->uname) ; 212 211 212 $roles = get_xoops_group_role($xoops_user->uid); 213 213 214 214 $has_role = has_group_role($xoops_user->uid); … … 236 236 $is_update = false; 237 237 238 if ($wp_user_id){ 239 $ add_user = true;238 if ($wp_user_id){ 239 $new_user = false; 240 240 $wu_sql = "UPDATE $db_xpress_users "; 241 241 $wu_sql .= 'SET '; … … 250 250 $xoops_db->query($wu_sql); 251 251 252 $message .= set_user_role($wp_user_id,$ add_user);252 $message .= set_user_role($wp_user_id,$roles,$new_user); 253 253 254 254 if (!check_user_meta_prefix($wp_user_id)){ … … 258 258 $is_update = true; 259 259 }else{ 260 $ add_user = false;260 $new_user = true; 261 261 if (is_used_wp_user_id($xoops_user->uid) ) { // WP User ID has already been used. 262 262 $wu_sql = "INSERT INTO $db_xpress_users "; … … 278 278 $wp_user_id = $xoops_user->uid; 279 279 } 280 $message .= set_user_role($wp_user_id,$ add_user);280 $message .= set_user_role($wp_user_id,$roles,$new_user); 281 281 } 282 282
Note: See TracChangeset
for help on using the changeset viewer.