PHP Classes

SMK User Authentication: Authenticate users with MySQL database records

Recommend this page to a friend!
  Info   View files View files (8)   DownloadInstall with Composer Download .zip   Reputation   Support forum (2)   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2006-05-12 (10 years ago) RSS 2.0 feedStarStarStarStar 65%Total: 2,736 This week: 1All time: 1,338 This week: 1,043Up
Version License Categories
smk_auth 1.0GNU General Publi...Databases, User Management
Description Author

This package can be used to authenticate users against a MySQL database of user records.

It can verify whether there is a record for an active user given the user name and password.

If the authentication succeeds, it creates a record for a new session in another database table.

The new session identifier is set to a session cookie. This cookie can be verified in subsequent accesses to determine whether the user was previously authenticated and the session did not expire.

Picture of Andrei
Name: Andrei <contact>
Classes: 1 package by
Country: Romania Romania
Age: 42
All time rank: 110027 in Romania Romania
Week rank: 856 Up20 in Romania Romania Up

Fist of all, this package is based on the authentication used in mambo/joomla, also including the database
object of this premium CMS ( . The files are altered to ensure stand-alone functioning of the classes.
Mostly i worked on auth.class.php, in database.php i just got out some code that dd not make sense outside the 
joomla framework


1. Import the "script.sql" in your MySQL Database (It adds a default user "Testman", password "t")
2. Alter the accourding to your system setup. 
	Please adjust the SESSION timeout since it is maybe to high for you.
3. Build a login page similar to my example "login.php". you should include the two files 
4. in all the "registered only" pages include     "require_once('auth.php')" on top. Please check "index.php"

Please write me if you find some bugs or problems



  Files folder image Files  
File Role Description
Plain text file auth.class.php Class Core Authentication class
Accessible without login Plain text file auth.php Aux. Authentication module
Plain text file database.php Class Database Class (a light version of the one included in the joomla distribution)
Accessible without login Plain text file Conf. Configuration script. Adjust to your Mysql configuration
Accessible without login Plain text file index.php Example Example file that uses authentication
Accessible without login Plain text file login.php Example Example login script.
Accessible without login Plain text file Readme.txt Doc. Documentation, how-to-install
Accessible without login Plain text file script.sql Data Table creation script

 Version Control Unique User Downloads Download Rankings  
This week:1
All time:1,338
This week:1,043Up
User Ratings User Comments (1)
 All time
Very useful authentication class.
9 years ago (Alex Capalneanu)