Installation of the Simple Text-File Login script (SiTeFiLo).


These are the installation directions to follow to setup the SiTeFiLo in your site. Select the kind of installation you want to make:

Installation (existing website).

Integration with your existing website.

1) Convert to PHP.
If you already have a web site with HTML pages, you need to convert them to PHP files. You only need to change the .htm or .html extension to .php. If everything is setup correctly in your server, your pages should load normally.

2) Get the files.
Get the files from http://www.mariovaldez.net/software/sitefilo/ (There are zip and tar.gz files available).

3) Unpack.
Extract the files your website directory or unpack in your local drive and upload the files to your webserver. (Be careful of not overwriting any of your files).

4) Create a common header and footer (optional).
If your pages have a common look at the beginning and at the end, you can save lot of editing the next time you want to change (for example) the navigation of your site by moving that HTML code to the header.inc.php and footer.inc.php files. Those files will be included in all your .php files automatically if you want to. (Those files are provided with a minimal of code, if you won't use this feature, don't delete the files nor its content).

5) Integrate the authentication.
Use the provided index.php file as a guide about how to integrate the authentication script. At the beginning of your .php files, add the following code (if you want to leverage the common header and footer):

<?php
session_start();
$slogin_noauthpage = 0;
$slogin_pagetitle = "";
include_once ("slogin_lib.inc.php");
include_once ("header.inc.php");
?>

If you won't use the common footer and header, use this code:

<?php
session_start();
$slogin_noauthpage = 0;
$slogin_pagetitle = "";
include_once ("slogin_lib.inc.php");
?>

And at the ending of your .php files add the following code only if you want to use the common header and footer:

<?php include_once ("footer.inc.php"); ?>

There are five variables that can be changed per-page:

6) Customize the login form (optional).
You can change the way the login form will look by editing the slogin.inc.php file. The file is mostly HTML, just take care of not deleting the PHP variables included.

7) Configure.
Edit the slogin_lib.inc.php file to configure your authentication.

8) Rename the users file.
Change the name of the slogin_users.txt file to the name you configured in the slogin_userstxt variable. (This is not necessary if you are using the alternate php user file).

9) Add your users to the users file.
Open the slogin_users.txt file and start adding your users with the following format:

username, password
username, password
username, password

If you are using the alternate php user file, then open slogin_users.php and start adding your users with the following format (watch the incrementing index number!):

$slogin_user[1]="testuser";
$slogin_pass[1]="testpass";
$slogin_user[2]="mario.valdez";
$slogin_pass[2]="qwerty";
$slogin_user[3]="admin";
$slogin_pass[3]="admin";

(We recommend that you use only alphanumeric characters and don't use more than 100 users).

If you are have enabled the use of hashed (encrypted passwords), the password stored in the user file should be the MD5 hash. For example, the MD5 hash of the word admin (which is the default password of the user admin) is 21232f297a57a5a743894a0e4a801fc3. To generate your own MD5 hashes you can use slogin_genpass.php script, just enter the password in plain text, then copy the result to the user password file. (When finishing the installation, you can generate your own MD5 hashes from the administration script).

10) You are done.
Test your site. Also check the adminlog.php script from where you can see all logins by date. (The adminlog.php script can only be viewed by the user named admin).

Installation (new website).

Creating a new website.

1) Get the files.
Get the files from http://www.mariovaldez.net/software/sitefilo/ (There are zip and tar.gz files available).

2) Unpack.
Extract the files your website directory or unpack in your local drive and upload the files to your webserver.

3) Create a common header and footer.
If your pages have a coomon look at the beginning and at the end, you can save lot of editing the next time you want to change (for example) the navigation of your site by moving that HTML code to the header.inc.php and footer.inc.php files. Those files will be included in all your .php files automatically if you want to. (Those files are provided with a minimal of code).

4) Create the pages.
Use the provided index.php file to create all your pages. Just copy the index.php file with other name and start writing your HTML code where it says:

<p>Here goes your content.</p>

There are five variables that can be changed per-page:

5) Customize the login form (optional).
You can change the way the login form will look by editing the slogin.inc.php file. The file is mostly HTML, just take care of not deleting the PHP variables included.

6) Configure.
Edit the slogin_lib.inc.php file to configure your authentication.

7) Rename the users file.
Change the name of the slogin_users.txt file to the name you configured in the slogin_userstxt variable. (This is not necessary if you are using the alternate php user file).

8) Add your users to the users file.
Open the slogin_users.txt file and start adding your users with the following format:

username, password
username, password
username, password

If you are using the alternate php user file, then open slogin_users.php and start adding your users with the following format (watch the incrementing index number!):

$slogin_user[1]="testuser";
$slogin_pass[1]="testpass";
$slogin_user[2]="mario.valdez";
$slogin_pass[2]="qwerty";
$slogin_user[3]="admin";
$slogin_pass[3]="admin";

(We recommend that you use only alphanumeric characters and don't use more than 100 users).

If you are have enabled the use of hashed (encrypted passwords), the password stored in the user file should be the MD5 hash. For example, the MD5 hash of the word admin (which is the default password of the user admin) is 21232f297a57a5a743894a0e4a801fc3. To generate your own MD5 hashes you can use slogin_genpass.php script, just enter the password in plain text, then copy the result to the user password file. (When finishing the installation, you can generate your own MD5 hashes from the administration script).

9) You are done.
Test your site. Also check the adminlog.php script from where you can see all logins by date. (The adminlog.php script can only be viewed by the user named admin).

Upgrading.

Upgrading from an older version.

NOTE: the support for the optional variable slogin_path has been removed as it may cause a security vulnerability if you don't set the variable in your pages AND the server has the PHP option register_globals enabled AND the PHP option allow_url_include is enabled.

1) Get the files.
Get the files from http://www.mariovaldez.net/software/sitefilo/ (There are zip and tar.gz files available).

2) Unpack.
Extract the files your website directory or unpack in your local drive. Only upload the following files to your webserver: adminlog.php, slogin_lib.inc.php and (optionally) slogin_genpass.php.

3) Configure.
Edit the slogin_lib.inc.php file to configure your authentication.

4) You are done.
Test your site. Also check the adminlog.php script from where you can see all logins by date. (The adminlog.php script can only be viewed by the user named admin).

 
 
NA fum/lmd: 2017.03.06
Copyright ©1994-2024 by Mario A. Valdez-Ramírez.
no siga este enlace / do not follow this link