... | ... |
@@ -8,7 +8,7 @@ Written 2008-2018 by schokokeks.org Hosting, namely |
8 | 8 |
|
9 | 9 |
To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. |
10 | 10 |
|
11 |
-You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see |
|
11 |
+You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see |
|
12 | 12 |
http://creativecommons.org/publicdomain/zero/1.0/ |
13 | 13 |
|
14 | 14 |
Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code. |
... | ... |
@@ -20,47 +20,39 @@ require_once('inc/security.php'); |
20 | 20 |
require_once('greylisting.php'); |
21 | 21 |
|
22 | 22 |
|
23 |
-if ($_GET['action'] == 'delete') |
|
24 |
-{ |
|
25 |
- $entry = get_whitelist_details($_GET['id']); |
|
26 |
- $sure = user_is_sure(); |
|
27 |
- if ($sure === NULL) |
|
28 |
- { |
|
29 |
- are_you_sure("action=delete&id={$entry['id']}", "Möchten Sie die E-Mail-Adresse »{$entry['local']}@{$entry['domain']}« von der Ausnahmeliste entfernen?"); |
|
30 |
- } |
|
31 |
- elseif ($sure === true) |
|
32 |
- { |
|
33 |
- delete_from_whitelist($entry['id']); |
|
34 |
- if (! $debugmode) |
|
35 |
- header("Location: whitelist"); |
|
36 |
- } |
|
37 |
- elseif ($sure === false) |
|
38 |
- { |
|
39 |
- if (! $debugmode) |
|
40 |
- header("Location: whitelist"); |
|
41 |
- } |
|
23 |
+if ($_GET['action'] == 'delete') { |
|
24 |
+ $entry = get_whitelist_details($_GET['id']); |
|
25 |
+ $sure = user_is_sure(); |
|
26 |
+ if ($sure === null) { |
|
27 |
+ are_you_sure("action=delete&id={$entry['id']}", "Möchten Sie die E-Mail-Adresse »{$entry['local']}@{$entry['domain']}« von der Ausnahmeliste entfernen?"); |
|
28 |
+ } elseif ($sure === true) { |
|
29 |
+ delete_from_whitelist($entry['id']); |
|
30 |
+ if (! $debugmode) { |
|
31 |
+ header("Location: whitelist"); |
|
32 |
+ } |
|
33 |
+ } elseif ($sure === false) { |
|
34 |
+ if (! $debugmode) { |
|
35 |
+ header("Location: whitelist"); |
|
36 |
+ } |
|
37 |
+ } |
|
38 |
+} elseif ($_GET['action'] == 'add') { |
|
39 |
+ check_form_token('greylisting_add'); |
|
40 |
+ if (!filter_var($_POST['address'], FILTER_VALIDATE_EMAIL) |
|
41 |
+ && !filter_var("x@".$_POST['address'], FILTER_VALIDATE_EMAIL)) { |
|
42 |
+ system_failure("Sie haben eine ungültige Mailadresse eingegeben."); |
|
43 |
+ } |
|
44 |
+ $local = false; |
|
45 |
+ $domain = ''; |
|
46 |
+ $at = strrpos($_POST['address'], '@'); |
|
47 |
+ if ($at === false) { |
|
48 |
+ $domain = $_POST['address']; |
|
49 |
+ } else { |
|
50 |
+ $local = substr($_POST['address'], 0, $at); |
|
51 |
+ $domain = substr($_POST['address'], $at+1); |
|
52 |
+ } |
|
53 |
+ DEBUG("Whitelisting {$local}@{$domain} for {$_POST['expire']} minutes"); |
|
54 |
+ new_whitelist_entry($local, $domain, $_POST['expire']); |
|
55 |
+ if (! $debugmode) { |
|
56 |
+ header("Location: whitelist"); |
|
57 |
+ } |
|
42 | 58 |
} |
43 |
-elseif ($_GET['action'] == 'add') |
|
44 |
-{ |
|
45 |
- check_form_token('greylisting_add'); |
|
46 |
- if ( !filter_var($_POST['address'], FILTER_VALIDATE_EMAIL ) |
|
47 |
- && !filter_var("x@".$_POST['address'], FILTER_VALIDATE_EMAIL) ) |
|
48 |
- system_failure("Sie haben eine ungültige Mailadresse eingegeben."); |
|
49 |
- $local = false; |
|
50 |
- $domain = ''; |
|
51 |
- $at = strrpos($_POST['address'], '@'); |
|
52 |
- if ($at === false) |
|
53 |
- $domain = $_POST['address']; |
|
54 |
- else |
|
55 |
- { |
|
56 |
- $local = substr($_POST['address'], 0, $at); |
|
57 |
- $domain = substr($_POST['address'], $at+1); |
|
58 |
- } |
|
59 |
- DEBUG("Whitelisting {$local}@{$domain} for {$_POST['expire']} minutes"); |
|
60 |
- new_whitelist_entry($local, $domain, $_POST['expire']); |
|
61 |
- if (! $debugmode) |
|
62 |
- header("Location: whitelist"); |
|
63 |
- |
|
64 |
-} |
|
65 |
- |
|
66 |
-?> |
... | ... |
@@ -1,4 +1,19 @@ |
1 | 1 |
<?php |
2 |
+/* |
|
3 |
+This file belongs to the Webinterface of schokokeks.org Hosting |
|
4 |
+ |
|
5 |
+Written 2008-2012 by schokokeks.org Hosting, namely |
|
6 |
+ Bernd Wurst <bernd@schokokeks.org> |
|
7 |
+ Hanno Böck <hanno@schokokeks.org> |
|
8 |
+ |
|
9 |
+To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. |
|
10 |
+ |
|
11 |
+You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see |
|
12 |
+http://creativecommons.org/publicdomain/zero/1.0/ |
|
13 |
+ |
|
14 |
+Nevertheless, in case you use a significant part of this code, we ask (but not require, see the license) that you keep the authors' names in place and return your changes to the public. We would be especially happy if you tell us what you're going to do with this code. |
|
15 |
+*/ |
|
16 |
+ |
|
2 | 17 |
require_once('inc/debug.php'); |
3 | 18 |
require_once('inc/security.php'); |
4 | 19 |
|
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1301 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -11,7 +11,7 @@ if ($_GET['action'] == 'delete') |
11 | 11 |
$sure = user_is_sure(); |
12 | 12 |
if ($sure === NULL) |
13 | 13 |
{ |
14 |
- are_you_sure("action=delete&id={$entry['id']}", "Möchten Sie die E-Mail-Adresse »{$entry['local']}@{$entry['domain']}« von der Ausnahmeliste entfernen?"); |
|
14 |
+ are_you_sure("action=delete&id={$entry['id']}", "Möchten Sie die E-Mail-Adresse »{$entry['local']}@{$entry['domain']}« von der Ausnahmeliste entfernen?"); |
|
15 | 15 |
} |
16 | 16 |
elseif ($sure === true) |
17 | 17 |
{ |
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@1128 87cf0b9e-d624-0410-a070-f6ee81989793
... | ... |
@@ -17,12 +17,12 @@ if ($_GET['action'] == 'delete') |
17 | 17 |
{ |
18 | 18 |
delete_from_whitelist($entry['id']); |
19 | 19 |
if (! $debugmode) |
20 |
- header("Location: whitelist.php"); |
|
20 |
+ header("Location: whitelist"); |
|
21 | 21 |
} |
22 | 22 |
elseif ($sure === false) |
23 | 23 |
{ |
24 | 24 |
if (! $debugmode) |
25 |
- header("Location: whitelist.php"); |
|
25 |
+ header("Location: whitelist"); |
|
26 | 26 |
} |
27 | 27 |
} |
28 | 28 |
elseif ($_GET['action'] == 'add') |
... | ... |
@@ -44,7 +44,7 @@ elseif ($_GET['action'] == 'add') |
44 | 44 |
DEBUG("Whitelisting {$local}@{$domain} for {$_POST['expire']} minutes"); |
45 | 45 |
new_whitelist_entry($local, $domain, $_POST['expire']); |
46 | 46 |
if (! $debugmode) |
47 |
- header("Location: whitelist.php"); |
|
47 |
+ header("Location: whitelist"); |
|
48 | 48 |
|
49 | 49 |
} |
50 | 50 |
|
git-svn-id: https://svn.schokokeks.org/repos/tools/webinterface/trunk@985 87cf0b9e-d624-0410-a070-f6ee81989793
1 | 1 |
new file mode 100644 |
... | ... |
@@ -0,0 +1,51 @@ |
1 |
+<?php |
|
2 |
+require_once('inc/debug.php'); |
|
3 |
+require_once('inc/security.php'); |
|
4 |
+ |
|
5 |
+require_once('greylisting.php'); |
|
6 |
+ |
|
7 |
+ |
|
8 |
+if ($_GET['action'] == 'delete') |
|
9 |
+{ |
|
10 |
+ $entry = get_whitelist_details($_GET['id']); |
|
11 |
+ $sure = user_is_sure(); |
|
12 |
+ if ($sure === NULL) |
|
13 |
+ { |
|
14 |
+ are_you_sure("action=delete&id={$entry['id']}", "Möchten Sie die E-Mail-Adresse »{$entry['local']}@{$entry['domain']}« von der Ausnahmeliste entfernen?"); |
|
15 |
+ } |
|
16 |
+ elseif ($sure === true) |
|
17 |
+ { |
|
18 |
+ delete_from_whitelist($entry['id']); |
|
19 |
+ if (! $debugmode) |
|
20 |
+ header("Location: whitelist.php"); |
|
21 |
+ } |
|
22 |
+ elseif ($sure === false) |
|
23 |
+ { |
|
24 |
+ if (! $debugmode) |
|
25 |
+ header("Location: whitelist.php"); |
|
26 |
+ } |
|
27 |
+} |
|
28 |
+elseif ($_GET['action'] == 'add') |
|
29 |
+{ |
|
30 |
+ check_form_token('greylisting_add'); |
|
31 |
+ if ( !filter_var($_POST['address'], FILTER_VALIDATE_EMAIL ) |
|
32 |
+ && !filter_var("x@".$_POST['address'], FILTER_VALIDATE_EMAIL) ) |
|
33 |
+ system_failure("Sie haben eine ungültige Mailadresse eingegeben."); |
|
34 |
+ $local = false; |
|
35 |
+ $domain = ''; |
|
36 |
+ $at = strrpos($_POST['address'], '@'); |
|
37 |
+ if ($at === false) |
|
38 |
+ $domain = $_POST['address']; |
|
39 |
+ else |
|
40 |
+ { |
|
41 |
+ $local = substr($_POST['address'], 0, $at); |
|
42 |
+ $domain = substr($_POST['address'], $at+1); |
|
43 |
+ } |
|
44 |
+ DEBUG("Whitelisting {$local}@{$domain} for {$_POST['expire']} minutes"); |
|
45 |
+ new_whitelist_entry($local, $domain, $_POST['expire']); |
|
46 |
+ if (! $debugmode) |
|
47 |
+ header("Location: whitelist.php"); |
|
48 |
+ |
|
49 |
+} |
|
50 |
+ |
|
51 |
+?> |