Hi, I want to create a new folder for new clients with a specific Client-Templates. For example when I create a new client with the template called XXX in his ftp he will have : -defaults folders -new folder 1 -new record 2 And in the folder 1 he will have one static file (which does not change) welcome.txt Thank you !
I checked /usr/local/ispconfig/server/plugins-available/apache2_plugin.inc.php and i founded : So if i simply add this : It's will work ?
Yes, that should work. A more update-safe way would be to write a small plugin that attaches itself to the web domain insert and update events too and add the code to create the folder in there.
Ah thank you Till, there a a doc or something ? There are a solution to create this folder only for costumers with client-template id 1 for exemple ?
Hi ! I think you i founded the solution, if i do so, it's will work ? : PHP: $client = $app->db->queryOneRecord("SELECT `template_master` FROM `client` WHERE `client_id` = '" . intval($client_id) . "'"); if($client['template_master'] == 5) { if(!is_dir($data['new']['document_root'].'/newFolder')) { $app->system->mkdirpath($data['new']['document_root'].'/newFolder'); $app->system->chmod($data['new']['document_root'].'/newFolder',0710); $app->system->chown($data['new']['document_root'].'/newFolder',$username); $app->system->chgrp($data['new']['document_root'].'/newFolder',$groupname); } if (file_exists($data['new']['document_root'].'/newFolder/readme.txt')) { exec('cp '. $conf['rootpath'] . '/conf-custom/newFolder/readme.txt '.$data['new']['document_root'].'/newFolder/readme.txt'); $app->system->chmod($data['new']['document_root'].'/newFolder/readme.txt',0710); $app->system->chown($data['new']['document_root'].'/newFolder/readme.txt',$username); $app->system->chgrp($data['new']['document_root'].'/newFolder/readme.txt',$groupname); } } And it's better to use PHP: $client = $app->db->queryOneRecord("SELECT `template_master` FROM `client` WHERE `username` = '" . intval($username) . "'"); OR PHP: $client = $app->db->queryOneRecord("SELECT `template_master` FROM `client` WHERE `groupname` = '" . intval($groupname) . "'");
Neither the username of the site nor the groupname of the site are stored in the client table, so you can not use them to query the template_master value. Better use the client_id.