mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-18 23:12:59 +02:00
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>
This commit is contained in:
@@ -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();
|
||||
|
||||
############################################################################################################################
|
||||
|
||||
Reference in New Issue
Block a user