More user fixups
git-svn-id: https://develop.svn.wordpress.org/trunk@2634 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
7f7c72cbe2
commit
8d1546d25f
@ -21,7 +21,7 @@ foreach ($menu as $item) {
|
||||
|
||||
?>
|
||||
<li class="last"><a href="<?php echo get_settings('siteurl')
|
||||
?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>"><?php printf(__('Logout (%s)'), $user_nickname) ?></a></li>
|
||||
?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>"><?php printf(__('Logout (%s)'), $user_identity) ?></a></li>
|
||||
</ul>
|
||||
|
||||
<?php
|
||||
|
@ -6,27 +6,22 @@
|
||||
|
||||
if ( !function_exists('get_currentuserinfo') ) :
|
||||
function get_currentuserinfo() {
|
||||
global $user_login, $userdata, $user_level, $user_ID, $user_nickname, $user_email, $user_url, $user_pass_md5, $user_identity;
|
||||
// *** retrieving user's data from cookies and db - no spoofing
|
||||
global $user_login, $userdata, $user_level, $user_ID, $user_id, $user_email, $user_url, $user_pass_md5, $user_identity;
|
||||
|
||||
if ( !isset($_COOKIE['wordpressuser_' . COOKIEHASH]))
|
||||
return false;
|
||||
|
||||
$user_login = $_COOKIE['wordpressuser_' . COOKIEHASH];
|
||||
$userdata = get_userdatabylogin($user_login);
|
||||
$user_level = $userdata->user_level;
|
||||
$user_ID = $userdata->ID;
|
||||
$user_id = $userdata->ID;
|
||||
$user_email = $userdata->user_email;
|
||||
$user_url = $userdata->user_url;
|
||||
|
||||
if (isset($_COOKIE['wordpressuser_' . COOKIEHASH]))
|
||||
$user_login = $_COOKIE['wordpressuser_' . COOKIEHASH];
|
||||
$userdata = get_userdatabylogin($user_login);
|
||||
$user_level = $userdata->user_level;
|
||||
$user_ID = $userdata->ID;
|
||||
$user_nickname = $userdata->user_nickname;
|
||||
$user_email = $userdata->user_email;
|
||||
$user_url = $userdata->user_url;
|
||||
$user_pass_md5 = md5($userdata->user_pass);
|
||||
|
||||
$idmode = $userdata->user_idmode;
|
||||
if ($idmode == 'nickname') $user_identity = $userdata->user_nickname;
|
||||
if ($idmode == 'login') $user_identity = $userdata->user_login;
|
||||
if ($idmode == 'firstname') $user_identity = $userdata->user_firstname;
|
||||
if ($idmode == 'lastname') $user_identity = $userdata->user_lastname;
|
||||
if ($idmode == 'namefl') $user_identity = $userdata->user_firstname.' '.$userdata->user_lastname;
|
||||
if ($idmode == 'namelf') $user_identity = $userdata->user_lastname.' '.$userdata->user_firstname;
|
||||
if (!$idmode) $user_identity = $userdata->user_nickname;
|
||||
$user_identity = $userdata->display_name;
|
||||
}
|
||||
endif;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user