Changeset 3102
- Timestamp:
- 11/16/2005 02:54:23 AM (19 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/profile.php
r3063 r3102 7 7 include_once('admin-header.php'); 8 8 $profileuser = new WP_User($user_ID); 9 $profiledata = &$profileuser->data;10 9 11 10 $bookmarklet_height= 440; … … 29 28 <legend><?php _e('Name'); ?></legend> 30 29 <p><label><?php _e('Username: (no editing)'); ?><br /> 31 <input type="text" name="user_login" value="<?php echo $profile data->user_login; ?>" disabled="disabled" />30 <input type="text" name="user_login" value="<?php echo $profileuser->user_login; ?>" disabled="disabled" /> 32 31 </label></p> 33 32 34 33 <p><label><?php _e('First name:') ?><br /> 35 <input type="text" name="first_name" value="<?php echo $profile data->first_name ?>" /></label></p>34 <input type="text" name="first_name" value="<?php echo $profileuser->first_name ?>" /></label></p> 36 35 37 36 <p><label><?php _e('Last name:') ?><br /> 38 <input type="text" name="last_name" value="<?php echo $profile data->last_name ?>" /></label></p>37 <input type="text" name="last_name" value="<?php echo $profileuser->last_name ?>" /></label></p> 39 38 40 39 <p><label><?php _e('Nickname:') ?><br /> 41 <input type="text" name="nickname" value="<?php echo $profile data->nickname ?>" /></label></p>40 <input type="text" name="nickname" value="<?php echo $profileuser->nickname ?>" /></label></p> 42 41 43 42 </p><label><?php _e('Display name publicly as:') ?> <br /> 44 43 <select name="display_name"> 45 <option value="<?php echo $profile data->display_name; ?>"><?php echo $profiledata->display_name; ?></option>46 <option value="<?php echo $profile data->nickname ?>"><?php echo $profiledata->nickname ?></option>47 <option value="<?php echo $profile data->user_login ?>"><?php echo $profiledata->user_login ?></option>48 <?php if ( !empty( $profile data->first_name ) ) : ?>49 <option value="<?php echo $profile data->first_name ?>"><?php echo $profiledata->first_name ?></option>44 <option value="<?php echo $profileuser->display_name; ?>"><?php echo $profileuser->display_name; ?></option> 45 <option value="<?php echo $profileuser->nickname ?>"><?php echo $profileuser->nickname ?></option> 46 <option value="<?php echo $profileuser->user_login ?>"><?php echo $profileuser->user_login ?></option> 47 <?php if ( !empty( $profileuser->first_name ) ) : ?> 48 <option value="<?php echo $profileuser->first_name ?>"><?php echo $profileuser->first_name ?></option> 50 49 <?php endif; ?> 51 <?php if ( !empty( $profile data->last_name ) ) : ?>52 <option value="<?php echo $profile data->last_name ?>"><?php echo $profiledata->last_name ?></option>50 <?php if ( !empty( $profileuser->last_name ) ) : ?> 51 <option value="<?php echo $profileuser->last_name ?>"><?php echo $profileuser->last_name ?></option> 53 52 <?php endif; ?> 54 <?php if ( !empty( $profile data->first_name ) && !empty( $profiledata->last_name ) ) : ?>55 <option value="<?php echo $profile data->first_name." ".$profiledata->last_name ?>"><?php echo $profiledata->first_name." ".$profiledata->last_name ?></option>56 <option value="<?php echo $profile data->last_name." ".$profiledata->first_name ?>"><?php echo $profiledata->last_name." ".$profiledata->first_name ?></option>53 <?php if ( !empty( $profileuser->first_name ) && !empty( $profileuser->last_name ) ) : ?> 54 <option value="<?php echo $profileuser->first_name." ".$profileuser->last_name ?>"><?php echo $profileuser->first_name." ".$profileuser->last_name ?></option> 55 <option value="<?php echo $profileuser->last_name." ".$profileuser->first_name ?>"><?php echo $profileuser->last_name." ".$profileuser->first_name ?></option> 57 56 <?php endif; ?> 58 57 </select></label></p> … … 63 62 64 63 <p><label><?php _e('E-mail: (required)') ?><br /> 65 <input type="text" name="email" value="<?php echo $profile data->user_email ?>" /></label></p>64 <input type="text" name="email" value="<?php echo $profileuser->user_email ?>" /></label></p> 66 65 67 66 <p><label><?php _e('Website:') ?><br /> 68 <input type="text" name="url" value="<?php echo $profile data->user_url ?>" />67 <input type="text" name="url" value="<?php echo $profileuser->user_url ?>" /> 69 68 </label></p> 70 69 71 70 <p><label><?php _e('AIM:') ?><br /> 72 <input type="text" name="aim" value="<?php echo $profile data->aim ?>" />71 <input type="text" name="aim" value="<?php echo $profileuser->aim ?>" /> 73 72 </label></p> 74 73 75 74 <p><label><?php _e('Yahoo IM:') ?><br /> 76 <input type="text" name="yim" value="<?php echo $profile data->yim ?>" />75 <input type="text" name="yim" value="<?php echo $profileuser->yim ?>" /> 77 76 </label></p> 78 77 79 78 <p><label><?php _e('Jabber / Google Talk:') ?> 80 <input type="text" name="jabber" value="<?php echo $profile data->jabber ?>" /></label>79 <input type="text" name="jabber" value="<?php echo $profileuser->jabber ?>" /></label> 81 80 </p> 82 81 </fieldset> … … 85 84 <legend><?php _e('About yourself'); ?></legend> 86 85 <p class="desc"><?php _e('Share a little biographical information to fill out your profile. This may be shown publicly.'); ?></p> 87 <p><textarea name="description" rows="5" cols="30"><?php echo $profile data->description ?></textarea></p>86 <p><textarea name="description" rows="5" cols="30"><?php echo $profileuser->description ?></textarea></p> 88 87 </fieldset> 89 88 -
trunk/wp-admin/user-edit.php
r2995 r3102 49 49 50 50 $profileuser = new WP_User($user_id); 51 $profiledata = $profileuser->data;52 51 53 52 if (!current_user_can('edit_users')) $errors['head'] = __('You do not have permission to edit this user.'); … … 81 80 <legend><?php _e('Name'); ?></legend> 82 81 <p><label><?php _e('Username: (no editing)'); ?><br /> 83 <input type="text" name="user_login" value="<?php echo $profile data->user_login; ?>" disabled="disabled" />82 <input type="text" name="user_login" value="<?php echo $profileuser->user_login; ?>" disabled="disabled" /> 84 83 </label></p> 85 84 … … 96 95 97 96 <p><label><?php _e('First name:') ?><br /> 98 <input type="text" name="first_name" value="<?php echo $profile data->first_name ?>" /></label></p>97 <input type="text" name="first_name" value="<?php echo $profileuser->first_name ?>" /></label></p> 99 98 100 99 <p><label><?php _e('Last name:') ?><br /> 101 <input type="text" name="last_name" value="<?php echo $profile data->last_name ?>" /></label></p>100 <input type="text" name="last_name" value="<?php echo $profileuser->last_name ?>" /></label></p> 102 101 103 102 <p><label><?php _e('Nickname:') ?><br /> 104 <input type="text" name="nickname" value="<?php echo $profile data->nickname ?>" /></label></p>103 <input type="text" name="nickname" value="<?php echo $profileuser->nickname ?>" /></label></p> 105 104 106 105 </p><label><?php _e('Display name publicly as:') ?> <br /> 107 106 <select name="display_name"> 108 <option value="<?php echo $profile data->display_name; ?>"><?php echo $profiledata->display_name; ?></option>109 <option value="<?php echo $profile data->nickname ?>"><?php echo $profiledata->nickname ?></option>110 <option value="<?php echo $profile data->user_login ?>"><?php echo $profiledata->user_login ?></option>111 <?php if ( !empty( $profile data->first_name ) ) : ?>112 <option value="<?php echo $profile data->first_name ?>"><?php echo $profiledata->first_name ?></option>113 <?php endif; ?> 114 <?php if ( !empty( $profile data->last_name ) ) : ?>115 <option value="<?php echo $profile data->last_name ?>"><?php echo $profiledata->last_name ?></option>116 <?php endif; ?> 117 <?php if ( !empty( $profile data->first_name ) && !empty( $profiledata->last_name ) ) : ?>118 <option value="<?php echo $profile data->first_name." ".$profiledata->last_name ?>"><?php echo $profiledata->first_name." ".$profiledata->last_name ?></option>119 <option value="<?php echo $profile data->last_name." ".$profiledata->first_name ?>"><?php echo $profiledata->last_name." ".$profiledata->first_name ?></option>107 <option value="<?php echo $profileuser->display_name; ?>"><?php echo $profileuser->display_name; ?></option> 108 <option value="<?php echo $profileuser->nickname ?>"><?php echo $profileuser->nickname ?></option> 109 <option value="<?php echo $profileuser->user_login ?>"><?php echo $profileuser->user_login ?></option> 110 <?php if ( !empty( $profileuser->first_name ) ) : ?> 111 <option value="<?php echo $profileuser->first_name ?>"><?php echo $profileuser->first_name ?></option> 112 <?php endif; ?> 113 <?php if ( !empty( $profileuser->last_name ) ) : ?> 114 <option value="<?php echo $profileuser->last_name ?>"><?php echo $profileuser->last_name ?></option> 115 <?php endif; ?> 116 <?php if ( !empty( $profileuser->first_name ) && !empty( $profileuser->last_name ) ) : ?> 117 <option value="<?php echo $profileuser->first_name." ".$profileuser->last_name ?>"><?php echo $profileuser->first_name." ".$profileuser->last_name ?></option> 118 <option value="<?php echo $profileuser->last_name." ".$profileuser->first_name ?>"><?php echo $profileuser->last_name." ".$profileuser->first_name ?></option> 120 119 <?php endif; ?> 121 120 </select></label></p> … … 126 125 127 126 <p><label><?php _e('E-mail: (required)') ?><br /> 128 <input type="text" name="email" value="<?php echo $profile data->user_email ?>" /></label></p>127 <input type="text" name="email" value="<?php echo $profileuser->user_email ?>" /></label></p> 129 128 130 129 <p><label><?php _e('Website:') ?><br /> 131 <input type="text" name="url" value="<?php echo $profile data->user_url ?>" />130 <input type="text" name="url" value="<?php echo $profileuser->user_url ?>" /> 132 131 </label></p> 133 132 134 133 <p><label><?php _e('AIM:') ?><br /> 135 <input type="text" name="aim" value="<?php echo $profile data->aim ?>" />134 <input type="text" name="aim" value="<?php echo $profileuser->aim ?>" /> 136 135 </label></p> 137 136 138 137 <p><label><?php _e('Yahoo IM:') ?><br /> 139 <input type="text" name="yim" value="<?php echo $profile data->yim ?>" />138 <input type="text" name="yim" value="<?php echo $profileuser->yim ?>" /> 140 139 </label></p> 141 140 142 141 <p><label><?php _e('Jabber / Google Talk:') ?> 143 <input type="text" name="jabber" value="<?php echo $profile data->jabber ?>" /></label>142 <input type="text" name="jabber" value="<?php echo $profileuser->jabber ?>" /></label> 144 143 </p> 145 144 </fieldset> … … 148 147 <legend><?php _e('About the user'); ?></legend> 149 148 <p class="desc"><?php _e('Share a little biographical information to fill out your profile. This may be shown publicly.'); ?></p> 150 <p><textarea name="description" rows="5" cols="30"><?php echo $profile data->description ?></textarea></p>149 <p><textarea name="description" rows="5" cols="30"><?php echo $profileuser->description ?></textarea></p> 151 150 </fieldset> 152 151 -
trunk/wp-admin/users.php
r3061 r3102 96 96 $user = new WP_User($id); 97 97 if ($id == $current_user->id) { 98 echo "<li>" . sprintf('ID #%1s: %2s <strong>The current user will not be deleted.</strong>', $id, $user-> data->user_login) . "</li>\n";98 echo "<li>" . sprintf('ID #%1s: %2s <strong>The current user will not be deleted.</strong>', $id, $user->user_login) . "</li>\n"; 99 99 } else { 100 echo "<li><input type=\"hidden\" name=\"users[]\" value=\"{$id}\" />" . sprintf('ID #%1s: %2s', $id, $user-> data->user_login) . "</li>\n";100 echo "<li><input type=\"hidden\" name=\"users[]\" value=\"{$id}\" />" . sprintf('ID #%1s: %2s', $id, $user->user_login) . "</li>\n"; 101 101 $go_delete = true; 102 102 } … … 151 151 $roles = $tmp_user->roles; 152 152 $role = $roles[0]; 153 $roleclasses[$role][$tmp_user-> data->user_login] = $tmp_user;153 $roleclasses[$role][$tmp_user->user_login] = $tmp_user; 154 154 } 155 155 … … 226 226 $style = ''; 227 227 foreach ($roleclass as $user_object) { 228 $user_data = &$user_object->data; 229 $email = $user_data->user_email; 230 $url = $user_data->user_url; 228 $email = $user_object->user_email; 229 $url = $user_object->user_url; 231 230 $short_url = str_replace('http://', '', $url); 232 231 $short_url = str_replace('www.', '', $short_url); … … 236 235 $short_url = substr($short_url, 0, 32).'...'; 237 236 $style = ('class="alternate"' == $style) ? '' : 'class="alternate"'; 238 $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = '$user_ data->ID' and post_status = 'publish'");239 if (0 < $numposts) $numposts = "<a href='edit.php?author=$user_ data->ID' title='" . __('View posts') . "'>$numposts</a>";237 $numposts = $wpdb->get_var("SELECT COUNT(*) FROM $wpdb->posts WHERE post_author = '$user_object->ID' and post_status = 'publish'"); 238 if (0 < $numposts) $numposts = "<a href='edit.php?author=$user_object->ID' title='" . __('View posts') . "'>$numposts</a>"; 240 239 echo " 241 240 <tr $style> 242 <td><input type='checkbox' name='users[]' id='user_{$user_ data->ID}' value='{$user_data->ID}' /> <label for='user_{$user_data->ID}'>{$user_data->ID}</label></td>243 <td><label for='user_{$user_ data->ID}'><strong>$user_data->user_login</strong></label></td>244 <td><label for='user_{$user_ data->ID}'>$user_data->first_name $user_data->last_name</label></td>241 <td><input type='checkbox' name='users[]' id='user_{$user_object->ID}' value='{$user_object->ID}' /> <label for='user_{$user_object->ID}'>{$user_object->ID}</label></td> 242 <td><label for='user_{$user_object->ID}'><strong>$user_object->user_login</strong></label></td> 243 <td><label for='user_{$user_object->ID}'>$user_object->first_name $user_object->last_name</label></td> 245 244 <td><a href='mailto:$email' title='" . sprintf(__('e-mail: %s'), $email) . "'>$email</a></td> 246 245 <td><a href='$url' title='website: $url'>$short_url</a></td>"; … … 248 247 echo '<td>'; 249 248 if (current_user_can('edit_users')) 250 echo "<a href='user-edit.php?user_id=$user_ data->ID' class='edit'>".__('Edit')."</a>";249 echo "<a href='user-edit.php?user_id=$user_object->ID' class='edit'>".__('Edit')."</a>"; 251 250 echo '</td>'; 252 251 echo '</tr>'; -
trunk/wp-includes/capabilities.php
r2904 r3102 124 124 return; 125 125 126 $this->id = $this->data->ID; 126 foreach (get_object_vars($this->data) as $key => $value) { 127 $this->{$key} = $value; 128 } 129 130 $this->id = $this->ID; 127 131 $this->cap_key = $table_prefix . 'capabilities'; 128 $this->caps = &$this-> data->{$this->cap_key};132 $this->caps = &$this->{$this->cap_key}; 129 133 if ( ! is_array($this->caps) ) 130 134 $this->caps = array(); … … 183 187 function update_user_level_from_caps() { 184 188 global $table_prefix; 185 $this-> data->user_level = array_reduce(array_keys($this->allcaps), array(&$this, 'level_reduction'), 0);186 update_usermeta($this->id, $table_prefix.'user_level', $this-> data->user_level);189 $this->user_level = array_reduce(array_keys($this->allcaps), array(&$this, 'level_reduction'), 0); 190 update_usermeta($this->id, $table_prefix.'user_level', $this->user_level); 187 191 } 188 192 -
trunk/wp-includes/functions.php
r3092 r3102 300 300 function get_user_option( $option ) { 301 301 global $wpdb, $current_user; 302 if ( isset( $current_user-> data->{$wpdb->prefix . $option} ) ) // Blog specific303 return $current_user-> data->{$wpdb->prefix . $option};304 elseif ( isset( $current_user-> data->{$option} ) ) // User specific and cross-blog305 return $current_user-> data->{$option};302 if ( isset( $current_user->{$wpdb->prefix . $option} ) ) // Blog specific 303 return $current_user->{$wpdb->prefix . $option}; 304 elseif ( isset( $current_user->{$option} ) ) // User specific and cross-blog 305 return $current_user->{$option}; 306 306 else // Blog global 307 307 return get_option( $option ); -
trunk/wp-includes/pluggable-functions.php
r3060 r3102 366 366 $stars .= '*'; 367 367 368 $user_login = stripslashes($user-> data->user_login);369 $user_email = stripslashes($user-> data->user_email);368 $user_login = stripslashes($user->user_login); 369 $user_email = stripslashes($user->user_email); 370 370 371 371 $message = sprintf(__('New user registration on your blog %s:'), get_settings('blogname')) . "\r\n\r\n";
Note: See TracChangeset
for help on using the changeset viewer.