This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "IPFire 2.x development tree".
The branch, next has been updated via a63fe65a2f7cf819b27412c9d635806ebba341e0 (commit) from ed3ed3d7235c9e049d1c6a6825806e2b4ebc816f (commit)
Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below.
- Log ----------------------------------------------------------------- commit a63fe65a2f7cf819b27412c9d635806ebba341e0 Author: Michael Tremer michael.tremer@ipfire.org Date: Tue Oct 27 11:37:03 2020 +0000
samba: Make changing shares taking effect immediately
The action was performed after the table has already been rendered which required reloading the page to show a new share.
This has now been moved to the top so that new changes will be shown immediately.
Signed-off-by: Michael Tremer michael.tremer@ipfire.org
-----------------------------------------------------------------------
Summary of changes: html/cgi-bin/samba.cgi | 47 +++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-)
Difference in files: diff --git a/html/cgi-bin/samba.cgi b/html/cgi-bin/samba.cgi index be670a95e..ec41adc5d 100644 --- a/html/cgi-bin/samba.cgi +++ b/html/cgi-bin/samba.cgi @@ -44,7 +44,7 @@ my $userfile = "${General::swroot}/samba/private/smbpasswd"; my %selected= () ;
my $defaultoption= "[My Share]\npath = \ncomment = Share - Public Access\nbrowseable = yes\nwriteable = yes\ncreate mask = 0644\ndirectory mask = 0755\npublic = yes\nforce user = samba"; -my %shares = (); +my %shares = &config("${General::swroot}/samba/shares");
&General::readhash("${General::swroot}/ethernet/settings", %netsettings); &General::readhash("${General::swroot}/main/settings", %mainsettings); @@ -97,6 +97,30 @@ if ($sambasettings{'ACTION'} eq 'join') { $message .= &joindomain($sambasettings{'USERNAME'}, $sambasettings{'PASSWORD'}); }
+if ($sambasettings{'ACTION'} eq 'smbshareadd') { + $shares{'xvx'} = $sambasettings{'SHAREOPTION'}; + &save("shares"); + + # Reload configuration + %shares = config("${General::swroot}/samba/shares"); +} + +if ($sambasettings{'ACTION'} eq 'smbsharedel') { + delete $shares{$sambasettings{'NAME'}}; + &save("shares"); + + # Reload configuration + %shares = config("${General::swroot}/samba/shares"); +} + +if ($sambasettings{'ACTION'} eq 'smbsharechange') { + $shares{$sambasettings{'NAME'}} = $sambasettings{'SHAREOPTION'}; + &save("shares"); + + # Reload configuration + %shares = config("${General::swroot}/samba/shares"); +} + ############################################################################################################################ ########################################### Samba Benutzer oder PC l�chen #################################################
@@ -538,8 +562,6 @@ END
&Header::openbox('100%', 'center', $Lang::tr{'shares'});
-my %shares = config("${General::swroot}/samba/shares"); - print <<END; <table class="tbl" width='100%' cellspacing='0'> <tr> @@ -654,25 +676,6 @@ if ($sambasettings{'ACTION'} eq 'sharechange') { END }
-if ($sambasettings{'ACTION'} eq 'smbshareadd') - { - $shares{'xvx'}= "$sambasettings{'SHAREOPTION'}"; - save("shares"); - my $shares = config("${General::swroot}/samba/shares"); - } -if ($sambasettings{'ACTION'} eq 'smbsharedel') - { - delete $shares{$sambasettings{'NAME'}}; - save("shares"); - my %shares = config("${General::swroot}/samba/shares"); - } -if ($sambasettings{'ACTION'} eq 'smbsharechange') - { - $shares{$sambasettings{'NAME'}} = $sambasettings{'SHAREOPTION'}; - save("shares"); - my %shares = config("${General::swroot}/samba/shares"); - } - &Header::closebox();
############################################################################################################################
hooks/post-receive -- IPFire 2.x development tree