Skip to content

Commit 272aecd

Browse files
committed
- Added a check to see if the group "ispapps" exists.
1 parent b2673ae commit 272aecd

File tree

4 files changed

+37
-19
lines changed

4 files changed

+37
-19
lines changed

install/dist/lib/fedora.lib.php

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -857,17 +857,23 @@ public function install_ispconfig()
857857
if($conf['apache']['installed'] == true){
858858
$command = 'usermod -a -G ispconfig '.$conf['apache']['user'];
859859
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
860-
$command = 'usermod -a -G ispapps '.$conf['apache']['user'];
861-
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
860+
if(is_group('ispapps')){
861+
$command = 'usermod -a -G ispapps '.$conf['apache']['user'];
862+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
863+
}
862864
}
863865
if($conf['nginx']['installed'] == true){
864866
$command = 'usermod -a -G ispconfig '.$conf['nginx']['user'];
865867
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
866-
// Allow the ispapps vhost access to /etc/squirrelmail
867-
$command = 'usermod -a -G '.$conf['apache']['group'].' ispapps';
868-
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
869-
$command = 'usermod -a -G ispapps '.$conf['nginx']['user'];
870-
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
868+
if(is_user('ispapps')){
869+
// Allow the ispapps vhost access to /etc/squirrelmail
870+
$command = 'usermod -a -G '.$conf['apache']['group'].' ispapps';
871+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
872+
}
873+
if(is_group('ispapps')){
874+
$command = 'usermod -a -G ispapps '.$conf['nginx']['user'];
875+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
876+
}
871877
}
872878

873879
//* Make the shell scripts executable

install/dist/lib/gentoo.lib.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -870,14 +870,18 @@ public function install_ispconfig()
870870
if($conf['apache']['installed'] == true){
871871
$command = 'usermod -a -G ispconfig '.$conf['apache']['user'];
872872
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
873-
$command = 'usermod -a -G ispapps '.$conf['apache']['user'];
874-
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
873+
if(is_group('ispapps')){
874+
$command = 'usermod -a -G ispapps '.$conf['apache']['user'];
875+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
876+
}
875877
}
876878
if($conf['nginx']['installed'] == true){
877879
$command = 'usermod -a -G ispconfig '.$conf['nginx']['user'];
878880
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
879-
$command = 'usermod -a -G ispapps '.$conf['nginx']['user'];
880-
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
881+
if(is_group('ispapps')){
882+
$command = 'usermod -a -G ispapps '.$conf['nginx']['user'];
883+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
884+
}
881885
}
882886

883887
//* Make the shell scripts executable

install/dist/lib/opensuse.lib.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -894,14 +894,18 @@ public function install_ispconfig()
894894
if($conf['apache']['installed'] == true){
895895
$command = 'groupmod --add-user '.$conf['apache']['user'].' ispconfig';
896896
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
897-
$command = 'groupmod --add-user '.$conf['apache']['user'].' ispapps';
898-
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
897+
if(is_group('ispapps')){
898+
$command = 'groupmod --add-user '.$conf['apache']['user'].' ispapps';
899+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
900+
}
899901
}
900902
if($conf['nginx']['installed'] == true){
901903
$command = 'groupmod --add-user '.$conf['nginx']['user'].' ispconfig';
902904
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
903-
$command = 'groupmod --add-user '.$conf['nginx']['user'].' ispapps';
904-
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
905+
if(is_group('ispapps')){
906+
$command = 'groupmod --add-user '.$conf['nginx']['user'].' ispapps';
907+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
908+
}
905909
}
906910

907911
//* Make the shell scripts executable

install/lib/installer_base.lib.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1752,14 +1752,18 @@ public function install_ispconfig() {
17521752
if($conf['apache']['installed'] == true){
17531753
$command = 'adduser '.$conf['apache']['user'].' ispconfig';
17541754
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
1755-
$command = 'adduser '.$conf['apache']['user'].' ispapps';
1756-
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
1755+
if(is_group('ispapps')){
1756+
$command = 'adduser '.$conf['apache']['user'].' ispapps';
1757+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
1758+
}
17571759
}
17581760
if($conf['nginx']['installed'] == true){
17591761
$command = 'adduser '.$conf['nginx']['user'].' ispconfig';
17601762
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
1761-
$command = 'adduser '.$conf['nginx']['user'].' ispapps';
1762-
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
1763+
if(is_group('ispapps')){
1764+
$command = 'adduser '.$conf['nginx']['user'].' ispapps';
1765+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
1766+
}
17631767
}
17641768

17651769
//* Make the shell scripts executable

0 commit comments

Comments
 (0)