modify site header

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
KingMo
Posts: 4
Joined: Sat May 10, 2025 10:23 am

modify site header

Post by KingMo »

Script URL:
Version of script: 3.5.3


Write your message below:
Hello
I success make user authentication and store user info in session (On all pages except admin pages)
I wand to know How can i add or modify site header to add a new user profile after login (whice will contain user name and sign out link) ?

I tried to add this code to header.txt

Code: Select all

<nav>
    <!-- Other nav content -->
    <?php if (isset($_SESSION['user'])): ?>
        <div class="user-profile" style="float: right;">
            Hello, <strong><?php echo htmlspecialchars($_SESSION['user']); ?></strong>
           <a href="logout.php">Sign Out</a>
        </div>
    <?php else: ?>
        <a href="login.php">Login</a>
    <?php endif; ?>
    </nav>

but it appear in top upper the side header as here :

Image

can help to understand how to make this nav in same site nav ?

thanks
Klemen
Site Admin
Posts: 10139
Joined: Fri Feb 11, 2005 4:04 pm

Re: modify site header

Post by Klemen »

Whatever you add to the header.txt will be displayed before any of the Hesk HTML.

Modify the /theme/hesk3/customer files to add it elsewhere.

P.s.: Hesk 3.5.x has user accounts built-in
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
KingMo
Posts: 4
Joined: Sat May 10, 2025 10:23 am

Re: modify site header

Post by KingMo »

Hello Klemen
Thanks for replay

in another hand , i have another issue

after i success create custom session for login user with Ldap
i found that the user unable to submit tickets in row !!

when i use debug mode , i found this message

Code: Select all

Warning
: session_name(): Session name cannot be changed when a session is active in
E:\xampp\htdocs\HR\inc\common.inc.php
on line
2603


Warning
: session_set_cookie_params(): Session cookie parameters cannot be changed when a session is active in
E:\xampp\htdocs\HR\inc\common.inc.php
on line
2619


Warning
: session_cache_limiter(): Session cache limiter cannot be changed when a session is active in
E:\xampp\htdocs\HR\inc\common.inc.php
on line
2622
so the question , how can use the custom session and user able to submit many tickets in row

thanks in advance
Klemen
Site Admin
Posts: 10139
Joined: Fri Feb 11, 2005 4:04 pm

Re: modify site header

Post by Klemen »

This is because your custom session code is causing issues with the Hesk session code.

Such customizations are out of the scope of our support, but you can study how Hesk creates sessions by looking at hesk_session_start and related functions in /inc/common.inc.php (and maybe use those functions in your modifications instead of the basic PHP session functions).
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
KingMo
Posts: 4
Joined: Sat May 10, 2025 10:23 am

Re: modify site header

Post by KingMo »

Ok , thanks
Post Reply