1 site, unlimited servers No source distribution Commercial use allowed Can modify source Read full license
Unlimited projects Source and binary distribution Commercial use allowed Distribute modifications Read full license
Starting from $ 13.99
Integration time
Saves you
User Management and Authentication is very versatile php class php class that covers every aspect of user management you might need.
It uses MySQL5+ (pdo) as database backend, no fixed database structure is needed you can easily adapt it to your current table structure. In initial db table field setup (simple array), you can set validation, pass-through function (md5 for password for example or phone formatting function), plus all options needed to define table.
Validation is built-in, supports: uniqueness and one of checks, regular expressions, required and external function calls.
After you finish initial setup will automatically suggest table structure if no table is present.
Using class is very simple. Here are few examples:
$user = new User();
$user->username = 'john.doe';
$user->password = 'samplepassword';
$user->email = 'example@ferdinand.rs';
$user->firstname = 'John'; //optional
$user->lastname = 'Doe'; //optional
//$user->status = 'NEW'; //NEW is set as default value, can be changed
$user->date_joined = date('Y-m-d H:i:s', time());
//$user->validate(); //validate will be called on save, but you can manually call it also
$user->save();
/* prints validation errors */
print_r($user->validationErrors);
Update user is same as insert/register, just pass userid of user
$user = new User($userid);
/* all fields are optional, just set what you want to update */
$user->username = 'john.doe';
$user->password = 'samplepassword';
$user->email = 'example@ferdinand.rs';
$user->firstname = 'John'; //optional
$user->lastname = 'Doe'; //optional
//$user->status = 'NEW'; //NEW is set as default value, can be changed
$user->date_joined = date('Y-m-d H:i:s', time());
//$user->validate(); //validate will be called on save, but you can manually call it also
$user->save();
$user = new User();
//load by -- anything
$res = $user->loadby('username', 'john');
//or
$res = $user->loadby('firstname', 'John');
print_r($res);
//or by id
$user = new User($userid);
//or
$user->load($userid);
$user = new User($userid);
$user->delete();
$user = new User($userid);
/* username, password and number of days to remember user, zero for don't remember */
if ($user->login($username, $password, 7))
print "success";
else
print "fail";
$user = new User();
$user->logout();
$user = new User();
if ($user->isLoggedIn())
print "yes";
else
print "no";
$user = new User();
$res = $user->search('jo*hn'); // * acts as a wild card, wildcards are automatically added to begining and end of string
//$user->search('jo*n', array('username')); //if you wish to search just by username, other field names can be added
/* prints results */
print_r($res);
*** EDIT *** 1.31.2012 - The developer has stated that he has included one of my fixes and that he has reworked the code. If this has been done I believe this Class could be a very useful purchase.- Jason Becht, 5 months ago
The review below was my original review before the developer fixed the issues that caused that review.
*** OLD ***
At first glance the code seems well thought out and concise, however, this is NOT the case.
upon attempting to install and configure, the script was able to create a user and add them to the DB. This user however, would not be able to log in as the code in the script required for this process was filled with errors. The developer obviously NEVER tested this version before release, if he had done so it would have definitely failed and he would have corrected the issue.
As it stands now, I bought the full license (with the ability to distribute/sell derivative works). I have already fixed the code to function for registration and login, and will be updating to include passing session variables. The new and fully functional class will be available when I have completed it and you will be able to find it at: rwsdev.net.
advice: DO NOT BUY THIS BROKEN SOFTWARE!
Starting from $ 13.99
Questions & Comments
5 months ago
Leave a comment
Log-in now or register for a free account.