File tree Expand file tree Collapse file tree 6 files changed +45
-11
lines changed
Expand file tree Collapse file tree 6 files changed +45
-11
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,18 @@ check_result $? "user creation failed" $E_INVALID
6161# Adding password
6262echo " $user :$password " | /usr/sbin/chpasswd
6363
64+ # Add a general group for normal users created by Hestia
65+ if [ -z " $( grep ^hestia-users: /etc/group) " ]; then
66+ groupadd " hestia-users"
67+ fi
68+
69+ # Add membership to hestia-users group to non-admin users
70+ if [ " $user " != " admin" ]; then
71+ usermod -a -G " hestia-users" " $user "
72+ setfacl -m " u:$user :r-x" " $HOMEDIR /$user "
73+ fi
74+ setfacl -m " g:hestia-users:---" " $HOMEDIR /$user "
75+
6476# Building directory tree
6577mkdir $HOMEDIR /$user /conf
6678
Original file line number Diff line number Diff line change 8585 -s $shell \
8686 -o -u $( id -u $user ) \
8787 -g $( id -u $user ) \
88+ -G hestia-users \
8889 -M -d " $ftp_path_a " > /dev/null 2>&1
8990
9091# Set ftp user password
Original file line number Diff line number Diff line change @@ -173,6 +173,27 @@ if [ -d "/etc/roundcube" ]; then
173173 chown root:www-data /etc/roundcube/debian-db*
174174fi
175175
176+ # Add a general group for normal users created by Hestia
177+ if [ -z " $( grep ^hestia-users: /etc/group) " ]; then
178+ groupadd " hestia-users"
179+ fi
180+
181+ # Make sure non-admin users belong to correct Hestia group
182+ for user in ` ls /usr/local/hestia/data/users/` ; do
183+ if [ " $user " != " admin" ]; then
184+ usermod -a -G " hestia-users" " $user "
185+ setfacl -m " u:$user :r-x" " $HOMEDIR /$user "
186+
187+ # Update FTP users groups membership
188+ uid=$( id -u $user )
189+ for ftp_user in $( cat /etc/passwd | grep -v " ^$user :" | grep " ^$user .*:$uid :$uid :" | cut -d " :" -f1) ; do
190+ usermod -a -G " hestia-users" " $ftp_user "
191+ done
192+
193+ fi
194+ setfacl -m " g:hestia-users:---" " $HOMEDIR /$user "
195+ done
196+
176197# Add unassigned hosts configuration to Nginx and Apache
177198for ipaddr in $( ls /usr/local/hestia/data/ips/ 2> /dev/null) ; do
178199
Original file line number Diff line number Diff line change @@ -191,6 +191,15 @@ $(function() {
191191 $ ( '.stats-auth' ) . show ( ) ;
192192 }
193193 } ) ;
194+
195+ $ ( '#vstobjects' ) . bind ( 'submit' , function ( evt ) {
196+ $ ( 'input[disabled]' ) . each ( function ( i , elm ) {
197+ var copy_elm = $ ( elm ) . clone ( true ) ;
198+ $ ( copy_elm ) . attr ( 'type' , 'hidden' ) ;
199+ $ ( copy_elm ) . removeAttr ( 'disabled' ) ;
200+ $ ( elm ) . after ( copy_elm ) ;
201+ } ) ;
202+ } ) ;
194203} ) ;
195204
196205function WEBrandom ( ) {
@@ -221,12 +230,3 @@ function elementHideShow(elementToHideOrShow){
221230 var el = document . getElementById ( elementToHideOrShow ) ;
222231 el . style . display = el . style . display === 'none' ? 'block' : 'none' ;
223232}
224-
225- $ ( '#vstobjects' ) . bind ( 'submit' , function ( evt ) {
226- $ ( 'input[disabled]' ) . each ( function ( i , elm ) {
227- var copy_elm = $ ( elm ) . clone ( true ) ;
228- $ ( copy_elm ) . attr ( 'type' , 'hidden' ) ;
229- $ ( copy_elm ) . removeAttr ( 'disabled' ) ;
230- $ ( elm ) . after ( copy_elm ) ;
231- } ) ;
232- } ) ;
Original file line number Diff line number Diff line change 1313 }
1414 }
1515 ?>
16- < a href ="# " class ="ui-button " title ="<?=__('Save')?> " onclick ="document.getElementById(' vstobjects').submit(); "> < i class ="fas fa-save status-icon purple "> </ i > < ?=__('Save')?> </ a >
16+ < a href ="# " class ="ui-button " title ="<?=__('Save')?> " onclick ="$('# vstobjects').submit(); "> < i class ="fas fa-save status-icon purple "> </ i > < ?=__('Save')?> </ a >
1717 </ div >
1818 </ div >
1919 </ div >
Original file line number Diff line number Diff line change 1313 }
1414 }
1515 ?>
16- < a href ="# " class ="ui-button " title ="<?=__('Save')?> " onclick ="document.getElementById(' vstobjects').submit(); "> < i class ="fas fa-save status-icon purple "> </ i > < ?=__('Save')?> </ a >
16+ < a href ="# " class ="ui-button " title ="<?=__('Save')?> " onclick ="$('# vstobjects').submit(); "> < i class ="fas fa-save status-icon purple "> </ i > < ?=__('Save')?> </ a >
1717 </ div >
1818 </ div >
1919 </ div >
You can’t perform that action at this time.
0 commit comments