Eadwine:
> I am working on my site and everything works like
> a charm, thanks for a great script! I have created
> a subfolder in the main one and I managed to also
> get these protected by changing the header and
> footer parts from
> include_once ("slogin_lib.inc.php"); include_once ("header.inc.php"); to
> include_once ("../slogin_lib.inc.php"); include_once ("../header.inc.php");
> Then found the userlogin errored for those pages and
> made the .txt file locations where the passes are
> stored have the ../ thing as well. All works fine...
Hi. Sorry for this late response.
The script was not really intended for big sites with lot of subdirectories, that's why you are having all these problems.
But don't worry, it can be fixed easily.
Open the slogin_lib.inc.php file and add the following code around line 50 (after the definition of the slogin_usehashes variable):
Code:
// Fix the paths.
if (!isset ($slogin_path)) {
$slogin_path = "";
}
$slogin_userstxt = $slogin_path . $slogin_userstxt;
$slogin_altuser = $slogin_path . $slogin_altuser;
And around line 64 substitute the definition of the constant SLOGIN_LOG_FILE with this:
Code:
define ("SLOGIN_LOG_FILE", $slogin_path . SLOGIN_LOG_PREFIX . fslogin_logprefix() . SLOGIN_LOG_SUFFIX . ".txt");
Now, in all your pages in the main directory, you must change the include_once lines with this:
Code:
$slogin_path = "./";
include_once ($slogin_path . "/slogin_lib.inc.php");
include_once ($slogin_path . "/header.inc.php");
and at the end:
Code:
include_once ($slogin_path . "footer.inc.php");
For the pages in subdirectories (subfolders) do the same, but use the slogin_path like this:
Code:
$slogin_path = "../";
If you have deeper directories, use this:
Code:
$slogin_path = "../../";
And so on.
That should fix all your problems and will let you use relative paths (not the /var/www/html...).
Let me know how it worked, Eadwine.
Regards,
Mario A. Valdez-Ramirez.