6e6b6d2f074d7b478a3e6b19c3aa6df1ecdea586
bernd Neues Modul: Kann greylisti...

bernd authored 16 years ago

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&amp;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)
bernd eliminate .php extensions f...

bernd authored 15 years ago

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

bernd authored 16 years ago

21)   }
22)   elseif ($sure === false)
23)   {
24)     if (! $debugmode)
bernd eliminate .php extensions f...

bernd authored 15 years ago

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

bernd authored 16 years ago

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

bernd authored 15 years ago

47) 		header("Location: whitelist");