Hi Joe,
The quickest and least invasive hack for this is to modfiy the template page, /usr/local/cpanel/base/frontend/x3/ftp/accounts.html , at line 40. Remove the 'onchange="suggest_homedir()"' attribute or place your own JavaScript function call there (and include your function via a <script></script> somewhere in the template).
ex: add custom function and mod line 40.
Code:
<script>
//simply removed the static "public_html/" string in the concatenation//
var suggest_homedir_custom=function(){YAHOO.util.Dom.get("homedir").value=YAHOO.util.Dom.get("login").value;ADD_VALID.dir.verify()};
</script>
<td style="width: 150px">
<input type="text" name="login" id="login" style="width: 150px" onchange="suggest_homedir_custom()" />
</td>
This is not a permenant solution, but would work for the meantime.
If you're having to create these accounts manually, I'd just create them with the API1 'Ftp::addftp' call via the xml-api. Here's an example using the xml-api PHP client class to perform the request:
Code:
include("xmlapi.php");
$ip = "10.1.1.1";
$root_user = "root";
$root_pass = "s3cr3tPass!";
$cpuser = 'dave';
$xmlapi = new xmlapi($ip);
$xmlapi->password_auth( $root_user, $root_pass );
$xmlapi->set_output('xml');
$xmlapi->set_port('2087');
//$xmlapi->set_debug(1);
//Ftp::addftp( user, pass, homedir, quota, disallowdot, homedir2 )
$args = array( 'ftpuser1', 'pass1', '../testdir1', '', '', 'testdir1' );
//those are create homedir: /home/$cpuser/testdir1
//the third variable is relative to /home/$cpuser/public_html
//the sixth variable is relative to /home/$cpuser
// as far as I know, you'll need to provide both for cPanel and the FTP
// sub-system to function properly.
$xmlapi->api1_query($cpuser, 'Ftp', 'addftp', $args);
There are many threads about how to use the xml-api and make requests via Perl, PHP or other languages. Check out docs.cpanel.net and/or give a shout if you need anything.
Best Regards,
-DavidN