Jump to content

Login status outside WHMCS install


Recommended Posts

Dear all,

 

I know there had been a couple of threads with this same issue around here and studied them all very well, but I cannot find a resolution to the following problem:

 

1. I installed WHMCS in a directory called 'customers'.

 

2. I included a php file in the header.tpl with the following code:

 

<?php

require("init.php");

if ($_SESSION['uid']) {

echo "Welkom, {$clientsdetails[firstname]} | <a href=\"logout.php\">Uitloggen</a>";

}

else

{

echo "Inloggen | <a href=\"register.php\">Registreer</a>";

}

?>

 

So far so good... the username is correctly showing up when needed. Now the bad part... :(

 

3. I tried to use this same code in the root of the server in index.php. That is one step outside the installation directory of WHMCS (and yes, I changed require("init.php"); to require("customers/init.php");. But that (what a suprise) isn't going to work.

 

The things I already tried:

 

1. To add the line require("customers/dbconnect.php"); but this gives me a "Security Warning. The install folder needs to be deleted for security reasons before using WHMCS".

 

2. To add the line require("customers/includes/functions.php"); but nothing new.

 

3. Some other combinations I read about in previous threads about this subject.

 

3. To manually connect to the database and retreive the session information to display the correct things.

 

Personally I think the last option is the one I need to get it up and running. Although the first one with somekind of workaround will do the job also.

 

I hope this is clear enough, as you notice I am not a specialist in these kind of things.

 

Thanks in advance! :)

Justin

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated