]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
BUG11505: Captive Portal: no way to remove an uploaded logo
authorAlexander Marx <alexander.marx@ipfire.org>
Thu, 24 May 2018 10:38:39 +0000 (12:38 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 17 May 2019 22:36:32 +0000 (23:36 +0100)
added a delete button

Signed-off-by: Alexander Marx <alexander.marx@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/captive.cgi
langs/de/cgi-bin/de.pl
langs/en/cgi-bin/en.pl

index b7c42e797e4fb6964f3755679da8287716123740..b33287dd4c8c134b69e9fe08a41105ed27c6fa58 100755 (executable)
@@ -142,6 +142,10 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'save'}) {
        }
 }
 
+if ($cgiparams{'ACTION'} eq "$Lang::tr{'Captive delete logo'}") {
+       unlink $logo;
+}
+
 if ($cgiparams{'ACTION'} eq "$Lang::tr{'Captive generate coupons'}") {
        #check valid remark
        if ($cgiparams{'REMARK'} ne '' && !&validremark($cgiparams{'REMARK'})){
@@ -381,7 +385,10 @@ if (-e $logo) {
        print <<END;
                <tr>
                        <td>$Lang::tr{'Captive logo uploaded'}</td>
-                       <td>$Lang::tr{'yes'}</td>
+                       <td>
+                               $Lang::tr{'yes'}&nbsp;
+                               <input type='submit' name='ACTION' value="$Lang::tr{'Captive delete logo'}"/>
+                       </td>
                </tr>
 END
 }
index ba7771ab68c59ce34233153901c273c082858d2a..0603e713568a9856bc463582c9cd98bf9fa087a1 100644 (file)
@@ -28,6 +28,7 @@
 'Captive clients' => 'Clients',
 'Captive config' => 'Konfiguration',
 'Captive coupon' => 'Gutschein',
+'Captive delete logo' => 'Logo löschen',
 'Captive err doublevoucher' => 'Ein Gutschein mit diesem Code ist bereits im Umlauf',
 'Captive expire' => 'Ablauf',
 'Captive expiry time' => 'Ablaufzeit',
index 8dbd134339ffe7157f67c2993f7f275bcd652bbf..6e4f855cb476e6e99c1fe643bcca73ba9a42d70f 100644 (file)
@@ -27,6 +27,7 @@
 'Captive client session expiry time' => 'Session Expiry Time',
 'Captive config' => 'Settings',
 'Captive coupon' => 'Coupon',
+'Captive delete logo' => 'Delete Logo',
 'Captive err doublevoucher' => 'A coupon with this code already exists',
 'Captive expire' => 'Expire',
 'Captive expiry time' => 'Expiry Time',