[wp-cvs] wordpress/wp-admin edit-form-advanced.php, 1.41, 1.42 edit-page-form.php, 1.9, 1.10 post.php, 1.108, 1.109

Matthew Mullenweg saxmatt at users.sourceforge.net
Thu Nov 18 19:40:38 UTC 2004


Update of /cvsroot/cafelog/wordpress/wp-admin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22267/wp-admin

Modified Files:
	edit-form-advanced.php edit-page-form.php post.php 
Log Message:
Allow users 9+ to post as other users, minor advanced post reorg.

Index: edit-page-form.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/edit-page-form.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** edit-page-form.php	16 Nov 2004 19:29:51 -0000	1.9
--- edit-page-form.php	18 Nov 2004 19:40:35 -0000	1.10
***************
*** 83,97 ****
  <fieldset id="pageoptions">
  	 <legend><?php _e('Page Options') ?></legend> 
!    <table width="100%" cellspacing="2" cellpadding="5" class="editform">
! 	 <tr valign="top">
! 	 <th scope="row"><?php _e('Page Template:') ?></th>
!    <td><div><select name="page_template">
! 	 <option value='default'><?php _e('Default Template'); ?></option>
! 	 <?php page_template_dropdown($page_template); ?>
! 	 </select>
! 	 </div>
! 	 </td>
! 	 </tr>
! 	 </table>
  </fieldset>
  
--- 83,97 ----
  <fieldset id="pageoptions">
  	 <legend><?php _e('Page Options') ?></legend> 
! <table width="100%" cellspacing="2" cellpadding="5" class="editform">
! 	<tr valign="top">
! 		<th scope="row" width="30%"><?php _e('Page Template:') ?></th>
! 		<td><div><select name="page_template">
! 		<option value='default'><?php _e('Default Template'); ?></option>
! 		<?php page_template_dropdown($page_template); ?>
! 		</select>
! 		</div>
! 		</td>
! 	</tr>
! </table>
  </fieldset>
  

Index: post.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/post.php,v
retrieving revision 1.108
retrieving revision 1.109
diff -C2 -d -r1.108 -r1.109
*** post.php	16 Nov 2004 19:29:51 -0000	1.108
--- post.php	18 Nov 2004 19:40:35 -0000	1.109
***************
*** 191,194 ****
--- 191,195 ----
  	$post_name = $postdata->post_name;
  	$post_parent = $postdata->post_parent;
+ 	$post_author = $postdata->post_author;
  
  	if ($post_status == 'static') {
***************
*** 223,229 ****
  	$post_ID = $_POST['post_ID'];
  
! 	if (!user_can_edit_post($user_ID, $post_ID, $blog_ID)) {
  		die('You are not allowed to edit this post.');
! 	}
  	$post_categories = $_POST['post_category'];
  	if (!$post_categories) $post_categories[] = 1;
--- 224,230 ----
  	$post_ID = $_POST['post_ID'];
  
! 	if (!user_can_edit_post($user_ID, $post_ID, $blog_ID))
  		die('You are not allowed to edit this post.');
! 
  	$post_categories = $_POST['post_category'];
  	if (!$post_categories) $post_categories[] = 1;
***************
*** 235,238 ****
--- 236,243 ----
  	$prev_status = $_POST['prev_status'];
  	$post_status = $_POST['post_status'];
+ 	$post_author = (int) $_POST['post_author'];
+ 	if ( !user_can_edit_user($user_ID, $post_author) )
+ 		die( __('You cannot post as this user.') );
+ 
  	$comment_status = $_POST['comment_status'];
  	if (empty($comment_status)) $comment_status = 'closed';
***************
*** 314,317 ****
--- 319,323 ----
  			comment_status = '$comment_status',
  			ping_status = '$ping_status',
+ 			post_author = '$post_author',
  			post_password = '$post_password',
  			post_name = '$post_name',

Index: edit-form-advanced.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-admin/edit-form-advanced.php,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** edit-form-advanced.php	18 Oct 2004 12:09:18 -0000	1.41
--- edit-form-advanced.php	18 Nov 2004 19:40:35 -0000	1.42
***************
*** 21,26 ****
  $form_prevstatus = '<input type="hidden" name="prev_status" value="'.$post_status.'" />';
  
! $form_trackback = '<p><label for="trackback"><a href="http://wordpress.org/docs/reference/post/#trackback" title="' . __('Help on trackbacks') . '">' . __('<strong>TrackBack</strong> a <abbr title="Universal Resource Identifier">URI</abbr></a>') . '</label> ' . __('(Separate multiple <abbr title="Universal Resource Identifier">URI</abbr>s with spaces.)') . '<br />
! <input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. str_replace("\n", ' ', $to_ping) .'" /></p>';
  if ('' != $pinged) {
  	$pings .= '<p>'. __('Already pinged:') . '</p><ul>';
--- 21,26 ----
  $form_prevstatus = '<input type="hidden" name="prev_status" value="'.$post_status.'" />';
  
! $form_trackback = '<input type="text" name="trackback_url" style="width: 415px" id="trackback" tabindex="7" value="'. str_replace("\n", ' ', $to_ping) .'" />';
! 
  if ('' != $pinged) {
  	$pings .= '<p>'. __('Already pinged:') . '</p><ul>';
***************
*** 84,91 ****
  </div>
  </fieldset>
- <fieldset id="slugdiv">
- <legend><?php _e('Post Slug') ?></legend>
- <div><input name="post_name" type="text" size="17" id="post_name" value="<?php echo $post_name ?>" /></div>
- </fieldset>
      <fieldset id="postpassworddiv">
        <legend><a href="http://wordpress.org/docs/reference/post/#post_password" title="<?php _e('Help on post password') ?>"><?php _e('Post Password') ?></a></legend> 
--- 84,87 ----
***************
*** 119,123 ****
  <?php echo $form_pingback ?>
  <?php echo $form_prevstatus ?>
! <?php echo $form_trackback; ?>
  
  <p class="submit"><?php echo $saveasdraft; ?> <input type="submit" name="submit" value="<?php _e('Save') ?>" style="font-weight: bold;" tabindex="6" /> 
--- 115,119 ----
  <?php echo $form_pingback ?>
  <?php echo $form_prevstatus ?>
! 
  
  <p class="submit"><?php echo $saveasdraft; ?> <input type="submit" name="submit" value="<?php _e('Save') ?>" style="font-weight: bold;" tabindex="6" /> 
***************
*** 133,149 ****
  	<input name="referredby" type="hidden" id="referredby" value="<?php echo htmlspecialchars($_SERVER['HTTP_REFERER']); ?>" />
  </p>
- <?php
- if ('' != $pinged) {
- 	echo $pings;
- }
  
! // if the level is 5+, allow user to edit the timestamp - not on 'new post' screen though
! // if (($user_level > 4) && ($action != "post"))
! if ($user_level > 4) {
! 	touch_time(($action == 'edit'));
! }
! ?>
  <fieldset id="postcustom">
  <legend><?php _e('Custom Fields') ?></legend>
  <?php 
  if($metadata = has_meta($post_ID)) {
--- 129,184 ----
  	<input name="referredby" type="hidden" id="referredby" value="<?php echo htmlspecialchars($_SERVER['HTTP_REFERER']); ?>" />
  </p>
  
! <?php do_action('edit_form_advanced', ''); ?>
! </div>
! 
! </div>
! 
! <div class="wrap">
! <h2><?php _e('Advanced'); ?></h2>
! 
! <table width="100%" cellspacing="2" cellpadding="5" class="editform">
! 	<tr>
! 		<th scope="row" valign="top"><?php _e('Send trackbacks to'); ?>:</th>
! 		<td><?php echo $form_trackback; ?> <br />
! 		<?php _e('Separate multiple URIs with spaces'); ?></td>
! 	</tr>
! 	<tr valign="top">
! 		<th scope="row" width="25%"><?php _e('Post slug') ?>:</th>
! 		<td><input name="post_name" type="text" size="25" id="post_name" value="<?php echo $post_name ?>" /></td>
! 	</tr>
! <?php if ($user_level > 7 && $users = $wpdb->get_results("SELECT ID, user_login, user_firstname, user_lastname FROM $wpdb->users WHERE user_level <= $user_level") ) : ?>
! 	<tr>
! 		<th scope="row"><?php _e('Post author'); ?>:</th>
! 		<td>
! 		<select name="post_author" id="post_author">
! 		<?php 
! 		foreach ($users as $o) :
! 			if ( $post_author == $o->ID ) $selected = 'selected="selected"';
! 			else $selected = '';
! 			echo "<option value='$o->ID' $selected>$o->user_login ($o->user_firstname $o->user_lastname)</option>";
! 		endforeach;
! 		?>
! 		</select>
! 		</td>
! 	</tr>
! <?php endif; ?>
! <?php if ($user_level > 4) : ?>
! 	<tr>
! 		<th scope="row"><?php _e('Edit time'); ?>:</th>
! 		<td><?php touch_time(($action == 'edit')); ?></td>
! 	</tr>
! <?php endif; ?>
! 	<tr>
! 		<th scope="row"><?php _e('Delete'); ?>:</th>
! 		<td><?php if ('edit' == $action) : ?>
! 		<input name="deletepost" class="delete" type="submit" id="deletepost" tabindex="10" value="<?php _e('Delete this post') ?>" <?php echo "onclick=\"return confirm('" . sprintf(__("You are about to delete this post \'%s\'\\n  \'Cancel\' to stop, \'OK\' to delete."), addslashes($edited_post_title) ) . "')\""; ?> />
! <?php endif; ?></td>
! 	</tr>
! </table>
! 
  <fieldset id="postcustom">
  <legend><?php _e('Custom Fields') ?></legend>
+ <div id="postcustomstuff">
  <?php 
  if($metadata = has_meta($post_ID)) {
***************
*** 156,165 ****
  	meta_form();
  ?>
- </fieldset>
- <?php do_action('edit_form_advanced', ''); ?>
  </div>
! </form>
! <?php if ('edit' == $action) echo "
! <p><a class='delete' href='post.php?action=delete&amp;post=$post_ID' onclick=\"return confirm('" . sprintf(__("You are about to delete this post \'%s\'\\n  \'Cancel\' to stop, \'OK\' to delete."), addslashes($edited_post_title)) . "')\">" .  __('Delete this post') . "</a></p>";
  ?>
  </div>
--- 191,201 ----
  	meta_form();
  ?>
  </div>
! </fieldset>
! <?php 
! if ('' != $pinged)
! 	echo $pings;
  ?>
  </div>
+ 
+ </form>
\ No newline at end of file




More information about the cvs mailing list