Skip to content

Commit c6f5f00

Browse files
committed
1 parent 046eff2 commit c6f5f00

File tree

1 file changed

+3
-16
lines changed

1 file changed

+3
-16
lines changed

server/plugins-available/apache2_plugin.inc.php

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -476,27 +476,14 @@ function update($event_name,$data) {
476476
exec("chmod 711 ".escapeshellcmd($data["new"]["document_root"]."/*"));
477477
exec("chmod 710 ".escapeshellcmd($data["new"]["document_root"]."/web"));
478478

479-
//* Change the home directory and group of the website user
480-
$command = 'usermod';
481-
$command .= ' --groups sshusers,'.escapeshellcmd($web_config['group']);
482-
$command .= ' '.escapeshellcmd($data["new"]["system_user"]);
483-
exec($command);
484-
$app->log("Modifying user: $command",LOGLEVEL_DEBUG);
485-
486-
// make temp direcory writable for the apache user and the website user
487-
// exec("chmod 777 ".escapeshellcmd($data["new"]["document_root"]."/tmp"));
479+
//* add the apache user to the client group
480+
$app->system->add_user_to_group($groupname, escapeshellcmd($web_config['user']));
481+
488482
// If the security Level is set to medium
489483
} else {
490484

491485
exec("chmod 755 ".escapeshellcmd($data["new"]["document_root"]."/"));
492486
exec("chmod 755 ".escapeshellcmd($data["new"]["document_root"]."/*"));
493-
494-
//* Change the home directory and group of the website user
495-
$command = 'usermod';
496-
$command .= ' --groups sshusers ';
497-
$command .= ' '.escapeshellcmd($data["new"]["system_user"]);
498-
exec($command);
499-
$app->log("Modifying user: $command",LOGLEVEL_DEBUG);
500487

501488
// make temp direcory writable for the apache user and the website user
502489
exec("chmod 777 ".escapeshellcmd($data["new"]["document_root"]."/tmp"));

0 commit comments

Comments
 (0)