c208bd906b3991555db11b9229846c4601ca408c
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) 
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) 
bernd Neues Modul: Kann greylisti...

bernd authored 16 years ago

17) require_once('inc/debug.php');
18) require_once('inc/security.php');
19) 
20) require_once('greylisting.php');
21) 
22) 
23) if ($_GET['action'] == 'delete')
24) {
25)   $entry = get_whitelist_details($_GET['id']);
26)   $sure = user_is_sure();
27)   if ($sure === NULL)
28)   {
bernd * alle internen Links sinnv...

bernd authored 15 years ago

29)     are_you_sure("action=delete&id={$entry['id']}", "Möchten Sie die E-Mail-Adresse »{$entry['local']}@{$entry['domain']}« von der Ausnahmeliste entfernen?");
bernd Neues Modul: Kann greylisti...

bernd authored 16 years ago

30)   }
31)   elseif ($sure === true)
32)   {
33)     delete_from_whitelist($entry['id']);
34)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 16 years ago

35)       header("Location: whitelist");
bernd Neues Modul: Kann greylisti...

bernd authored 16 years ago

36)   }
37)   elseif ($sure === false)
38)   {
39)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 16 years ago

40)       header("Location: whitelist");
bernd Neues Modul: Kann greylisti...

bernd authored 16 years ago

41)   }
42) }
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)	
bernd eliminate .php extensions f...

bernd authored 16 years ago

62) 		header("Location: whitelist");