-----BEGIN PGP SIGNED MESSAGE-----


Simple Text-File Login script (SiTeFiLo).
Copyright 2004 by Mario A. Valdez-Ramirez
(mario@mariovaldez.org). 
(Read the license.txt file for details).


=========================================
* Requirements of the Simple Text-File Login script.

* PHP 4.1.x or higher. Your web server should be able to interpret
the PHP language. It really doesn't matter the platform (the SiTeFiLo
script has been tested in GNU/Linux with Apache and in Windows 2000
with IIS).
* A web server (you already have one if you have a website). The
SiTeFiLo
script has been tested with Apache and IIS, but it should work with
any web server.


=========================================
* Installation and configuration 
  of the Simple Text-File Login script.

............................................
 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 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, 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 two variables that can be changed per-page:
slogin_pagetitle: The title string of the page.
slogin_noauthpage: Use 0 to enable authentication in that page, use 1
to disable authentication.


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.
First change the slogin_lang variable to "en" or "es" to change the
login messages to English or Spanish. Then change the slogin_userstxt
variable to the name of your users file. For increased security
change the name to something else (default name is slog_users.txt),
for example: "my_friends_data.txt".


8) Rename the users file.
Change the name of the users.txt file to the name you configured in
the slogin_userstxt variable.


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

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


10) You are done.
Test your site. Also check the adminlog.php script from where you can
see all logins by date.



............................................
 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 two variables that can be changed per-page:
slogin_pagetitle: The title string of the page.
slogin_noauthpage: Use 0 to enable authentication in that page, use 1
to disable authentication.


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.
First change the slogin_lang variable to "en" or "es" to change the
login messages to English or Spanish. Then change the slogin_userstxt
variable to the name of your users file. For increased security
change the name to something else (default name is slog_users.txt),
for example: "my_friends_data.txt".


7) Rename the users file.
Change the name of the users.txt file to the name you configured in
the slogin_userstxt variable.


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

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


9) You are done.
Test your site. Also check the adminlog.php script from where you can
see all logins by date.





-----BEGIN PGP SIGNATURE-----
Version: PGP 8.0

iQCVAwUBQPXOsTpHuYe8JiHtAQEtpgQArEhGPNQrhZu5maXONt6HQ1Bbouv1lc9g
Ol1H9udxz/YDX8B77yhMBJiiHQLdrtKFupvlQOY490yLRmintML6zO+gnTEOuTAd
kXRTuY43hUF+WfopzvO4UuGXBSnN7hPpMoijDPrLtNNGRNg76rSEsLHoKhZ26zZ+
J3pZ7c1B110=
=CwQc
-----END PGP SIGNATURE-----
