+-----------------------------+
| AMFR Account Creator Readme |
| Version: 1.0 final          |
+-----------------------------+

Description
===========

AMFR Account Creator is a script designed for free hosting companies.  It has many features, full list at http://www.amfrservices.com/?page=3

Requirements
============

Requires php 4.2.0 or later, mysql, and WHM/cPanel.

Usage
=====

To delete and email users, go to "admin.php" and login with the username and password you specified in "config.php".
To let users signup, point them to "new.php"

Installation
============

1. Run this query on your database:

CREATE TABLE amfr_config (configname TEXT, configvalue TEXT);
CREATE TABLE amfr_users (user TEXT, domain TEXT, email TEXT);
CREATE TABLE amfr_used_keys (amfrkey TEXT, user TEXT);
CREATE TABLE amfr_keys (amfrkey TEXT);
CREATE TABLE amfr_domains (domain TEXT);
CREATE TABLE amfr_logs (user TEXT, month INT(40), day INT(40), year INT(40));
INSERT INTO amfr_domains values ('com');
INSERT INTO amfr_domains values ('net');
INSERT INTO amfr_domains values ('org');
INSERT INTO amfr_domains values ('biz');
INSERT INTO amfr_domains values ('info');
INSERT INTO amfr_domains values ('co.uk');
INSERT INTO amfr_domains values ('us');
INSERT INTO amfr_domains values ('cc');
INSERT INTO amfr_config values ('skeys', 'no');
INSERT INTO amfr_config values ('mkeys', 'no');
INSERT INTO amfr_config values ('ns1', 'ns1.domain.com');
INSERT INTO amfr_config values ('ns2', 'ns2.domain.com');
INSERT INTO amfr_config values ('image', 'no');
INSERT INTO amfr_config values ('template', 'default');
INSERT INTO amfr_config values ('cpuser', 'username');
INSERT INTO amfr_config values ('cppass', 'password');
INSERT INTO amfr_config values ('cppackage', 'username_package');

2. Then, edit "config.php" and fill in the correct values.
3. Login into "admin.php", click "Update config", and fill in the correct values
4. To let users signup, point them to "new.php".

Signup Keys
===========

Signup keys are used if you only want to offer a certain amount of accounts or only let certain people signup.
A signup key can be any combination of numbers, letters, and dashes.
Example signup keys:

A
mI8fOjue-IOowejubna
sogfij
hello
2348537

To use signup keys, enable them in "config.php", then add signup keys in the admin section, then distribute the signup keys to anyone.
A signup key can only be used once and by one person unless you enable "Multiple use signup keys" in "config.php".

Templates
=========

---INSTALLAION---

1. Create a subfolder of the templates folder, name it the what the template provider tells you to call it.
2. Copy all of the template files into the folder.
3. Change the template in "admin.php" under "Update config" to the directory that you created.

---CREATING TEMPLATES---

The basic files you need to create templates with descriptions are:

"signup_new.tpl" - The template file for the new.php page, basically the signup form
"signup_image.tpl" - The template file that is included in new.php if "Image verfication" is on in "config.php"
"signup_key.tpl" - The template file that is included in new.php if "Use signup keys" is on in "config.php"
"signup_error.tpl" - The template file if an error occurs during signup
"signup_finished.tpl" - The template file displayed after signup

When creating template files, there are specific template varibles that will be replaced when the file is parsed.  Varibales are declared like this: <*VARNAME*>.  All variables must be uppercase.

Variable listing (all varibales are required unless otherwise listed):

signup_new.tpl
--------------

	<*FORMSTART*> - The start of the signup form, contains the correct <form> tag
	<*FORMEND*> - The end of the signup form, contains the </form> tag
	<*DOMAINFIELD*> - Replaced by the input field where a user chooses a domain/subdomain
	<*USERNAMEFIELD*> - Replaced by the input field where a user chooses a username
	<*EMAILFIELD*> - Replaced by the input field where a user enters his/her email
	<*SUBMITBUTTON*> - Replaced by the submit button ofr the form
	<*COPYRIGHT*> - MUST be included somewhere visible on the page
	<*IMAGEFILE*> - Replaced with the content of "signup_image.tpl" if "Image verfication" is on in "config.php"
	<*SIGNUPKEYFILE*> - Replaced with the content "signup_key.tpl" if "Use signup keys" is on in "config.php"

signup_image.tpl
----------------

	<*IMAGE*> - Replaced with an <img> tag with the url of the image needed for verification
	<*IMAGEFIELD*> - Replaced by the input field where the user enters the number in the image

signup_key.tpl
--------------

	<*KEYFIELD*> - Replaced by the input field where the user enters the signup key

signup_error.tpl
----------------

	<*ERROR*> - The text of the error that occured
	<*COPYRIGHT*> - MUST be included somewhere visible on the page

signup_finished.tpl
-------------------

	<*USERNAME*> - The username that the user signed up with - not required
	<*PASSWORD*> - The password that was created for the user - not required
	<*EMAIL*> - The email that the user signed up with - not required
	<*COPYRIGHT*> - MUST be included somewhere visible on the page

You should link all css and image files to "templates/mynewtemplate/image.png" instead of just "image.png".  You should also provide a readme with your template telling users what the directory for the template shoudl be called so the links to the images and the css files are correct/

---EXAMPLES---

Look in the templates/default folder for examples of template files.

Changelog
=========

v. 1.0 final
-Overhaul of config system
-Changes to "admin.php"
-Changes to the templating system

v. 1.0 rc4 Bugfix2
-Fixed major bugs in "admin.php"

v. 1.0 rc4 Bugfix1
-Fixed major bugs

v. 1.0 rc4
-Added template parsing system
-Removed WHM API

v. 1.0 rc3
-Added logs

v. 1.0 rc2
-Switched to WHM API
-Changed domain handling

v. 1.0 rc1 Bugfix3
-Minor changes

v. 1.0 rc1 Bugfix2
-Changed to WHM Packages

v. 1.0 rc1 Bugfix1
-Fixed some bugs

v. 1.0 rc1
-Added more error checking
-Minor design changes

v. 0.3.3 beta
-Added optional image verification
-Added more error checking

v. 0.3.2 beta
-Added optional "Multiple use signup keys"
-Minor design changes

v. 0.3.1 beta
-Shows nameservers after signup

v. 0.3 beta
-Added multi-domain support
-Let users use their own domains
-Delete domain bug fixed

v. 0.2 beta
-Made signup keys optional

v. 0.1 beta
-Began project

Authors
=======

amfr - amfr@comcast.net

Copyright
=========

Copyright 2005 AMFR Services - http://www.amfrservices.com