View Full Version : cPanel Scripting Question
KMyers
06-30-2007, 05:23 PM
Can anyone help, I am looking for a PHP Script to create a FTP Username and Password to a Specific Directory. Does anyone know of one.
This is my alternitive to giving ou the Site cPannel Login to another Admin
charlesgan
06-30-2007, 10:25 PM
not possible
KMyers
07-01-2007, 12:07 AM
I think I found the code needed
<?php
// Define your cpanel login here
$mainuser = 'coolthin';
$mainpass = 'secretpass';
$maindomain = 'coolthing.com';
// Define the data for the new subdomain here
$newuser = 'sub1';
$newpass = '1234';
$newquota = 'unlimited';
// Load the page to set up the sudomain
$createSubResult = implode( '', file ('http://'.$mainuser.':'.$mainpass.'@'.$maindomain.':2082/frontend/xpevolution/subdomain/doadddomain.php?domain='.$newuser.'&rootdomain='.$maindomain));
// Load the page to set up the new FTP account
$createFTPResult = implode( '', file ('http://'.$mainuser.':'.$mainpass.'@'.$maindomain.':2082/frontend/xpevolution/ftp/doaddftp.php?login='.$newuser.'&password='.$newpass.'"a='.$newquota.'&homedir=/home/'.$mainuser.'/public_html/'.$newuser));
// Here you should probably include a check to see if everything went ok
// Use $createSubResult and $createFTPResult for that as it is the html output of the cpanel page
// We're done, here you can output the confirmation for the new user
echo "Success! You now have a new subdomain with us. Please allow a couple of hours for your fresh adress to go live while the changes propagate through the internet";
?>
I will need to do quite a bit of modifications to make this work
mojojuju
07-01-2007, 07:33 PM
not possible
Everything is possible unless you decide it is not :D
not possible
Yes it is possible. You just need to know PHP and how cPanel is set up. That script that KMyers has is the basic idea of what needs to be done, but yes there will have to be modifications done.
And mojojuju, you stole my signature! ;)
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.