PHP Easy User Manager - User Manual


What would you need to have good user support on your website?

 

Well, first you’d need a way for users to register for an account and a way for you to manually add accounts if you wanted.  On the sign up form that your users would fill out, you should be able to ask the question that *you* wanted to ask.  You should be able to make some questions on the form required, while other questions can be optional. 

 

Once a user registers, the script should have the ability send the new user a welcome message – automatically.  It should also send you an email saying that a new user has registered.  Since the script can send email, wouldn’t it be a good idea if you could send an email to any or all of your users whenever you wanted?  How about the ability to insert their first name (or other personal data) in the body of the letter?  That could potentially make your mass emailing to your users look like each one was individually composed just for them!

 

A good script should provide a way to insure that users only enter valid email addresses by some way of validation.  Perhaps one solution would be - sending the user an email with a secure link that has to be clicked before the user can use their account.

 

Of course, you’d need a way for users to retrieve forgotten passwords, change or update their personal information and passwords, have a secure way to contact you, and lots of other features that you haven’t even thought of yet.

 

Wouldn’t it be nice if the script had a full features admin section so you didn’t have to hand edit a bunch of complicated configuration files?  Wouldn’t it also be great if the script installed easily without having to set up a bunch of MySql or other databases?

 

It would be great if the script could be easy to integrate into any existing website and provide an easy way to protect any webpage from prying eyes - other than your registered users of course.

 

What is PHP Easy User Manager?

 

PHP Easy User Manager actually does all of the above and more!   The script can be used as a basis for an entire website, or used to augment an existing website only for one of the features that it can do. 

 

PHP Easy User Manager Features.

 

·        Provide a quick and easy way to password protect any web page.

·        Easy install..  No MySql or other databases to configure.  Just upload and run!

·        Supports user validation via e-mail to insure you have a real working email address for each and every user.

·        Allows you to be notified via email when a new user registers for an account.

·        Supports custom registration forms so you can gather the info you want for your users.

·        Send custom mass emails to your users – inserting their first name or other personal data – into the email where you want it.

·        Supports up to 3 opt in - out subscription lists.

·        Allows you to selectively send emails to all users or just a select few based of your criteria.

·        Easily close your site with one click if you need to perform critical maintenance.

·        Full and rich Administration Back-end allows you to configure everything. NO HAND EDITING CONFIG FILES!

·        Theme support.  Easily change the look of your website.  Easily match the look of the script to your existing website.

·        Allows account banning (until a future date),

·        Allows account expiration (expires after a future date).

·        Allows account suspension - suspend a user’s account indefinitely - until you reinstate them.

·        Portable.  Need to move to another webhost?  Just move the site intact and it works on the new site with no re-configuration.

·        Many other features..

 

System Requirements

 

·        PHP 4 or higher with GD library support.

·        This script DOES NOT require MySql or any other database.

·        If "sendmail" is not available on your server, phpmailer can be used for email functions - PHPMailer requires an email account to send mail.  (Even Gmail works!)

 

Many Add-on modules are available for a complete web solution.

 

·        Blog module easily allows you to post recent news about your organization.  This module comes pre-installed and is used for your site's home page.   (You can change this easily if you wish.)

·        Calendar module allows you to easily maintain a list of events for your corporation, band, night club, etc

·        PHP Easy Download modules for providing truly automatic downloads for your users or visitors.  Several flavors of this module are available and pre-configured as Photo Gallery, MP3 or Music Downloads, general download, Font Downloads, etc.

·        Paypal Subscription module that will allow your users to pay for additional time when their account expires.  They are re-directed to Paypal to re-subscribe – automatically! 
Shopping Cart module that includes product flat-file database and integration with services like Paypal and Mal’s E-Commerce.  (Available soon)

·       Custom modules to fit your specific application may already be available. 

 

Want to see the script in action?

 

Online demo can be viewed at http://www.phpeasyscripts.com/demos/ezuser/

 

Quick Start Guide

 

A quick start guide is available here.

 

At this point the script is now configured to act as a simple “opt-in” newsletter subscription script. 

 

To prove it to yourself, sign up as a new user (using a different email address from your admin account of course).  Next, log into the admin section using your admin account information. 

 

Here’s how to send your first email newsletter to your users.

 

Step 1 - Compose your Newsletter

 

From the admin section main menu, click “Email Template”.  Use the WYSIWYG editor to compose your newsletter.  Be sure to enter a subject.  The subject becomes the file name that you will choose in the next step. 

 

You can use variables inside the subject or the body of the e-mail.  For example, typing !first_name! in the body of the email will cause the script to replace that variable with the user’s actual first name.  A complete list of usable variables are listed at the bottom of the “Email Template” page for your convenience.

 

Be sure to save the completed newsletter before continuing to the next step.

 

Step 2 – Choosing the Recipients

 

Now that your newsletter is composed, we have to choose who to send it to.  From the admin main menu, select “Email Preparation”.  Once there, select the newsletter that you just composed in the first dropdown box.  Next, select “All Users” from the second dropdown box and click the “Save Emails to Outbox” button.  If all went well, the script generated the emails, replaced the variables (like !first_name!) with real data, and saved them to the email outbox.  Click the link that says “Continue to Outbox”.

 

Step 3 – Sending the Newsletter

 

Go to the “Email Outbox” either by clicking the “Continue to Outbox” link as described above or clicking the “Email Outbox” link from the admin Main Menu.  You can view any email by clicking on it in the right panel.  You can even edit individual letters and re-save them before they are sent.  Look over the letters and make sure they meet your approval and then send them out.

 

You have now just sent out your first newsletter to your distribution list! 

 

How to Integrate PHP Easy User Manager into Your Website.

 

This script is very easy to integrate into your existing website.  It uses “PHP Include” statements to insert the script output into your web pages.  You can use a website template and simply use the “include” statement wherever you want the scripts output to appear.

 

In addition, you could use "Theme" files to change the look of your site.

 

The sample site included here uses "themes" that incorporate “header” and “footer” files.  Header and Footer files splits a website template into 2 parts – the part before the script output is saved as the header, while the html used after the script output is saved as a footer file.  The same header and footer file are used on each page of the website - making global changes to the website a snap.  If you change some of the html in the header file, the change would be global on every page of the site.  Without using this technique, you would have to edit every page on the site to make one small change to your site.

 

A Theme Tutorial is in the works and will be posted soon. This tutorial will show you how to make your own themes.  For now, the script comes prepackaged with several themes.  The theme can be changed from the admin section in the "Main Configuration" section.  To change themes, log into the admin back end, select the "Main Configuration" link and scroll down to the "Theme Section".  Find the dropdown box and select the theme you want to use.  Be sure to click the "Save" button to save the change.  The new theme will instantly be displayed globally on your site.

 

How to use this “include” function:

This script was designed from the outset as an "include" script.  Simply "include" the functions you need into your html template and omit the features that you don't need.  To include a script, you need to follow these rules. 

Here is an example of how to include the "Contact Us" form inside your html page:

 

<?php
# These lines must appear at the top of the page before any html.
# Start the session so php can track users.
session_start();

# include the config.php file so the script will know where
# the support files are located.
include ($path_adjuster."config.php");
?>

 

(Your html goes here – or html header.)

 

<?php
# This command will print the "Contact Us" form
include($path_adjuster."$support_files_directory /EZUser_Contact_Form.php");
?>

 

(The remainder of your html (or footer file) goes here)

 

This technique will be used for all scripts described here. 

 

List of scripts included and a short description of each one:

Here is a list of each script that can be included and a short description of what they do.  You can choose to either use or omit these scripts as your need requires.

 

EZUser_Registration.php:  (This is the only required include script - the rest are optional)


EZUser_Contact_Form.php:
(This script is optional.  Only needed if you want to provide a "Contact Us" email page.)


EZUser_Forgot_Password.php:
(Only required if you require passwords.  YES! - Passwords are optional! – you wouldn’t want to hassle a user for a password in a simple “opt-in” newsletter would you?)


EZUser_Account_Info.php:
(Again, only needed if passwords are required.)


EZUser_Change_Password.php: 
(Yep, only required if passwords are required.)


EZUser_Failed_Login.php: 
(Again, only needed if passwords are required.)


EZUser_Unsubscribe.php: 
(Although not required for functionality, you should include this feature if your want to provide a way for users to “opt-out” of your newsletter.)


EZUser_Validate.php  (Only required if validation is toggled on.)


EZUser_Resend_Validation.php: (Again, only required if validation is toggled on.)

 

Setting Up The Simplest Scenario - A Simple Newsletter Subscription Script.

In it's simplest form, this script will allow your users to subscribe to your newsletter.  You don't want to hassle your users to input a lot of personal data about themselves like name, address, phone number, etc..  You don't even want them to enter a password!  You just want to present them with a small form that allows them to enter their email address - so that they can receive your emailed newsletter.  I like to require them to enter just their first name though.  That way I have something to call them when I email them later.

For this simple "opt-in" scenario, the only required files are the "EZUser_Support_Files" directory and the "config.php" script.  All other files are optional.  You can remove them if you wish..

*IMPORTANT POINT*
Remember, as long a PHP is installed on your server, you can change any .htm or .html page to .php and it won’t hurt a thing.  All html will work just as it did before.  The only difference is that we can insert php code into the document and have it recognized and executed! 

For this example let’s create a new page called "registration.php".  Copy and paste your website template or add your website's html look into this new file.  Where ever you want the registration form to appear in the new page, just copy and paste this code:

<?php
# This command will print the "Contact Us" form
include($path_adjuster."$support_files_directory /EZUser_Registration.php");
?>

And magically, the registration form will appear wherever this code is entered.

Also, at the very top of the web page - even before the first <html> tag, the following code must appear as the very first thing at the top of the page:

<?php
# These lines must appear at the top of the page before any html.
# Start the session so php can track users.
session_start();

# include the config.php file so the script will know where
# the support files are located.
include ($path_adjuster."config.php");
?>

If this code doesn't appear at the very top of your page, you’ll get a nasty "Headers Already Sent" or other errors like “can’t find file”.

Now just save the page and then access it with a web browser.  If all is well, you will be presented with a registration form on a web page that has the look and feel of your website. Fill out the form and see what happens. 

If you need to add or remove fields from the registration form, simply go to the admin editor (you may be asked to log in) and click the “registration Form Editor” link, and then edit the registration form by checking or un-checking the appropriate boxes to either display or not display any given field on the registration form.  You can also check or uncheck whether or not the field is required or not.  Required fields will be marked in bold on the form and will force the user to enter the required info before they can register successfully.  In our case, we just want the email to be required   (Email is ALWAYS required and can not be changed).  We may also want to display the first name and last name fields - but not make them required.  That way, the user can enter their name if they want to, but it is strictly voluntary.  I actually like to require the first name only so I can use it in the email template to personalize my message to them in mass mailings.

Sending your first Newsletter.

Now that you have the registration form working and you have acquired a few members, it is time to send out a newsletter.  Follow the 3 steps previously mentioned above (and reprinted here) to actually send out your newsletter.

Step 1 - Compose your Newsletter

 

From the admin section main menu, click “Email Template”.  Use the WYSIWYG editor to compose your newsletter.  Be sure to enter a subject.  The subject becomes the file name that you will choose in the next step. 

 

You can use variables inside the subject or the body of the e-mail.  For example, typing !first_name! in the body of the email will cause the script to replace that variable with the user’s actual first name.  A complete list of usable variables are listed at the bottom of the “Email Template” page for your convenience.

 

Be sure to save the completed newsletter before continuing to the next step.

 

Step 2 – Choosing the Recipients

 

Now that your newsletter is composed, we have to choose who to send it to.  From the admin main menu, select “Email Preparation”.  Once there, select the newsletter that you just composed in the first dropdown box.  Next, select “All Users” from the second dropdown box and click the “Save Emails to Outbox” button.  If all went well, the script generated the emails, replaced the variables (like !first_name!) with real data, and saved them to the outbox.  Click the link that says “Continue to Outbox”.

 

Step 3 – Sending the Newsletter

 

Go to the “Email Outbox” either by clicking the “Continue to Outbox” link as described above or clicking the “Email Outbox” link from the admin Main Menu.  You can view any email by clicking on it in the right panel.  You can even edit individual letters and re-save them before they are sent.  Look over the letters and make sure they meet your approval and then send them out.

 

You have now just sent out your first newsletter to your distribution list! 

If You Require Passwords ...

If you need to require passwords, a few more scripts need to be available to your users.  To enable passwords, use the form editor in the admin section and check the box that makes passwords required. 

Once passwords are required, your users will need to have a way to recover lost passwords as well as the ability to change their password.  This script provides a solution for this.  You'll need to make the following pages and use the following "include" statements:

Change Password Form:

To make a "Change Password" page, follow these steps:

Step 1:  Build a page called "change_password.php" (you can name it anything you wish - as long as it has the .php extension) and copy your html template to this new file.  Be sure to follow this format when you build the change password page:

<?php
# These lines must appear at the top of the page before any html.
# Start the session so php can track users.
session_start();

# include the config.php file so the script will know where
# the support files are located.
include ($path_adjuster."config.php");
?>

And include this code exactly where you want the Change Password form to appear on your page.

<?php
# This command will print the "Change Password" form
include($path_adjuster."$support_files_directory /EZUser_Change_Password.php");
?>

Step2:  Go to the “Main Configuration” in the admin section and enter the name of your “Change Password Page” (near the bottom).  The script needs to know what you named this page because it generates links to this page on other pages.

Step 3:  Test the new page by accessing it with a web browser and log in if needed - then try to change your password. 

Recover Lost Password Form:

To make a "Recover Password" page, follow these steps:

Step 1:  Build a page called "recover_password.php" (again, you can name it anything you wish - as long as it has the .php extension) and copy your html template to this new file.  Be sure to follow this format when you build the recover password page:

<?php
# These lines must appear at the top of the page before any html.
# Start the session so php can track users.
session_start();

# include the config.php file so the script will know where
# the support files are located.
include ($path_adjuster."config.php");
?>

And include this code exactly where you want the Change Password form to appear

<?php
# This command will print the "Change Password" form
include($path_adjuster."$support_files_directory /EZUser_Forgot_Password.php");
?>

Step2:  Go to the “Main Configuration” in the admin section and tell the script the name of your “Forgot password page” (near the bottom).  The script needs to know what you named this page because it generates links to this page on another pages.

Step 3:  Test the new page by accessing the page with a web browser and fill out the form to have your password sent to you.

=============================================================================

Do you see a pattern here?  Yep, all of the separate scripts described here are all installed or "included" the exact same way as the  examples above.  You just have to determine which scripts you need for your particular application and the script will take care of all the work for you.  Just remember to include the "session" and “config.php” statement at the top of each page and the include statement in the exact place you want the script's output to show up on your page.  That's It!

Here is a quick Guide to which scripts you'll need for various applications.

Script "includes" required for a simple opt-in newsletter or email list. - A simple opt-in list should not require the user to enter a password.  You normally want to make this as easy as possible on your prospective list subscriber to fill out the registration form.  Require them to enter just their e-mail address only.  Since no password is required, you don't need to make a page to change the password, or to recover the password, etc.

For this simple use, you only need to include the registration form.

include ($path_adjuster."$support_files_directory /EZUser_Registration.php");    (This prints out the registration or "opt-in" form.)

If you want to allow your users to unsubscribe from the list, you'll need to include:

include ($path_adjuster."$support_files_directory /EZUser_Unsubscribe.php");   (This script allows your users to unsubscribe from any opt in newsletter or email list.)

 

Script includes needed for a true membership script. - If you need to password protect files, or simply require your users to log in to view some special content, then you will need to require them to enter a password when they register for an account.  To do this, you will want to "include" these pages on your website.

include ($path_adjuster."$support_files_directory /EZUser_Registration.php");     (This prints out the registration form.)
include
($path_adjuster."$support_files_directory /EZUser_Change_Password.php");     (This script allows your users to change their password)
include ($path_adjuster."$support_files_directory /EZUser_Forgot_Password.php");
    (This script allows your users to recover their lost password via email.)

If you want to allow your users to update their account info like address or phone number, etc - then you need to include this script:

include ($path_adjuster."$support_files_directory /EZUser_Account_Info.php");      (This prints out a form that allows your users to change their personal info.)

If you want to take advantage of using the options like "suspend user", or "Ban an account" or "Expire account", or "account validation", you'll need to include the EZUser_Failed_Login.php script:  These options are all available in the admin section's User Editor.  You can ban a user until a certain date or make the user's account expire on some future date, or simply suspend the user until further notice.  Just check the appropriate checkbox in the user editor.

include ($path_adjuster."$support_files_directory /EZUser_Failed_Login.php");      (This script informs your user why they were denied access.)

 

USING VALIDATION

If you want your users accounts to be validated by forcing them to click a link sent to them via email (to insure that their email address is valid) then you must include the EZUser_Validate.php.  You will also have to configure your validation options in “Main Configuration” in the admin section.  If validation is turned on, users are sent an email that contains a secure link.  They must click the link before they will be allowed to log in to their account.  This insures that their email address is absolutely valid.

First, build a validation page as described above.  For this example, we’ll name it “validate.php”. Next, insert this include statement where you want the script’s output to appear.  The script’s output is simply a sentence that says whether or not their account was validated successfully.

include ($path_adjuster."$support_files_directory /EZUser_Validate.php");     

To enable validation, go to the “Main Configuration” of the admin section and check the “Yes” box that say “Validation Required”.  You must also supply the “Full Site URL” and the name of the validation page (in this case “validate.php”).  The full site url and validation page must be correct since the validation link sent to your users is generated using this information.  If this info is incorrect, the user will never be able to validate their accounts!

The “Full Site URL must reflect your actual Web address on the script location.  For example if you installed the script at "www.mydomain.com/members" then that would be the “Full Site URL”.

Once validation has been enabled, any subsequent user that registers must validate their account by clicking on the validation url sent to them in their welcome email that is automatically sent to them upon successful registration.  Be sure to test the validation by signing up as a new user and going through the validation process.

Remember, If one of your users lost or failed to receive the validation email, we need to have a way to receive another copy of the email.  Set up a new page named “resend_validation.php” (or whatever name you like) as described previously and insert this code:

include ($path_adjuster."$support_files_directory /EZUser_Resend_Validation.php");     

This script will resend the validation email.  Since the script needs to insert this link in other pages, be sure to enter the name of this script in the “Main Configuration” admin section.  In this case, enter “resend_validation.php” in the box labeled “Resend Validation Page”.  Be sure to save the change.

Contact Us

If you want to provide an easy and secure way for anyone to send you an email from your website, include this script the same way as all the other scripts:

include ($path_adjuster."$support_files_directory /EZUser_Contact_Us.php");      (This script allows anyone to send an email to you securely).

Be sure to enter the name of your “contact us” page in the “main configuration” admin section in the box labeled “Contact Page”.

BLOG Module

This script comes with a simple blog module already installed.  Many of you use this blog module as part of the home page or index page for the site.  That way you can easily insert the latest news for your site and it will be the first thing your users see when they visit.

To use the blog script as your home page, make a new page called “index.php” and insert your html as described previously.  Where you want the blog entries to appear, insert this code:

include($path_adjuster."$support_files_directory/blog/index.php");

You can add/edit/ delete blog entries from the admin section by clicking on the “Blog Editor” link from the main menu.

Add On Modules

There are more scripts and add-on modules that you can install, making your website even more functional.  The current list can always be found at http://www.phpeasyscripts.com

Admin Editor

You must have admin access to use any admin or back-end function.  The first user registered is automatically granted admin access.  (Access level 100)  If you are prompted with a username and password when attempting to use the admin functions, use the account info (username and password) for the first user that you registered.  If you don't know the password, use the EZUser_lost_password.php script as described above to have the script email you the password or you may read the section "Security Issues" below and edit the user data directly.

Main Configuration

The main configuration page lets you set up many of the scripts features.  For further info, please see "Main Configuration".

Registration Form Configuration:  

The Registration Form Configuration allows you to change the fields that are displayed on the registration form.  For more info, please see the "Registration Form" editor help page.

Email Configuration

 Allows you to change mail settings.  For more info, please see the "Email Settings" editor help page.

User Editor

Allows you to edit any users attributes..  For mor info. please see the "User Editor" help page.

Sending Mass Emails

To send out mass emails to your users, you'll need to use 3 scripts and use them in this order.

Email Template Editor: 

This editor allows you to compose an email that will be used in mass mailings.  For more info, please see the "Email Template Editor" help page.

Email Preparation Editor:  

This editor allows you to choose the recipients, replace the variables with the actual user data, and place the "ready to send" email in the outbox.  For more info, please see the "Prepare Mass Email" help file.

Email Outbox Editor:  

This editor allows you to review, edit, delete and send any or all of the email in the outbox.  For further information, please see the "Email Outbox" editor help page.

Security Issues.

It may be a very good idea to change the name of the directory that holds the user data.  For more info on how to do this, please see the "Security" help page..

The files located in the "userdata" directory contain all the information that you are tracking about each and every user.  Lets say you have a user with a username of "me@mine.com".  There will be a file inside the "userdata" directory called "me@mine.com.dat".  If you were to open that file in a text editor, you would find that it contains something like this:

|me@mine.com|poopypants|Scott||1||||||||1217909706|1|1217919526|100|0|0|0|||||||||0|0|0|0|1|1|0|0|0|0|0|0|0
Unused record 1
Unused record 2
Unused record 3
Unused record 4
Unused record 5
Unused record 6
Unused record 7
Unused record 8
Unused record 9

The first line contains the user's data.  The data is delimited by the "|" character.  When a user logs on, this data is loaded into a php array called $user_data.

$user_data[1] = "me@mine.com" or the username
$user_data[2] = "poopypants" or the user's password in plain text. 
$user_data[3] = "Scott" or the user's first name..
..and so on..  A complete list of these variables can be found in
this Excel file.  These variables can be used in your html on any page that a user is logged in to by using this statement:

<?php echo $file_info[X]; ?>

Where "X" is the number of the variable you want to print out.  For example, you can do something like this in html:

<center><b>Hello <?php echo $user_data[3]; ?>! Welcome Back.</b></center>

If the current user's first name was "Scott", the above code would print this message:

Hello Scott! Welcome back.

The other lines (like "Unused Record 1") are reserved for future use.  Some of these lines will be available to other developers and allow them to store the variables they need for their applications or games as they apply to individual users.