View Single Post
Old 28th December 2009, 21:21
oilyflutesalad oilyflutesalad is offline
Join Date: Dec 2009
Posts: 48
Thanks: 2
Thanked 11 Times in 9 Posts
Send a message via MSN to oilyflutesalad
Default [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:
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 for editing. I'm using Ubuntu Server 9.10. The path to your ISPConfig directory may be different on your distro.
vi /var/www/ispconfig/sites/
Go down to the replacePrefix function. Add ,'DOMAINID' to the $keywordlist array, then add a new case under the two existing ones:
        // Array containing keys to search
                                case 'CLIENTID':
                                        $name=str_replace('['.$keyword.']', getClientID($dataRecord),$name);
                                case 'DOMAINID':
                                        $name=str_replace('['.$keyword.']', $dataRecord['parent_domain_id'],$name);
And that's it! Save the file and you're done. To change your prefixes, go into ISPConfig then on the System tab, click "Interface Config" in the system menu.
Reply With Quote
Sponsored Links