how to do automatic adding new accounts

piksar

New member
Joined
Oct 22, 2005
Messages
1
I am greeting I am writing here because I would like to do automatic adding www accounts through my customers but I don\'t know as. If you can suggest some demonstration full code. Please, from above I am thanking a lot
 
Search this forum (Scripting / API), there are several snippets of code that do what you want (partially).

As far as full code goes, you'll need to learn php since part of the project is web design (usually), depending on what you mean by automatic.
 
Last edited:
Just wrote this myself:

PHP:
include 'httpsocket.php';
							$Socket = new HTTPSocket;
							$Socket->connect('tdhosting.nl',2222);
							
							$Socket->set_login("adminuser","adminpass");
							
							// {admin_username} and {admin_password} are not specifically your administrative DA user,
							
							// but rather the user that you want to own this new user.
							$Socket->query('/CMD_ACCOUNT_USER',
							
							  array(
							
										'username' => $user, // The User's username. 4-8 characters, alphanumeric
							
										'email' => $mail, // A valid email address
							
										'passwd' => $pass, // The User's password. 5+ characters, ascii
							
										'passwd2' => $pass1, // Password double check. 5+ characters, ascii
							
										'domain' => $user.".tdhosting.nl", // A valid domain name in the form: domain.com
							
										'package' => 'free', // One of the User packages created by the Reseller
							
										'ip' => '85.92.134.140', // One of the ips which is available for user creation. Only free or shared ips are allowed.
								
										'notify' => 'yes', // yes or no. If yes, an email will be sent to email
								
										'action' => 'create',
								
										'add' => 'Submit'
								
									));
							$result = $Socket->fetch_parsed_body();
							if ( $Socket->get_status_code() != 200 || !empty($result['error']) )
								
							{
								// failure.
								echo "Failed to add new user: {$result['error']}<br />{$result['text']}";
								exit;
							}
				
							foreach($result as $string) {
								if(ereg("That username already exists on the system",$string)) {
									//username in use
									exit;
									
								}			
								
								if(ereg("The username is invalid. ",$string)) {
									//directadmin returned, username invalid
									exit;
								}		
							}
//signup completed

complete the vars for your own and voila
 
Back
Top