diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-02-22 12:43:24 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-02-22 12:43:24 +0000 |
commit | 7abc9349efdb5eb465015d949be7c91d988eed51 (patch) | |
tree | f515f22e287ffade0785c5fc252d6870a7a753a9 /wp-inst | |
parent | 433d32693df5a6957c577fde7383c2d8174fc06e (diff) | |
download | wordpress-mu-7abc9349efdb5eb465015d949be7c91d988eed51.tar.gz wordpress-mu-7abc9349efdb5eb465015d949be7c91d988eed51.tar.xz wordpress-mu-7abc9349efdb5eb465015d949be7c91d988eed51.zip |
WP Merge
Fixed edit page link
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@533 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst')
-rw-r--r-- | wp-inst/wp-includes/pluggable-functions.php | 10 | ||||
-rw-r--r-- | wp-inst/wp-includes/template-functions-links.php | 16 | ||||
-rw-r--r-- | wp-inst/wp-login.php | 10 |
3 files changed, 26 insertions, 10 deletions
diff --git a/wp-inst/wp-includes/pluggable-functions.php b/wp-inst/wp-includes/pluggable-functions.php index e8c7b30..2643342 100644 --- a/wp-inst/wp-includes/pluggable-functions.php +++ b/wp-inst/wp-includes/pluggable-functions.php @@ -254,6 +254,16 @@ function wp_redirect($location) { } endif; +if ( !function_exists('wp_get_cookie_login') ): +function wp_get_cookie_login() { + if ( empty($_COOKIE[USER_COOKIE]) || empty($_COOKIE[PASS_COOKIE]) ) + return false; + + return array('login' => $_COOKIE[USER_COOKIE], 'password' => $_COOKIE[PASS_COOKIE]); +} + +endif; + if ( !function_exists('wp_setcookie') ) : function wp_setcookie($username, $password, $already_md5 = false, $home = '', $siteurl = '', $remember = false) { if ( !$already_md5 ) diff --git a/wp-inst/wp-includes/template-functions-links.php b/wp-inst/wp-includes/template-functions-links.php index 28262f3..b273f66 100644 --- a/wp-inst/wp-includes/template-functions-links.php +++ b/wp-inst/wp-includes/template-functions-links.php @@ -208,13 +208,19 @@ function get_feed_link($feed='rss2') { function edit_post_link($link = 'Edit This', $before = '', $after = '') { global $post; - if ( ! current_user_can('edit_post', $post->ID) ) - return; - if ( is_attachment() ) return; - else + + if( $post->post_type == 'page' ) { + if ( ! current_user_can('edit_page', $post->ID) ) + return; + $file = 'page'; + } else { + + if ( ! current_user_can('edit_post', $post->ID) ) + return; $file = 'post'; + } $location = get_settings('siteurl') . "/wp-admin/{$file}.php?action=edit&post=$post->ID"; echo $before . "<a href=\"$location\">$link</a>" . $after; @@ -226,7 +232,7 @@ function edit_comment_link($link = 'Edit This', $before = '', $after = '') { if ( ! current_user_can('edit_post', $post->ID) ) return; - $location = get_settings('siteurl') . "/wp-admin/post.php?action=editcomment&comment=$comment->comment_ID"; + $location = get_settings('siteurl') . "/wp-admin/comment.php?action=editcomment&comment=$comment->comment_ID"; echo $before . "<a href='$location'>$link</a>" . $after; } diff --git a/wp-inst/wp-login.php b/wp-inst/wp-login.php index f4a2fa4..be7522a 100644 --- a/wp-inst/wp-login.php +++ b/wp-inst/wp-login.php @@ -177,12 +177,12 @@ default: $user_login = sanitize_user( $user_login ); $user_pass = $_POST['pwd']; $rememberme = $_POST['rememberme']; - } elseif ( !empty($_COOKIE) ) { - if ( !empty($_COOKIE[USER_COOKIE]) ) - $user_login = $_COOKIE[USER_COOKIE]; - if ( !empty($_COOKIE[PASS_COOKIE]) ) { - $user_pass = $_COOKIE[PASS_COOKIE]; + } else { + $cookie_login = wp_get_cookie_login(); + if ( ! empty($cookie_login) ) { $using_cookie = true; + $user_login = $cookie_login['login']; + $user_pass = $cookie_login['password']; } } |