vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Add-On Releases - vHosting Lite (https://vborg.vbsupport.ru/showthread.php?t=124604)

TCooper 08-24-2006 02:42 AM

If you were looking for the basic way in php here is something you may be able to work with
Code:

require ?/usr/local/cpanel/Cpanel/Accounting.php.inc?;

$host = ?localhost?;
$user = ?root?;
$usessl = 0;
$accesshash = ?AccessHashInOneLongString?;
$domain = ?puranet.co.uk?; //the domain name to use on this account WITHOUT THE WWW.
$username = ?Username?; //the username to use on this account
$password = ?UserPasswordToUse?; // the user accounts password (cpanel pass)
$plan = ?PlanName?; //the package name in WHM you wish to use.
$create = createacct($host,$user,$accesshash,$usessl,$domain,$username,$password,$plan);
//it will show an error message if theres an error, or if it works, itll show the account creation like it does in whm

echo $create;

If I come across something that might be easier to work with I will post it. Let me know if that helps or not.

harmor19 08-24-2006 02:51 AM

Quote:

Originally Posted by COBRAws
With the paid version, is all this automated? I dont want to manually add every new account on my WHM.

And does the pay version offer a brand free download?

Thank you again

Currently neither version is fully automated but the user below posted a script that is supposed to do just that.



Quote:

Originally Posted by TCooper
If you were looking for the basic way in php here is something you may be able to work with
Code:

require ‘/usr/local/cpanel/Cpanel/Accounting.php.inc’;

$host = “localhost”;
$user = “root”;
$usessl = 0;
$accesshash = ‘AccessHashInOneLongString’;
$domain = ‘puranet.co.uk’; //the domain name to use on this account WITHOUT THE WWW.
$username = ‘Username’; //the username to use on this account
$password = ‘UserPasswordToUse’; // the user accounts password (cpanel pass)
$plan = ‘PlanName’; //the package name in WHM you wish to use.
$create = createacct($host,$user,$accesshash,$usessl,$domain,$username,$password,$plan);
//it will show an error message if theres an error, or if it works, itll show the account creation like it does in whm

echo $create;

If I come across something that might be easier to work with I will post it. Let me know if that helps or not.

Thank you. I will code this into the free version.
What would the "access hash" be?

TCooper 08-24-2006 03:10 AM

In order to create an account via the api you have to have the access key. You find this by logging into whm and go to the section Cluster/Remote Access and click setup Remote Access Key. You will be presented with the current key to allow your script to create the accounts.

In your vHosting script that would need to be in a settings section for users to edit as well as the $user variable which is the whm user they are using to create the account with.
Feel free to contact me via msn which is in my profile here or on my gaming community site which is in my sig. I do have other messengers as well if needed.

TCooper 08-24-2006 03:21 AM

I would also suggest to have your script have the option for the admins to restrict users appling for a package to use only a subdomain which could be turned on or off. I personally would restrict users to only a subdomain basically like advertising and such. If that is already an option sorry for posting as I have not installed this yet until the automation is coded but will click install for ya and myself to keep and eye on this.

BETIServices 08-24-2006 03:49 AM

New install I get: Database error

BETIServices 08-24-2006 03:51 AM

Well my guess is because I have installed VB image hosting, and I get the following error:

MySQL Error : Table 'hosting_plans' already exists

DigitalDesktops 08-24-2006 05:34 AM

I get a error when trying to add a package:

Quote:

Database error in vBulletin 3.6.0:

Invalid SQL:

INSERT INTO vb_`hosting_plans`
(
`title`,
`posts`,
`webspace`,
`transfer`,
`email`,
`ftp`,
`subdomain`,
`mysqldatabases`,
`addon`,
`parked`
) VALUES (
'Starter',
'1',
'250',
'2000',
'20',
'5',
'0',
'10',
'0',
'0'
);

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'hosting_plans`
(
`title`,
`posts`,
`webspace`,
`transfer`,
' at line 1
Error Number : 1064
Date : Thursday, August 24th 2006 @ 07:18:20 AM
Script : http://skindev.jmfemedia.com/admincp....php?do=do_add
Referrer : http://skindev.jmfemedia.com/admincp...ing.php?do=add
IP Address : **.**.***.**
Username : JMF-John
Classname : vb_database

TCooper 08-24-2006 06:06 AM

It appears this part has a typo
Open admincp/admin_hosting.php and search for
Code:

                INSERT INTO " . TABLE_PREFIX . "`hosting_plans`
Try changing it to
Code:

                INSERT INTO " . TABLE_PREFIX . "hosting_plans
I haven't installed this yet so I can not confirm but let me know if I was right as I didn't go through his whole code throughly.

DigitalDesktops 08-24-2006 06:13 AM

a big thumbs up to you TCooper...

DigitalDesktops 08-24-2006 06:16 AM

a new problem now:

Quote:

Database error in vBulletin 3.6.0:

Invalid SQL:
DELETE FROM temp_host_request WHERE userid = '1';

MySQL Error : Table 'jferguso_skindev.temp_host_request' doesn't exist
Error Number : 1146
Date : Thursday, August 24th 2006 @ 08:14:55 AM
Script : http://skindev.jmfemedia.com/hosting...6&postuserid=1
Referrer : http://skindev.jmfemedia.com/showthread.php?t=15
IP Address : **.**.***.**
Username : JMF-John
Classname : vb_database
I got that when I clicked the accept button on a test post that I made for the hosting.

I also get a similar one if I click decline.

Quote:

Database error in vBulletin 3.6.0:

Invalid SQL:
DELETE FROM temp_host_request WHERE userid = '1';

MySQL Error : Table 'jferguso_skindev.temp_host_request' doesn't exist
Error Number : 1146
Date : Thursday, August 24th 2006 @ 08:17:15 AM
Script : http://skindev.jmfemedia.com/hosting.php?do=do_decline
Referrer : http://skindev.jmfemedia.com/hosting...6&postuserid=1
IP Address : **.**.***.**
Username : JMF-John
Classname : vb_database


All times are GMT. The time now is 04:04 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01191 seconds
  • Memory Usage 1,752KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete