-
Notifications
You must be signed in to change notification settings - Fork 1
/
list.php
executable file
·113 lines (97 loc) · 3.87 KB
/
list.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
require_once('config.php');
require_once('db.php');
$db = new db($dbLang, $dbName);
$header_location = "Location: " . $baseUrl . "login.php";
$rights = checklogin($access);
$usr_id = -1;
if ($gCurrentUser)
$usr_id = $gCurrentUser->getValue('usr_id');
if (!($rights > 0))
{
header("$header_location");
}
if(isset($_POST['delete'])) {
if(!isset($_POST['email']) || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
$error = "Ein Fehler beim Löschen ist aufgetreten!";
goto end;
}
$db->query("DELETE FROM users WHERE email = '{$_POST['email']}' AND prefs & $rights");
}
if ($rights & 1)
$rights = 1;
$users = $db->query("SELECT * FROM users WHERE prefs & $rights;");
end:
$db->close();
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="utf-8">
<title>Piraten-Newsletter</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Hier können sich Interessenten und Mitglieder für den Newsletter der Piratenpartei Österreichs anmelden.">
<meta name="author" content="Piratenpartei Österreichs">
<!-- Le styles -->
<link href="css/bootstrap.css" rel="stylesheet">
<style type="text/css">
body {
background-color: #4c2582;
padding-top: 60px;
padding-bottom: 40px;
}
footer {
color: white;
}
<?php echo $display;?>
</style>
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<!-- Fav and touch icons
<link rel="shortcut icon" href="ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="ico/apple-touch-icon-57-precomposed.png">-->
</head>
<body>
<div class="container">
<div class="row">
<div class="span12">
<div id="list_view" class="well">
<h1>Teilnehmer-Liste</h1>
<p>
<table class="table">
<tr><td>Adresse</td><td>Präferenzen</td><td>Bestätigt</td><td>Anmeldung</td><td>Optionen</td></tr>
<?php
foreach ($users as $user)
{
echo '<tr><td><a href="mailto:' . $user['email'] . '">' . $user['email'] . '</a></td><td>' . implode(', ', decodePrefs($user['prefs'])) . '</td><td>' . ($user['confirmed'] != 'f' && $user['confirmed'] != 0 ? 'Ja' : 'Nein') . '</td><td>' . date('d.m.Y',strtotime($user['creation'])) . '</td><td><form action="list.php" method="POST"><input type="hidden" name="email" value="' . $user['email'] . '" /><input type="submit" name="delete" value="Abmelden" class="btn btn-danger"/></form></td></tr>';
}
?>
</table>
</p>
</div>
</div><!--/span-->
</div><!--/row-->
<footer>
<p><a href="https://wiki.piratenpartei.at/wiki/Piratenwiki:Impressum">Impressum</a></p>
</footer>
</div><!--/.fluid-container-->
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/jquery.js"></script>
<script src="js/bootstrap-transition.js"></script>
<script src="js/bootstrap-alert.js"></script>
<script src="js/bootstrap-modal.js"></script>
<script src="js/bootstrap-dropdown.js"></script>
<script src="js/bootstrap-scrollspy.js"></script>
<script src="js/bootstrap-tab.js"></script>
<script src="js/bootstrap-tooltip.js"></script>
<script src="js/bootstrap-popover.js"></script>
<script src="js/bootstrap-button.js"></script>
<script src="js/bootstrap-collapse.js"></script>
<script src="js/bootstrap-carousel.js"></script>
<script src="js/bootstrap-typeahead.js"></script>
</body>
</html>