Neues Modul: Kann greylisti...
bernd authored 16 years ago
|
1) <?php
|
Added license tags for CC0,...
Bernd Wurst authored 12 years ago
|
2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4)
|
Change license from CC0 to...
Hanno Böck authored 1 year ago
|
5) Written by schokokeks.org Hosting, namely
|
Added license tags for CC0,...
Bernd Wurst authored 12 years ago
|
6) Bernd Wurst <bernd@schokokeks.org>
7) Hanno Böck <hanno@schokokeks.org>
8)
|
Change license from CC0 to...
Hanno Böck authored 1 year ago
|
9) This code is published under a 0BSD license.
|
Added license tags for CC0,...
Bernd Wurst authored 12 years ago
|
10)
11) 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.
12) */
13)
|
Neues Modul: Kann greylisti...
bernd authored 16 years ago
|
14) require_once('inc/debug.php');
15) require_once('inc/security.php');
16)
17) require_once('greylisting.php');
18)
19)
|
Fix coding style with php-c...
Hanno authored 6 years ago
|
20) if ($_GET['action'] == 'delete') {
21) $entry = get_whitelist_details($_GET['id']);
22) $sure = user_is_sure();
23) if ($sure === null) {
24) are_you_sure("action=delete&id={$entry['id']}", "Möchten Sie die E-Mail-Adresse »{$entry['local']}@{$entry['domain']}« von der Ausnahmeliste entfernen?");
25) } elseif ($sure === true) {
26) delete_from_whitelist($entry['id']);
27) if (! $debugmode) {
28) header("Location: whitelist");
29) }
30) } elseif ($sure === false) {
31) if (! $debugmode) {
32) header("Location: whitelist");
33) }
34) }
35) } elseif ($_GET['action'] == 'add') {
36) check_form_token('greylisting_add');
37) if (!filter_var($_POST['address'], FILTER_VALIDATE_EMAIL)
38) && !filter_var("x@".$_POST['address'], FILTER_VALIDATE_EMAIL)) {
39) system_failure("Sie haben eine ungültige Mailadresse eingegeben.");
40) }
41) $local = false;
42) $domain = '';
43) $at = strrpos($_POST['address'], '@');
44) if ($at === false) {
45) $domain = $_POST['address'];
46) } else {
47) $local = substr($_POST['address'], 0, $at);
|
codingstyle, spaces between...
Hanno Böck authored 9 months ago
|
48) $domain = substr($_POST['address'], $at + 1);
|
Fix coding style with php-c...
Hanno authored 6 years ago
|
49) }
50) DEBUG("Whitelisting {$local}@{$domain} for {$_POST['expire']} minutes");
51) new_whitelist_entry($local, $domain, $_POST['expire']);
52) if (! $debugmode) {
53) header("Location: whitelist");
54) }
|