Cap migration.

git-svn-id: http://svn.automattic.com/wordpress/trunk@2712 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan
2005-07-15 01:24:08 +00:00
parent 27174a151b
commit 2f6ae330c0
5 changed files with 38 additions and 25 deletions

View File

@@ -176,8 +176,9 @@ default:
do_action('wp_authenticate', array(&$user_login, &$user_pass));
if ($user_login && $user_pass) {
$user = get_userdatabylogin($user_login);
if ( 0 == $user->user_level )
$user = new WP_User($user_login);
// If the user can't edit posts, send them to their profile.
if ( ! $user->has_cap('edit_posts') )
$redirect_to = get_settings('siteurl') . '/wp-admin/profile.php';
if ( wp_login($user_login, $user_pass, $using_cookie) ) {