Changeset 3677 for trunk/wp-admin/users.php
- Timestamp:
- 04/02/2006 12:31:26 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/users.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/users.php
r3541 r3677 80 80 81 81 if ( !current_user_can('edit_users') ) 82 $error ['edit_users'] = __('You can’t delete users.');82 $error = new WP_Error('edit_users', __('You can’t delete users.')); 83 83 84 84 $userids = $_POST['users']; … … 134 134 check_admin_referer(); 135 135 136 $errors = add_user(); 137 138 if(count($errors) == 0) { 136 $user_id = add_user(); 137 if ( is_wp_error( $user_id ) ) 138 $errors = $user_id; 139 else { 139 140 header('Location: users.php?update=add'); 140 141 die(); … … 142 143 143 144 default: 145 146 $list_js = true; 147 $users_js = true; 144 148 145 149 include ('admin-header.php'); … … 188 192 } 189 193 endif; 190 if ( is set($errors) ) : ?>194 if ( is_wp_error( $errors ) ) : ?> 191 195 <div class="error"> 192 196 <ul> 193 197 <?php 194 foreach($errors as $error) echo "<li>$error</li>"; 198 foreach( $errors->get_error_codes() as $code) 199 foreach( $errors->get_error_messages($code) as $message ) 200 echo "<li>$message</li>"; 195 201 ?> 196 202 </ul> … … 210 216 211 217 <tr> 212 <th colspan="8" align="left"> 213 <h3><?php echo $wp_roles->role_names[$role]; ?></h3> 214 </th></tr> 215 218 <th colspan="8" align="left"><h3><?php echo $wp_roles->role_names[$role]; ?></h3></th> 219 </tr> 216 220 <tr> 217 <th><?php _e('ID') ?></th>218 <th><?php _e('Username') ?></th>219 <th><?php _e('Name') ?></th>220 <th><?php _e('E-mail') ?></th>221 <th><?php _e('Website') ?></th>222 <th><?php _e('Posts') ?></th>223 <th> </th>221 <th><?php _e('ID') ?></th> 222 <th><?php _e('Username') ?></th> 223 <th><?php _e('Name') ?></th> 224 <th><?php _e('E-mail') ?></th> 225 <th><?php _e('Website') ?></th> 226 <th><?php _e('Posts') ?></th> 227 <th> </th> 224 228 </tr> 225 < ?php229 <tbody id="role-<?php echo $role; ?>"><?php 226 230 $style = ''; 227 231 foreach ($roleclass as $user_object) { 228 $email = $user_object->user_email; 229 $url = $user_object->user_url; 230 $short_url = str_replace('http://', '', $url); 231 $short_url = str_replace('www.', '', $short_url); 232 if ('/' == substr($short_url, -1)) 233 $short_url = substr($short_url, 0, -1); 234 if (strlen($short_url) > 35) 235 $short_url = substr($short_url, 0, 32).'...'; 236 $style = ('class="alternate"' == $style) ? '' : 'class="alternate"'; 237 $numposts = get_usernumposts($user_object->ID); 238 if (0 < $numposts) $numposts = "<a href='edit.php?author=$user_object->ID' title='" . __('View posts') . "'>$numposts</a>"; 239 echo " 240 <tr $style> 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> 244 <td><a href='mailto:$email' title='" . sprintf(__('e-mail: %s'), $email) . "'>$email</a></td> 245 <td><a href='$url' title='website: $url'>$short_url</a></td>"; 246 echo "<td align='right'>$numposts</td>"; 247 echo '<td>'; 248 if (current_user_can('edit_users')) 249 echo "<a href='user-edit.php?user_id=$user_object->ID' class='edit'>".__('Edit')."</a>"; 250 echo '</td>'; 251 echo '</tr>'; 232 $style = (' class="alternate"' == $style) ? '' : ' class="alternate"'; 233 echo "\n\t" . user_row( $user_object, $style ); 252 234 } 253 235 254 236 ?> 255 237 256 238 </tbody> 257 239 <?php 258 240 } … … 262 244 263 245 <h2><?php _e('Update Users'); ?></h2> 264 <?php265 $role_select = '<select name="new_role">';266 foreach($wp_roles->role_names as $role => $name) {267 $role_select .= "<option value=\"{$role}\">{$name}</option>";268 }269 $role_select .= '</select>';270 ?>271 246 <ul style="list-style:none;"> 272 247 <li><input type="radio" name="action" id="action0" value="delete" /> <label for="action0"><?php _e('Delete checked users.'); ?></label></li> 273 <li><input type="radio" name="action" id="action1" value="promote" /> <?php echo '<label for="action1">'.__('Set the Role of checked users to:')."</label> $role_select"; ?></li> 248 <li> 249 <input type="radio" name="action" id="action1" value="promote" /> <label for="action1"><?php _e('Set the Role of checked users to:'); ?></label> 250 <select name="new_role"><?php wp_dropdown_roles(); ?></select> 251 </li> 274 252 </ul> 275 253 <p class="submit"><input type="submit" value="<?php _e('Update »'); ?>" /></p> … … 314 292 </tr> 315 293 <?php endif; ?> 294 <tr> 295 <th scope="row"><?php _e('Role'); ?></th> 296 <td><select name="role" id="role"><?php wp_dropdown_roles( get_settings('default_role') ); ?></select></td> 297 </tr> 316 298 </table> 317 299 <p class="submit"> 318 <input name="adduser" type="submit" id="adduser " value="<?php _e('Add User »') ?>" />300 <input name="adduser" type="submit" id="addusersub" value="<?php _e('Add User »') ?>" /> 319 301 </p> 320 302 </form> 303 <div id="ajax-response"></div> 321 304 </div> 322 305 <?php
Note: See TracChangeset
for help on using the changeset viewer.