2 include_once('../slack.php');
3 include_once('security.php');
4 include_once('/var/www/secure.php'); //outside webserver
5 include_once('functions.php');
6 if ($_COOKIE['level'] == 'user'){
7 slack_general('ADMIN: Redirect User Home ('.$_COOKIE['name'].') ('.$_COOKIE['level'].')','md-petition');
8 header('Location: user_home.php');
10 if ($_COOKIE['level'] == 'manager'){
11 slack_general('ADMIN: Redirect Manager Home ('.$_COOKIE['name'].') ('.$_COOKIE['level'].')','md-petition');
12 header('Location: manager_home.php');
14 if (isset($_GET['flag_invalid_signature'])){
15 $id = $_GET['flag_invalid_signature'];
16 $petition->query("update signatures set signature_status = 'flag_invalid_signature' where id = '$id' ");
17 header('Location: abuse.php');
19 if (isset($_GET['flag_duplicate'])){
20 $id = $_GET['flag_duplicate'];
21 $petition->query("update signatures set signature_status = 'flag_duplicate' where id = '$id' ");
22 header('Location: abuse.php');
24 if (isset($_GET['flag_ip_address'])){
25 $ip = $_GET['flag_ip_address'];
26 $petition->query("update signatures set signature_status = 'flag_ip_address' where ip_address = '$ip' ");
27 header('Location: abuse.php');
29 if (isset($_GET['resign_requested'])){
30 $id = $_GET['resign_requested'];
31 $petition->query("update signatures set signature_status = 'resign_requested' where id = '$id' ");
32 header('Location: abuse.php');
34 if (isset($_GET['bot'])){
36 $petition->query("update signatures set signature_status = 'bot' where id = '$id' ");
37 header('Location: abuse.php');
39 if (isset($_GET['flag_VTRID'])){
40 $VTRID = $_GET['flag_VTRID'];
41 $petition->query("update signatures set signature_status = 'flag_VTRID' where VTRID = '$VTRID' ");
42 header('Location: abuse.php');
44 if (isset($_GET['flag_phone'])){
45 $flag_phone = $_GET['flag_phone'];
46 $petition->query("update signatures set signature_status = 'flag_phone' where contact_phone = '$flag_phone' ");
47 header('Location: abuse.php');
49 include_once('header.php');
50 if (isset($_GET['ip_address'])){
51 $ip = $_GET['ip_address'];
52 echo "<h1>Review $ip</h1><table width='100%' border='1' cellpadding='5' cellspacing='5'>";
53 $q = "SELECT * FROM signatures where ip_address = '$ip' order by signature_status desc ";
54 $r = $petition->query($q);
55 while($d = mysqli_fetch_array($r)){
57 $pos = strpos($d['date_time_signed'], date('Y-m-d'));
61 echo "<tr style='background-color:$color;'>
62 <td><b>$d[date_time_signed]</b></td>
63 <td><a href='?VTRID=$d[VTRID]'>$d[VTRID]</a></td>
64 <td>".id2petition($d['petition_id'])."</td>
65 <td>$d[signed_name_as]</td>
66 <td>$d[signed_name_as_circulator]</td>
67 <td>$d[contact_phone]</td>
68 <td>$d[signature_status]</td>
69 <td>$d[printed_status]</td>
70 <td><a href='?flag_invalid_signature=$d[id]'>flag invalid signature</a></td>
71 <td><a href='?flag_VTRID=$d[VTRID]'>flag VTRID</a></td>
72 <td><a href='?flag_ip_address=$d[ip_address]'>flag ip address</a></td>
73 <td><a href='?flag_duplicate=$d[id]'>flag duplicate</a></td>
74 <td><a href='?flag_phone=$d[contact_phone]'>contact phone</a></td>
75 <td><a href='?resign_requested=$d[id]'>resign requested</a></td>
76 <td><a href='?bot=$d[id]'>bot</a></td>
80 }elseif (isset($_GET['VTRID'])){
81 $VTRID = $_GET['VTRID'];
82 echo "<h1>Review $VTRID</h1><table width='100%' border='1' cellpadding='5' cellspacing='5'>";
83 $q = "SELECT * FROM signatures where VTRID = '$VTRID' and signature_status = 'verified' order by petition_id, id DESC ";
84 $r = $petition->query($q);
85 while($d = mysqli_fetch_array($r)){
87 $pos = strpos($d['date_time_signed'], date('Y-m-d'));
91 echo "<tr style='background-color:$color;'>
92 <td><b>$d[date_time_signed]</b></td>
93 <td><a href='?ip_address=$d[ip_address]'>$d[ip_address]</a></td>
94 <td>".id2petition($d['petition_id'])."</td>
95 <td>$d[signed_name_as]</td>
96 <td>$d[signed_name_as_circulator]</td>
97 <td>$d[contact_phone]</td>
98 <td>$d[signature_status]</td>
99 <td>$d[printed_status]</td>
100 <td><a href='?flag_invalid_signature=$d[id]'>flag invalid signature</a></td>
101 <td><a href='?flag_VTRID=$d[VTRID]'>flag VTRID</a></td>
102 <td><a href='?flag_ip_address=$d[ip_address]'>flag ip address</a></td>
103 <td><a href='?flag_duplicate=$d[id]'>flag duplicate</a></td>
104 <td><a href='?flag_phone=$d[contact_phone]'>contact phone</a></td>
105 <td><a href='?resign_requested=$d[id]'>resign requested</a></td>
106 <td><a href='?bot=$d[id]'>bot</a></td>
119 <div
>Watch
for duplicates
.</div
><ol
>
121 $q="SELECT ip_address, petition_id,VTRID, COUNT(*) as count FROM signatures where signature_status = 'verified' group by ip_address, petition_id, VTRID";
122 $r = $petition->query($q);
123 while($d = mysqli_fetch_array($r)){
124 if ($d['count'] > 1){
125 echo "<li><a href='?ip_address=$d[ip_address]'>$d[ip_address]</a> <a target='_Blank' href='https://ipinfo.io/$d[ip_address]'>IP INFO</a> <a href='?VTRID=$d[VTRID]'>$d[VTRID]</a> $d[petition_id] <b>$d[count]</b> $d[signed_name_as]</li>";
129 </td
><td valign
="top">
131 <div
>Watch
for duplicates
.</div
><ol
>
133 $q="SELECT VTRID, petition_id, COUNT(*) as count FROM signatures where signature_status = 'verified' group by VTRID, petition_id";
134 $r = $petition->query($q);
135 while($d = mysqli_fetch_array($r)){
136 if ($d['count'] > 1){
137 echo "<li><a href='?VTRID=$d[VTRID]'>$d[VTRID]</a> $d[petition_id] <b>$d[count]</b> $d[signed_name_as]</li>";
141 </td
></tr
><tr
><td valign
="top">
143 <div
>Watch
for 0</div
><ol
>
145 $q="SELECT * FROM signatures where VTRID = '0' and signature_status <> 'bot' and signature_status <> 'flag_invalid_signature' and signature_status <> 'resign_requested'";
146 $r = $petition->query($q);
147 while($d = mysqli_fetch_array($r)){
148 echo "<li>$d[date_time_signed] <a href='?ip_address=$d[ip_address]'>$d[ip_address]</a> <a target='_Blank' href='https://ipinfo.io/$d[ip_address]'>IP INFO</a> $d[petition_id] $d[signed_name_as]</li>";
151 </td
><td valign
="top">
153 <div
>Watch
for 0</div
><ol
>
155 $q="SELECT * FROM signatures where (petition_id = '0' or petition_id = '') and signature_status <> 'bot' and signature_status <> 'flag_invalid_signature' and signature_status <> 'resign_requested'";
156 $r = $petition->query($q);
157 while($d = mysqli_fetch_array($r)){
158 echo "<li>$d[date_time_signed] <a href='?ip_address=$d[ip_address]'>$d[ip_address]</a> <a target='_Blank' href='https://ipinfo.io/$d[ip_address]'>IP INFO</a> $d[petition_id] $d[signed_name_as]</li>";
161 </td
></tr
><tr
><td valign
="top">
162 <h2
>resign_requested
</h2
>
163 <div
>These are most likely from early bugs
</div
><ol
>
165 $q="SELECT * FROM signatures where signature_status = 'resign_requested' order by ip_address";
166 $r = $petition->query($q);
167 while($d = mysqli_fetch_array($r)){
168 echo "<li>$d[date_time_signed] <a href='?ip_address=$d[ip_address]'>$d[ip_address]</a> <a target='_Blank' href='https://ipinfo.io/$d[ip_address]'>IP INFO</a> <a href='?VTRID=$d[VTRID]'>$d[VTRID]</a> $d[petition_id] $d[signed_name_as]</li>";
175 <div
>These are bots on the site
.</div
><ol
>
177 $q="SELECT * FROM signatures where signature_status = 'bot' order by ip_address";
178 $r = $petition->query($q);
179 while($d = mysqli_fetch_array($r)){
180 echo "<li>$d[date_time_signed] <a href='?ip_address=$d[ip_address]'>$d[ip_address]</a> <a target='_Blank' href='https://ipinfo.io/$d[ip_address]'>IP INFO</a> <a href='?VTRID=$d[VTRID]'>$d[VTRID]</a> $d[petition_id] $d[signed_name_as]</li>";
190 <div
>last
0-10</div
><ol
>
192 $q="SELECT * FROM signatures order by id desc limit 0, 10";
193 $r = $petition->query($q);
194 while($d = mysqli_fetch_array($r)){
195 echo "<li>$d[date_time_signed] <a href='?ip_address=$d[ip_address]'>$d[ip_address]</a> <a target='_Blank' href='https://ipinfo.io/$d[ip_address]'>IP INFO</a> <a href='?VTRID=$d[VTRID]'>$d[VTRID]</a> ".id2petition($d['petition_id'])." $d[signed_name_as]</li>";
201 <div
>last
10-20</div
><ol
>
203 $q="SELECT * FROM signatures order by id desc limit 10, 10";
204 $r = $petition->query($q);
205 while($d = mysqli_fetch_array($r)){
206 echo "<li>$d[date_time_signed] <a href='?ip_address=$d[ip_address]'>$d[ip_address]</a> <a target='_Blank' href='https://ipinfo.io/$d[ip_address]'>IP INFO</a> <a href='?VTRID=$d[VTRID]'>$d[VTRID]</a> ".id2petition($d['petition_id'])." $d[signed_name_as]</li>";
216 include_once('footer.php');