Difference between revisions of "Custom Modules"

From AWBS Wiki
Jump to: navigation, search
(Custom Payment Processors)
 
(10 intermediate revisions by the same user not shown)
Line 1: Line 1:
If you would like to create a module for a payment gateway, hosting control panel or registrar that is currently unsupported (not integrated) in AWBS, you will first need our devkit (available upon request).
+
__NOTOC__
 
+
[[#Adding/creating a Custom Module|Adding New Modules using the Devkit]]<br />
 +
[[#Custom Forum Module|Custom Forum Module]]
  
 
== Adding/creating a Custom Module ==
 
== Adding/creating a Custom Module ==
Line 11: Line 12:
 
* Payment gateways (such as paypal)
 
* Payment gateways (such as paypal)
  
== Custom Registrar Module ==
+
1. Create a directory in your includes directory. Name it as desired.<br />(will be how it displays in your AWBS admin area, english alpha numeric no capital letters is recommended)
 
+
== Custom Hosting Control Panel Module ==
+
 
+
=== Built in Variables ===
+
 
+
Most available $params are set as:
+
 
+
*$params['uname']= Username for new account (This is the username that will be used by the Hosting Panel)
+
*$params['pass']= Password for new account (This is the password that will be assigned to the above username)
+
*$params['ownerid']= Users AWBS username
+
*$params['userid']= Users ID in users table
+
*$params['term']= Term for new account
+
*$params['seed']= Package identifier (OrderID)
+
*$params['cTld']= TLD
+
*$params['cSld']= SLD
+
*$params['realdomain']= If idn, the encoded domain SLD (you should always use this variable);
+
*$params['idn']= Is IDN ( 1 or 0 )
+
*$params['idnname']= idn name;
+
*$params['idndomain'] = "$idnname.$cTld";
+
*$params['cpid']= Package ID
+
*$params['plan']= Local plan name
+
*$params['realplan']= Server plan name
+
*$params['servernewip']= IP
+
*$params['server']= Server
+
*$params['servertype']= Server type
+
*$params['domain']= Full domain name;
+
*$params['dns1']= dns1
+
*$params['dns2']= dns2
+
*$params['dns3']= dns3
+
*$params['dns4']= dns4
+
*$params['uemail']= Users email;
+
*$params['regtype']= Queue type
+
 
+
You can also create your own variables and pull information directly from the AWBS Database. Example: <br />
+
$this_user = sqlarray("select id,fname,lname from users where username='".$params['ownerid']."'");
+
 
+
=== Starting your Custom Module ===
+
 
+
Download the V3 devkit from http://www.awbs.com or your authorized reseller.
+
  
For creating a custom hosting module you will need to use the file yourmodulenamev3.php from the /hosting/includes/yourmodulename folder of the zip.
+
2. Download the v3 devkit from your download area where you purchased AWBS. If you do not find it there, make sure your support contract is active.  
  
Save this file somewhere that you can access it. Rename it to what you would like to name your module.  You '''MUST''' keep the v3 at the end of the file name.  Example: cpanelv3.php
+
3. Selecting the appropriate devkit, copy the file within it's includes/yourmodulename directory to your newly created directory as per step 1 above.<br />
 +
Rename the file to match your directory name and add v3 to the end.
 +
  Example:
 +
If you created includes/myccproc in step 1 above,<br />you would rename yourmodulenamev3.php to myccprocv3.php
  
Open the file for editing.
+
4. Edit your file replacing all instances of 'yourmodulename' with your directory name as per the directory name created in step 1 above.
  
You will notice that there is already predefined functions created. These are ONLY an example and will not work out of the box.
+
5. Edit the code as per your third party's API as needed to create your module.
  
==== Defined Functions ====
+
6. Edit the $res= add_module line in the module install function as per the remarked example provided.
  
=== Package Specifics ===
+
7. In AWBS, go to Configuration, Module Setup and click the Add New Module link at the top right of that page.
 +
Enter the directory name exactly as it appears in the includes directory. Save.
  
==== Using Custom Fields in Package Specifics ====
+
8. Locate your new module in the appropriate section of the module setup page and enable/configure as per fields provided.
  
=== Example Functions ===
+
NOTES:
 +
Offsite cc processors and payment gateway processors will have a callbacksample.php file.<br />Rename that file as desired and place it into your AWBS site's web directory.<br />Edit code as per your processor.<br />
 +
Domain Registrar devkit contains a templates directory with sample files for your<br />member's domain manage interface. Rename yourmodulename to your directory name as per step 1 above<br />and place into the common_files directory.<br />Edit as needed.
  
 
== Custom Forum Module ==
 
== Custom Forum Module ==

Latest revision as of 17:18, February 2, 2009

Adding New Modules using the Devkit
Custom Forum Module

Adding/creating a Custom Module

Custom modules can be added for;

  • Domain registrars
  • Hosting control panels
  • Offsite credit card processor (customer is taken to processor for cc information/payment)
  • Onsite credit card processor (customer enters cc information on your website)
  • Payment gateways (such as paypal)

1. Create a directory in your includes directory. Name it as desired.
(will be how it displays in your AWBS admin area, english alpha numeric no capital letters is recommended)

2. Download the v3 devkit from your download area where you purchased AWBS. If you do not find it there, make sure your support contract is active.

3. Selecting the appropriate devkit, copy the file within it's includes/yourmodulename directory to your newly created directory as per step 1 above.
Rename the file to match your directory name and add v3 to the end.

Example:
If you created includes/myccproc in step 1 above,
you would rename yourmodulenamev3.php to myccprocv3.php

4. Edit your file replacing all instances of 'yourmodulename' with your directory name as per the directory name created in step 1 above.

5. Edit the code as per your third party's API as needed to create your module.

6. Edit the $res= add_module line in the module install function as per the remarked example provided.

7. In AWBS, go to Configuration, Module Setup and click the Add New Module link at the top right of that page. Enter the directory name exactly as it appears in the includes directory. Save.

8. Locate your new module in the appropriate section of the module setup page and enable/configure as per fields provided.

NOTES:
Offsite cc processors and payment gateway processors will have a callbacksample.php file.
Rename that file as desired and place it into your AWBS site's web directory.
Edit code as per your processor.
Domain Registrar devkit contains a templates directory with sample files for your
member's domain manage interface. Rename yourmodulename to your directory name as per step 1 above
and place into the common_files directory.
Edit as needed.

Custom Forum Module

Edit the user_forums.php file in the includes/forum directory with your custom forum account create code.

In the AWBS Configuration area, enter the Forum Setup Configuration page. Select Custom Forum 1 as your Forum Type. Complete all configuration fields as per your forum software/installation.