@@ -819,7 +819,11 @@ function update($event_name, $data) {
819819 }
820820 }
821821 }
822- $ app ->system ->exec_safe ('chmod -R a+r ? ' , $ data ['new ' ]['document_root ' ].'/ ' . $ web_folder . '/ ' );
822+ // Set the a+r mod to the web_folder.
823+ // Skip this for vhostalias if the web_folder is "web". In this case, everything is setup already from the vhost setup
824+ if ($ data ['new ' ]['type ' ] != 'vhostalias ' || $ web_folder != "web " ) {
825+ $ app ->system ->exec_safe ('chmod -R a+r ? ' , $ data ['new ' ]['document_root ' ].'/ ' . $ web_folder . '/ ' );
826+ }
823827
824828 //** Copy the error documents on update when the error document checkbox has been activated and was deactivated before
825829 } elseif ($ this ->action == 'update ' && ($ data ['new ' ]['type ' ] == 'vhost ' || $ data ['new ' ]['type ' ] == 'vhostsubdomain ' || $ data ['new ' ]['type ' ] == 'vhostalias ' ) && $ data ['old ' ]['errordocs ' ] == 0 && $ data ['new ' ]['errordocs ' ] == 1 ) {
@@ -874,7 +878,10 @@ function update($event_name, $data) {
874878
875879 if ($ this ->action == 'insert ' || $ data ["new " ]["system_user " ] != $ data ["old " ]["system_user " ]) {
876880 // Chown and chmod the directories below the document root
877- $ app ->system ->exec_safe ('chown -R ?:? ? ' , $ username , $ groupname , $ data ['new ' ]['document_root ' ].'/ ' . $ web_folder );
881+ // Skip this for vhostalias if the web_folder is "web". In this case, everything is setup already from the vhost setup
882+ if ($ data ['new ' ]['type ' ] != 'vhostalias ' || $ web_folder != "web " ) {
883+ $ app ->system ->exec_safe ( 'chown -R ?:? ? ' , $ username , $ groupname , $ data ['new ' ]['document_root ' ] . '/ ' . $ web_folder );
884+ }
878885 // The document root itself has to be owned by root in normal level and by the web owner in security level 20
879886 if ($ web_config ['security_level ' ] == 20 ) {
880887 $ app ->system ->exec_safe ('chown ?:? ? ' , $ username , $ groupname , $ data ['new ' ]['document_root ' ].'/ ' . $ web_folder );
0 commit comments