
Originally Posted by
kuroi
Your suggestion that it would be helpful to show the identity of the currently logged in user is a good one, but not strictly about Admin Profiles. However, as it is clearly relevant to users of AP, what the hell, let's take a look.
When a user logs in a session variable is created containing his or her admin_ID. When they logoff, this variable is unset. So the easy and correct way to do what you ask, would be simply to create and unset a session variable containing the user's admin_name. Then we could simply display it anywhere we wanted. Yes. NOOOOO.
Unfortunately, due to the admin_ID registers_global BUG identified by Duncanad, this approach would show who logged on, but not who Admin thinks the current user is, due to its tendancy under some circumstances to just change user. Ouch.
A solution that showed who it actually thought the current user was would therefore highlight this unfortunate tendancy ... Let's do it anyway.
Go to the bottom of admin/includes/headers.php. Find the line that reads
<td class="headerBarContent" align="center"><b><?php echo date("r", time()) . 'GMT' . '[' . $_SERVER['REMOTE_ADDR'] . ' ]'; ?></b></td>
change "center" to "left" then insert the following line immediately afterwards
<td class="headerBarContent" align="center"><b><?php $result=$db->Execute("select admin_name from ".TABLE_ADMIN." where admin_id=".$_SESSION['admin_id']); echo $result->fields['admin_name']; ?></b></td>
Upload the file to your server and enjoy.