Page 1 of 1

[SOLVED] Username in admin header?!?!

Posted: Fri Jan 18, 2008 9:56 am
by jmansa
I'm trying to alter the admin outlook a little bit by showing in admin header the logged in username, but can't seem to figure out how to get the record. Can somebody please help.

I have done this in my DefaultTheme.php around line 89:

Code: Select all

		global $gCms; $config =& $gCms->GetConfig();
		
		$thisuser->username = $user;
		
		$whouser = lang('usertop');
		$domain = lang('domain');
		$user = $thisuser->username;
		
		echo '<table width="100%" height="50px" border="0" cellspacing="0" cellpadding="0" bgcolor="#990000">
  				<tr>
    				<td style="padding-left:10px;color:#FFFFFF;"><div align="left">'.$domain.'<b>'.$config['sitename'].'</b><br>'.$whouser.''.$user.'</div></td>
    				<td><div align="right"><p class="logocontainer"><img src="themes/default/images/logo.png"></p></div></td>
  				</tr>
			 </table>';
But it doesnt get the current username... How do I go about that?

Re: Username in admin header?!?!

Posted: Tue Jan 22, 2008 8:59 am
by jmansa
I'm still looking for a solution... Any ideas anyone?

Re: Username in admin header?!?!

Posted: Tue Jan 22, 2008 3:13 pm
by calguy1000
Try this:

Code: Select all

global $gCms;
$userops =& $gCms->GetUserOperations();

$user = $userops->LoadUserById(get_userid());
echo "username = ".$user->username."<br/>";

Re: Username in admin header?!?!

Posted: Wed Jan 23, 2008 7:31 pm
by jmansa
Thanks alot... That did the job!  ;)