354c05a4ddd678c49bcbba458bffa7d13482139a
bernd Neues Modul: Kann greylisti...

bernd authored 16 years ago

1) <?php
Bernd Wurst Added license tags for CC0,...

Bernd Wurst authored 12 years ago

2) /*
3) This file belongs to the Webinterface of schokokeks.org Hosting
4) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 2 years ago

5) Written by schokokeks.org Hosting, namely
Bernd Wurst 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) 
Hanno Böck Change license from CC0 to...

Hanno Böck authored 2 years ago

9) This code is published under a 0BSD license.
Bernd Wurst 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) 
bernd 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) 
Hanno 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']);
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 11 months ago

27)         if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

28)             header("Location: whitelist");
29)         }
30)     } elseif ($sure === false) {
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 11 months ago

31)         if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

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)
Hanno Böck Spaces between string conca...

Hanno Böck authored 11 months ago

38)         && !filter_var("x@" . $_POST['address'], FILTER_VALIDATE_EMAIL)) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

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);
Hanno Böck codingstyle, spaces between...

Hanno Böck authored 1 year ago

48)         $domain = substr($_POST['address'], $at + 1);
Hanno 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']);
Hanno Böck Fix not operator (!) spaces

Hanno Böck authored 11 months ago

52)     if (!$debugmode) {
Hanno Fix coding style with php-c...

Hanno authored 6 years ago

53)         header("Location: whitelist");
54)     }