User Authentication with patUser (part 1) - Power User (
Page 2 of 7 )
There are a number of reasons why you might want to add user
authentication to your Web site. You might want to restrict access to certain
pages only to a specific group of privileged users. You might want to customize
the content on your site as per user preferences. Or you might just want to
track user movement between the pages of your site. Regardless of why you want
to add it, you should know how to go about doing it reliably and efficiently.
patUser, in the author's words, is a "user management class, that helps
you with authentication, group and permission management, statistics and more".
Developed by Stephan Schmidt, it is freely available for download and is
packaged as a single PHP class that can be easily included in your
application.
Very simply, patUser provides application developers with a
set of APIs that ease the task of managing and authenticating users within the
framework of a Web application. It includes a number of well-thought-out
functions designed to manage users, organize users into groups, assign
privileges to users and groups, and track user logins for audit purposes. The
model on which patUser based is simple enough that it can be quickly understood
and exploited for rapid deployment, yet flexible enought that it can be easily
extended to build fairly sophisticated user management systems for Web
applications.
If you're in the business of building Web applications,
and if those applications are designed to support multiple users with different
privileges, you're going to find patUser invaluable to your development cycle.
Written as a PHP class, patUser can easily be integrated into any PHP-based Web
application, and can substantially reduce the amount of time you spend on
designing, building and deploying multi-user applications. You'll find it
functional, powerful and (if you're the kind who likes fiddling) easily
extensible, and it'll soon be a standard component of every application you
write.
Before proceeding further, you should visit the patUser home page
at
http://www.php-tools.de/ and download
a copy of the latest version (2.1 at the time of writing). The package contains
the main class file, documentation outlining the exposed methods and variables,
and some example scripts.