[DOMAINID] Prefix

I wanted to include the ID of the parent domain in FTP accounts, so after a bit of firebug magic and a quick look through relevant files, I've modified the source to add the keyword DOMAINID.

Example Usage:

Code:

c[CLIENTID]d[DOMAINID]_

Will result in something like "c3d12_default" if an FTP account with name "default" was added. Without the domain ID prefix, a client would get a duplicate error if they tried to create a "default" FTP account for each domain, even though it would make sense to be able to create them. Now they can have default accounts for every domain in their account.

Open tools.inc.php for editing. I'm using Ubuntu Server 9.10. The path to your ISPConfig directory may be different on your distro.

Code:

vi /var/www/ispconfig/sites/tools.inc.php

Go down to the replacePrefix function. Add ,'DOMAINID' to the $keywordlist array, then add a new case under the two existing ones:

To adapt ispconfig and use DOMAINNAME, DOMAINID, DOMAINNAMESHORT as prefix for database in order to allow moving databases between clients!

My prefix for database name and database user is:
[DOMAINNAMESHORT][DOMAINID]_

Here DOMAINNAMESHORT will be the first 5 characters of the domain name, and the DOMAINID will be added to make it unique, however not a full list of databases with ONLY numbers!

e.g. for domain.com the database prefix will be domai12_

And because it's based on DOMAIN it allows to move to another client.

INSTRUCTIONS (on own risk)

To support DOMAINID, DOMAINNAME and DOMAINNAMESHORT as prefix modfiy the file /usr/local/ispconfig/interface/web/sites/tools.inc.php and modify replacePrefix and add also a new function getDomainName :