From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Tremer To: development@lists.ipfire.org Subject: [PATCH 32/54] samba: Drop refresh page hack Date: Tue, 13 Oct 2020 16:07:50 +0000 Message-ID: <20201013160812.27754-32-michael.tremer@ipfire.org> In-Reply-To: <20201013160812.27754-1-michael.tremer@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1678693807619605051==" List-Id: --===============1678693807619605051== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable This is very invalid HTML, very often inserted into spaces where it should not be, and the page does not even need to be reloaded after any action has been performed. Signed-off-by: Michael Tremer --- html/cgi-bin/samba.cgi | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/html/cgi-bin/samba.cgi b/html/cgi-bin/samba.cgi index 029cc2691..1619045cc 100644 --- a/html/cgi-bin/samba.cgi +++ b/html/cgi-bin/samba.cgi @@ -80,8 +80,6 @@ my $LOGLINES =3D '50'; &General::readhash("${General::swroot}/samba/settings", \%sambasettings); &Header::getcgihash(\%sambasettings); =20 -sub refreshpage{&Header::openbox( 'Waiting', 1, "" );print "
3D''
$Lang::tr{'pagerefresh'}
";&Header::= closebox();} - if (($sambasettings{'WIDELINKS'} eq 'on') & ($sambasettings{'UNIXEXTENSION'}= eq 'on')) {$errormessage =3D "$errormessage
Don't enable 'Wide links' and 'Unix= extension' at the same time"; } =20 @@ -91,15 +89,15 @@ if (($sambasettings{'WIDELINKS'} eq 'on') & ($sambasettin= gs{'UNIXEXTENSION'} eq ############################################################################= ################################################ ############################################# Samba Rootskript aufrufe fr SU= -Actions ####################################### =20 -if ($sambasettings{'ACTION'} eq 'smbuserdisable'){system("/usr/local/bin/sam= bactrl smbuserdisable $sambasettings{'NAME'}");refreshpage();} -if ($sambasettings{'ACTION'} eq 'smbuserenable'){system("/usr/local/bin/samb= actrl smbuserenable $sambasettings{'NAME'}");refreshpage();} -if ($sambasettings{'ACTION'} eq 'smbuseradd'){system("/usr/local/bin/sambact= rl smbuseradd $sambasettings{'USERNAME'} $sambasettings{'PASSWORD'} $sambaset= tings{'GROUP'} $sambasettings{'SHELL'}");refreshpage();} -if ($sambasettings{'ACTION'} eq 'smbpcadd'){system("/usr/local/bin/sambactrl= smbpcadd $sambasettings{'PCNAME'} $sambasettings{'GROUP'} $sambasettings{'SH= ELL'}");refreshpage();} -if ($sambasettings{'ACTION'} eq 'smbchangepw'){system("/usr/local/bin/sambac= trl smbchangepw $sambasettings{'USERNAME'} $sambasettings{'PASSWORD'}");refre= shpage();} -if ($sambasettings{'ACTION'} eq 'smbrestart'){system("/usr/local/bin/sambact= rl smbrestart");refreshpage();} -if ($sambasettings{'ACTION'} eq 'smbstart'){system("/usr/local/bin/sambactrl= smbstart");refreshpage();} -if ($sambasettings{'ACTION'} eq 'smbstop'){system("/usr/local/bin/sambactrl = smbstop");refreshpage();} -if ($sambasettings{'ACTION'} eq 'smbreload'){system("/usr/local/bin/sambactr= l smbreload");refreshpage();} +if ($sambasettings{'ACTION'} eq 'smbuserdisable'){system("/usr/local/bin/sam= bactrl smbuserdisable $sambasettings{'NAME'}");} +if ($sambasettings{'ACTION'} eq 'smbuserenable'){system("/usr/local/bin/samb= actrl smbuserenable $sambasettings{'NAME'}");} +if ($sambasettings{'ACTION'} eq 'smbuseradd'){system("/usr/local/bin/sambact= rl smbuseradd $sambasettings{'USERNAME'} $sambasettings{'PASSWORD'} $sambaset= tings{'GROUP'} $sambasettings{'SHELL'}");} +if ($sambasettings{'ACTION'} eq 'smbpcadd'){system("/usr/local/bin/sambactrl= smbpcadd $sambasettings{'PCNAME'} $sambasettings{'GROUP'} $sambasettings{'SH= ELL'}");} +if ($sambasettings{'ACTION'} eq 'smbchangepw'){system("/usr/local/bin/sambac= trl smbchangepw $sambasettings{'USERNAME'} $sambasettings{'PASSWORD'}");} +if ($sambasettings{'ACTION'} eq 'smbrestart'){system("/usr/local/bin/sambact= rl smbrestart");} +if ($sambasettings{'ACTION'} eq 'smbstart'){system("/usr/local/bin/sambactrl= smbstart");} +if ($sambasettings{'ACTION'} eq 'smbstop'){system("/usr/local/bin/sambactrl = smbstop");} +if ($sambasettings{'ACTION'} eq 'smbreload'){system("/usr/local/bin/sambactr= l smbreload");} if ($sambasettings{'ACTION'} eq 'join') { $message .=3D &joindomain($sambasettings{'USERNAME'}, $sambasettings{'PASSW= ORD'}); } @@ -107,7 +105,7 @@ if ($sambasettings{'ACTION'} eq 'join') { ############################################################################= ################################################ ########################################### Samba Benutzer oder PC l=EF=BF= =BDchen ################################################# =20 -if ($sambasettings{'ACTION'} eq 'userdelete'){system("/usr/local/bin/sambact= rl smbuserdelete $sambasettings{'NAME'}");refreshpage();} +if ($sambasettings{'ACTION'} eq 'userdelete'){system("/usr/local/bin/sambact= rl smbuserdelete $sambasettings{'NAME'}");} =20 ############################################################################= ################################################ ##################################### Umsetzen der Werte von Checkboxen und = Dropdowns ###################################### @@ -179,7 +177,6 @@ close FILE; =20 system("/usr/local/bin/sambactrl smbsafeconf"); system("/usr/local/bin/sambactrl smbreload"); -refreshpage(); } &General::readhash("${General::swroot}/samba/settings", \%sambasettings); =20 @@ -772,7 +769,6 @@ close FILE; =20 system("/usr/local/bin/sambactrl smbsafeconf"); system("/usr/local/bin/sambactrl smbreload"); -refreshpage(); } =20 sub isrunning --=20 2.20.1 --===============1678693807619605051==--