Zubrag.com
August 16, 2018, 01:44:56 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Help with "Creation Upon Registration"  (Read 8004 times)
teamcoltra
Newbie
*
Posts: 4


« on: January 17, 2008, 10:17:20 PM »

I had created this a while back, and it worked but then i messed up some code and was never able to figure out how to fix it and then the next update of e107 changed the way signup worked...

I was however wondering if anyone could help me:
I want to create a subdomain, email address, and ftp account in cpanel with the username of each user that signs up for my site.


Here is the script that i need to update, even if you can only give me help that would work.

http://paste2.org/p/12064

Logged
teamcoltra
Newbie
*
Posts: 4


« Reply #1 on: January 18, 2008, 02:18:19 PM »

This is actually probably a better question or a couple of questions:
1) Can I batch multipul scripts togeather and use 1 name for all the fields?
like input once and its your subdomain, email address, ftp (and the email and ftp passwords) all togeather  so its just one
Create Username
Create Password
 
and all three would execute?

2) is it possible upon creation to redirect to a new link? This would allow me to set that link to a script that will update the users userclass, and have that script redirect them "home"
Logged
zubrag
Administrator
Hero Member
*****
Posts: 788


WWW
« Reply #2 on: January 19, 2008, 03:24:16 PM »

I think you can achieve that by using cPanel Toolbox. It is not very easy to setup it thought.

In order to redirect following needs to be inserted at the end of the script:

header('Location: http://example.com/path/to/the/page.html');
Logged
smithster
Web Trade Pro
Newbie
*
Posts: 27


WWW
« Reply #3 on: January 25, 2008, 06:52:31 PM »

I found Zubrag's scripts a long time a go, and whilst I agree that the scripting Zubrag uses can be very confusing, the concept is good.  I adapted the scripts so that I could create one script which could be used to set up a full "hosting" account...

For subdomain accounts...
Code:
<?php
if (isset($_POST['submit'])) {

$username $_POST['username'];
$password $_POST['password'];
$subdomain $_POST['subdomain'];

// cPanel username
$cpanel_user "cpuser";

// cPanel password
$cpanel_password "cppass";

// cPanel host
$cpanel_host "cphost (usually localhost)";

// cPanel theme/skin, usually "x"
$cpanel_skin "x";

// Path to cURL on your server
$curl_path "/usr/bin/curl";

// Set Up The Customer's Web Hosting Account
$database exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/sql/adddb.html?db=$username'");
$adduser exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/sql/adduser.html?user=$username&pass=$password'");
$asignuser exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/sql/addusertodb.html?user=$cpanel_user_$username&db=$cpanel_user_$username&ALL=ALL'");
$subdm exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/subdomain/doadddomain.html?domain=$subdomain&rootdomain=your primary domain");
$ftp exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/ftp/doaddftp.html?login=$username&password=$password&homedir=$subdomain&quota=500'");
$popmail exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/mail/doaddpop.html?email=$username&domain=$subdomain.your primary domain&password=$password&quota=20'");
}
else {
//I'm sure you all know the required html for the form, or you can write it in PHP, which ever your prefer.
}
?>


And for domain creation...
Code:
<?php
if (isset($_POST['submit'])) {

$username $_POST['username'];
$password $_POST['password'];
$domain $_POST['domain'];
$domprefix $_POST['domprefix'];

// cPanel username
$cpanel_user "cpuser";

// cPanel password
$cpanel_password "cppass";

// cPanel host
$cpanel_host "cphost (usually localhost)";

// cPanel theme/skin, usually "x"
$cpanel_skin "x";

// Path to cURL on your server
$curl_path "/usr/bin/curl";

// Set Up The Customer's Web Hosting Account
$database exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/sql/adddb.html?db=$username'");
$adduser exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/sql/adduser.html?user=$username&pass=$password'");
$asignuser exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/sql/addusertodb.html?user=$cpanel_user_$username&db=$cpanel_user_$username&ALL=ALL'");
$dom exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/addon/doadddomain.html?domain=$domain.$domprefix&user=$domain&pass=$password'");
$ftp exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/ftp/doaddftp.html?login=$username&password=$password&homedir=$subdomain&quota=500'");
$popmail exec("$curl_path 'http://$cpanel_user:$cpanel_password@$cpanel_host:2082/frontend/$cpanel_skin/mail/doaddpop.html?email=$username&domain=$subdomain.your primary domain&password=$password&quota=20'");
}
else {
//I'm sure you all know the required html for the form, or you can write it in PHP, which ever your prefer.
}
?>


Both of these scripts should so long as cURL is enabled on your server set up a full account including ftp, mail, database access and subdomain or domain addresses.  If you use the scripts, you just need to add the relevant html or PHP to allow users to fill in a form asking for the relevant questions.

i.e. username, password, subdomain address or domain address.
Logged

S
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC