Page 1 of 1
After staff login can their name be viewed for their login
Posted: Sun Aug 14, 2016 10:19 am
by TechGuy29
Script URL: local
Version of script: 2.6.8
Hosting company: local
URL of phpinfo.php: local
URL of session_test.php: local
What terms did you try when SEARCHING for a solution: Did a search for any related topic, relating to my HESK question...
Write your message below:
Firstly let me say great work here Klemen, well done.
Still working my way through things, reading, researching etc...
Anyway, my question is, after a staff member logs in. There name does not displayed. Can i see this feature in future updates, or with your help can i attempt inserting the code myself?

Re: After staff login can their name be viewed for their login
Posted: Sun Aug 14, 2016 2:06 pm
by Klemen
Where exactly do you want the name to be shown?
If you are familiar with PHP/HTML, the variable that holds the current user's name is $_SESSION['name']
Re: After staff login can their name be viewed for their login
Posted: Sun Aug 14, 2016 2:26 pm
by alcazar
Isnt this already possible with option "Show online users (x min)" and permission to see online users?
Thanks.
Re: After staff login can their name be viewed for their login
Posted: Mon Aug 15, 2016 12:59 pm
by TechGuy29
It would be nice to see the user which just logged on far right inside or above the green banner.
Just started learning PHP, i know a little HTML...
@ Alcazar:
That is not quite what i would like staff users to have, that refers to amount of online staff users at a given time i think...
If i click the "?" it says the following
"Online Users
If checked HESK will show a list of users online in the last X minutes at the bottom of the help desk (in staff interface only)."
So that is not quite what i mean Alcazar...
Thanks for pointing that out though, i will however enable the feature...

Re: After staff login can their name be viewed for their login
Posted: Mon Oct 10, 2016 1:46 pm
by Treblig
My header.php (might be header.txt in original HESK but I changed many things) goes something like this :
Code: Select all
<?php
echo '
<div style="width: 60%; margin-left: auto; margin-right: auto;">
<a href="' . HESK_PATH . 'login.php">
<img src="' . HESK_PATH . 'img/logo.png" width="204" height="43" alt="logo" /></a>
<a href="'. HESK_PATH . 'logout.php">
<img style="float:right;" src="' . HESK_PATH . 'img/logoff.png" width="43" height="43" alt="' . $hesklang['logout'] . '" /></a>
<a href="'. HESK_PATH . 'knowledgebase.php">
<img style="float:right;" src="' . HESK_PATH . 'img/logo_faq.png" width="43" height="43" alt="' . $hesklang['kb_text'] . '" /></a>';
if(isset($_COOKIE['hesk_admin'])) {
if ($_COOKIE['hesk_admin'] == '1') echo '<a href="' . HESK_PATH . 'admin/">';}
if (isset($_COOKIE['hesk_username'])) {
echo '<span style="font-weight: bold; height: 43px; color: blue; line-height: 43px; text-align: center; float: right;">';
echo 'Hello ' . $_COOKIE['hesk_username'];
echo '</span>';
}
if(isset($_COOKIE['hesk_admin'])) {
if ($_COOKIE['hesk_admin'] == '1') echo '</a>';}
echo '
</div>
<div style="clear:both"></div>
<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div>';
This gives me the login id (among other things) in the right hand corner of the header.
Can't say it will work for you as is since I made many changes to HESK, in particular a mandatory login for all users so I may have set some cookies that didn't exist before.