mirror of
https://github.com/WhatCD/Gazelle.git
synced 2024-12-14 11:26:26 +00:00
41 lines
866 B
PHP
41 lines
866 B
PHP
|
<?
|
||
|
$Search = db_string($_GET['email']);
|
||
|
$JSON = array();
|
||
|
if (!check_perms('users_view_email') || empty($Search)) {
|
||
|
$JSON['status'] = "error";
|
||
|
echo json_encode($JSON);
|
||
|
exit();
|
||
|
}
|
||
|
else {
|
||
|
$JSON['status'] = "success";
|
||
|
}
|
||
|
|
||
|
$DB->query("SELECT
|
||
|
eb.ID,
|
||
|
eb.UserID,
|
||
|
eb.Time,
|
||
|
eb.Email,
|
||
|
eb.Comment
|
||
|
FROM email_blacklist AS eb
|
||
|
WHERE eb.Email LIKE '%$Search%'");
|
||
|
|
||
|
$EmailResults = $DB->to_array(false, MYSQLI_ASSOC, false);
|
||
|
|
||
|
$Results = array();
|
||
|
$Count = $DB->record_count();
|
||
|
$Results['count'] = $Count;
|
||
|
|
||
|
$Emails = array();
|
||
|
|
||
|
if ($Count > 0) {
|
||
|
foreach ($EmailResults as $Email) {
|
||
|
$Emails[] = array("id" => (int) $Email['ID'], "email" => $Email['Email'],
|
||
|
"comment" => $Email['Comment'], "userid" => (int) $Email['UserID'],
|
||
|
"time" => $Email['Time']);
|
||
|
}
|
||
|
}
|
||
|
$Results['emails'] = $Emails;
|
||
|
$JSON['results'] = $Results;
|
||
|
|
||
|
echo json_encode($JSON);
|
||
|
exit();
|