Changeset 1329
- Timestamp:
- 09/05/08 06:15:01 (3 months ago)
- Files:
-
- wiki-post/trunk/wiki-post.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
wiki-post/trunk/wiki-post.php
r1328 r1329 74 74 global $wiki_post, $bbdb; 75 75 $user_id=$bbdb->get_var("SELECT ID FROM $bbdb->users WHERE user_login = '".$wiki_post['name']."' LIMIT 1"); 76 if (!$user_id) { 76 77 77 @require_once( BB_PATH . BB_INC . 'registration-functions.php'); 78 78 // if ( $user_id = bb_new_user( $wiki_post['name'], $email, bb_get_option('uri'), 0 ) ) { … … 81 81 82 82 $user_login = sanitize_user($wiki_post['name'], true ); 83 $user_nicename = $_user_nicename = bb_user_nicename_sanitize( $user_login ); 84 while ( is_numeric($user_nicename) || $existing_user = bb_get_user_by_nicename( $user_nicename ) ) 85 $user_nicename = bb_slug_increment($_user_nicename, $existing_user->user_nicename, 50); 83 $display_name = $user_login; 84 $user_nicename = bb_user_nicename_sanitize( $user_login ); 85 // while ( is_numeric($user_nicename) || $existing_user = bb_get_user_by_nicename( $user_nicename ) ) 86 // $user_nicename = bb_slug_increment($_user_nicename, $existing_user->user_nicename, 50); 86 87 87 88 $user_email=bb_get_option('from_email'); if (empty($user_email)) {$user_email=bb_get_option('admin_email');} 88 $user_url = bb_fix_link(bb_get_option('uri'));89 $user_url = ""; // bb_fix_link(bb_get_option('uri')); 89 90 $user_registered = bb_current_time('mysql'); 90 91 $password = wp_generate_password(); 91 92 $user_pass = wp_hash_password( $password ); 92 93 $user_status=0; 94 $compact=compact( 'user_login', 'user_pass', 'user_nicename', 'display_name', 'user_email', 'user_url', 'user_registered', 'user_status' ); 93 95 94 $bbdb->insert( $bbdb->users, 95 compact( 'user_login', 'user_pass', 'user_nicename', 'user_email', 'user_url', 'user_registered', 'user_status' ) 96 ); 97 $user_id = $bbdb->insert_id; 96 if (empty($user_id)) {@$bbdb->insert( $bbdb->users, $compact); $user_id = $bbdb->insert_id;} 97 else {@$bbdb->update( $bbdb->users, $compact, array( 'ID' => $user_id));} 98 98 99 99 bb_update_usermeta( $user_id, $bbdb->prefix . 'capabilities', array('throttle'=>true, 'member' => true) ); 100 100 bb_update_usermeta( $user_id, $bbdb->prefix . 'title', $wiki_post['name']); 101 } 101 102 102 return $user_id; 103 103 }
