AdminPro Class v1.3 Readme File
The source code included in this package is free. You can modify or pass it on under the conditions of the GNU general Public License, published by the Free Software Foundation. |
I would appreciate any comments or suggestions. Please visit www.phpclasses.org (where this package is published), if you would like to contact me. |
Contents
AdminPro Class v1.3 is a User Authentication PHP Class, based on a MySQL database and the PHP Session functions, written for Websites, that need some password protected areas. The package includes a User Management PHP Application Script as well as a MySQL Table Setup PHP Application Script. The AdminPro Class v1.3 and the application scripts have been tested on: PHP Version 4.3.7, MySQL Server Version 4.0.20 via TCP/IP, Apache HTTP Server Version 1.3 .
Files included in this package
adminpro_class.php |
The main class file. It should be included in each page, you would like to protect. |
adminpro_config.php |
The configuration file for the main class. |
adminpro.css |
The external stylesheet file for the error messages generated by the main class. |
mysql_dialog.php |
The class file to send SQL commands to the MySQL database, required for the main class. |
adminpro.sql |
The SQL command to create the MySQL Table, which is required for the main class. |
adminpro_setup.php |
An application script to check your configuration file and create the MySQL Table, which is required for the main class. |
adminuser.php |
The User Management application script. |
adminuser_config.php |
The configuration file for the User Management application script. |
adminuser.css |
The external stylesheet file for the User Management application script. |
login.html |
The default login page, that starts the User Management application script. |
logout.html |
The default logout page. |
readme.html |
This file. |
1. Open the adminpro_config.php and follow the instructions to configure the main class. The following variables must be changed:
2. Upload all files, included in this package, onto your server.
3. Create the MySQL table required for the main class. There are 2 ways to do that:
4. Run the login.html to start the user management application adminuser.php.
How to use AdminPro Class v1.3
1. Use the following code on each page you would like to protect:
<?php
include("adminpro_class.php"); $prot=new protect(); if ($prot->showPage) { ?> <!--- HERE COMES YOUR PHP CODE OR YOUR HTML CODE ---!> <?php } ?> |
<?php
include("adminpro_class.php"); $prot=new protect("1"); if ($prot->showPage) { ?> <!--- HERE COMES YOUR PHP CODE OR YOUR HTML CODE ---!> <?php } ?> |
<?php
include("adminpro_class.php"); $prot=new protect("0","2"); if ($prot->showPage) { ?> <!--- HERE COMES YOUR PHP CODE OR YOUR HTML CODE ---!> <?php } ?> |
<?php
include("adminpro_class.php"); $prot=new protect(); if ($prot->showPage) { $curUser=$prot->getUser(); ?> <!--- HERE COMES YOUR PHP CODE OR YOUR HTML CODE ---!> <?php } ?> |
2. Your login must be sent by HTTP_POST and have the following structure:
<form action="first_protected_page_after_login.php" method="POST"> <input type="hidden" name="action" value="login"> <input type="text" name="userName"> <input type="password" name="userPass"> <input type="submit"> </form> |
<form action="first_protected_page_after_login.php" method="POST"> <input type="hidden" name="action" value="login"> <input type="text" name="userName"> <input type="password" name="userPass"> <input type="radio" name="userRemember" value="no">No <input type="radio" name="userRemember" value="yes">Yes <input type="submit"> </form> |
3. Your logout must be also sent by HTTP_POST and have the following structure:
<form action="some_existing_protected_page.php" method="POST"> <input type="hidden" name="action" value="logout"> |
(c) 2004 - 2005 Giorgos Tsiledakis, Crete Greece |