Empty commit

This commit is contained in:
Git 2013-01-21 08:00:33 +00:00
parent 7526a46c47
commit 6482c1e4d9
5 changed files with 106 additions and 52 deletions

View File

@ -30,6 +30,7 @@
$PostID = $_POST['post']; $PostID = $_POST['post'];
$Key = $_POST['key']; $Key = $_POST['key'];
$SQLTime = sqltime(); $SQLTime = sqltime();
$DoPM = isset($_POST['pm']) ? $_POST['pm'] : 0;
// Mainly // Mainly
$DB->query("SELECT $DB->query("SELECT
@ -65,6 +66,15 @@
error(404,true); error(404,true);
} }
// Send a PM to the user to notify them of the edit
if($UserID != $AuthorID && $DoPM) {
$PMSubject = 'Your post #'.$PostID.' has been edited';
$PMurl = 'https://'.NONSSL_SITE_URL.'/forums.php?action=viewthread&postid='.$PostID.'#post'.$PostID;
$ProfLink = '[url=https://'.NONSSL_SITE_URL.'/user.php?id='.$UserID.']'.$LoggedUser['Username'].'[/url]';
$PMBody = 'One of your posts has been edited by '.$ProfLink.': [url]'.$PMurl.'[/url]';
Misc::send_pm($AuthorID,0,$PMSubject,$PMBody,$ConvID='');
}
// Perform the update // Perform the update
$DB->query("UPDATE forums_posts SET $DB->query("UPDATE forums_posts SET
Body = '$Body', Body = '$Body',

View File

@ -101,6 +101,10 @@
case 'eb_alter': case 'eb_alter':
include('managers/eb_alter.php'); include('managers/eb_alter.php');
break; break;
case 'eb_search':
include('managers/eb_search.php');
break;
case 'dnu': case 'dnu':
include('managers/dnu_list.php'); include('managers/dnu_list.php');

View File

@ -3,7 +3,7 @@
if (!check_perms('users_view_email')) { if (!check_perms('users_view_email')) {
error(403); error(403);
} }
list($Page, $Limit) = Format::page_limit(EMAILS_PER_PAGE); list ($Page, $Limit) = Format::page_limit(EMAILS_PER_PAGE);
View::show_header('Manage email blacklist'); View::show_header('Manage email blacklist');
$DB->query("SELECT $DB->query("SELECT
@ -17,69 +17,61 @@
ORDER BY eb.Time DESC LIMIT $Limit"); ORDER BY eb.Time DESC LIMIT $Limit");
$Results = $DB->to_array(false, MYSQLI_ASSOC, false); $Results = $DB->to_array(false, MYSQLI_ASSOC, false);
$DB->query("SELECT FOUND_ROWS()"); $DB->query("SELECT FOUND_ROWS()");
list($NumResults) = $DB->next_record(); list ($NumResults) = $DB->next_record();
?> ?>
<div class="header"> <div class="header">
<h2>Email Blacklist</h2> <h2>Email Blacklist</h2>
</div> </div>
<div class="linkbox pager"> <div class="linkbox pager">
<br /> <br />
<? <?
$Pages = Format::get_pages($Page, $NumResults, TOPICS_PER_PAGE, 9); $Pages = Format::get_pages($Page, $NumResults, TOPICS_PER_PAGE, 9);
echo $Pages; echo $Pages;
?> ?>
</div> </div>
<table> <table>
<tr class="colhead"> <tr class="colhead">
<td>Email</td> <td>Email</td>
<td>Comment</td> <td>Comment</td>
<td>Added</td> <td>Added</td>
<td>Submit</td> <td>Submit</td>
</tr> </tr>
<tr class="colhead"> <tr class="colhead">
<td colspan="4">Add Email or Domain to Blacklist</td> <td colspan="4">Add Email or Domain to Blacklist</td>
</tr> </tr>
<tr class="rowa"> <tr class="rowa">
<form class="add_form" name="email_blacklist" action="tools.php" method="post"> <form class="add_form" name="email_blacklist" action="tools.php"
<input type="hidden" name="action" value="eb_alter"/> method="post">
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>"/> <input type="hidden" name="action" value="eb_alter" /> <input
<td> type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="text" name="email" size="30"/> <td><input type="text" name="email" size="30" /></td>
</td> <td colspan="2"><input type="text" name="comment" size="60" /></td>
<td colspan="2"> <td><input type="submit" value="Create" /></td>
<input type="text" name="comment" size="60"/> </form>
</td> </tr>
<td> <?
<input type="submit" value="Create"/>
</td> foreach ($Results as $Result) {
</form> ?>
</tr>
<? foreach($Results as $Result) {
?>
<tr> <tr>
<form class="manage_form" name="email_blacklist" action="tools.php" method="post"> <form class="manage_form" name="email_blacklist" action="tools.php"
<td> method="post">
<input type="hidden" name="action" value="eb_alter"/> <td><input type="hidden" name="action" value="eb_alter" /> <input
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>"/> type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" /> <input
<input type="hidden" name="id" value="<?=$Result['ID']?>"/> type="hidden" name="id" value="<?=$Result['ID']?>" /> <input
<input type="text" name="email" value="<?=display_str($Result['Email'])?>" size="30"/> type="text" name="email" value="<?=display_str($Result['Email'])?>"
</td> size="30" /></td>
<td> <td><input type="text" name="comment"
<input type="text" name="comment" value="<?=display_str($Result['Comment'])?>" size="60"/> value="<?=display_str($Result['Comment'])?>" size="60" /></td>
</td> <td><?=Users::format_username($Result ['UserID'], false, false, false)?><br /><?=time_diff($Result ['Time'], 1)?></td>
<td><?=Users::format_username($Result['UserID'], false, false, false) <td><input type="submit" name="submit" value="Edit" /> <input
?><br /><?=time_diff($Result['Time'], 1) type="submit" name="submit" value="Delete" /></td>
?></td> </form>
<td> </tr>
<input type="submit" name="submit" value="Edit"/>
<input type="submit" name="submit" value="Delete"/>
</td>
</form>
</tr>
<? }?> <? }?>
</table> </table>
<div class="linkbox pager"> <div class="linkbox pager">
<br /> <br />
<?=$Pages?> <?=$Pages?>
</div> </div>
<? View::show_footer(); ?> <? View::show_footer(); ?>

View File

@ -0,0 +1,41 @@
<?
$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();

View File

@ -39,10 +39,16 @@ function Edit_Form(post,key) {
} else { } else {
boxWidth="80"; boxWidth="80";
} }
postuserid = jQuery('#post' + postid + ' strong a').attr('href').split('=')[1];
if (postuserid != userid) {
pmbox = '<span id="pmbox'+postid+'">PM user on edit? <input type="checkbox" name="pm" value="1" /></span>';
} else {
pmbox = '';
};
$('#bar' + postid).raw().cancel = $('#content' + postid).raw().innerHTML; $('#bar' + postid).raw().cancel = $('#content' + postid).raw().innerHTML;
$('#bar' + postid).raw().oldbar = $('#bar' + postid).raw().innerHTML; $('#bar' + postid).raw().oldbar = $('#bar' + postid).raw().innerHTML;
$('#content' + postid).raw().innerHTML = "<div id=\"preview" + postid + "\"></div><form id=\"form" + postid + "\" method=\"post\" action=\"\"><input type=\"hidden\" name=\"auth\" value=\"" + authkey + "\" /><input type=\"hidden\" name=\"key\" value=\"" + key + "\" /><input type=\"hidden\" name=\"post\" value=\"" + postid + "\" /><textarea id=\"editbox" + postid + "\" onkeyup=\"resize('editbox" + postid + "');\" name=\"body\" cols=\""+boxWidth+"\" rows=\"10\"></textarea></form>"; $('#content' + postid).raw().innerHTML = "<div id=\"preview" + postid + "\"></div><form id=\"form" + postid + "\" method=\"post\" action=\"\">"+pmbox+"<input type=\"hidden\" name=\"auth\" value=\"" + authkey + "\" /><input type=\"hidden\" name=\"key\" value=\"" + key + "\" /><input type=\"hidden\" name=\"post\" value=\"" + postid + "\" /><textarea id=\"editbox" + postid + "\" onkeyup=\"resize('editbox" + postid + "');\" name=\"body\" cols=\""+boxWidth+"\" rows=\"10\"></textarea></form>";
$('#bar' + postid).raw().innerHTML = "<input type=\"button\" value=\"Preview\" onclick=\"Preview_Edit(" + postid + ");\" /><input type=\"button\" value=\"Post\" onclick=\"Save_Edit(" + postid + ")\" /><input type=\"button\" value=\"Cancel\" onclick=\"Cancel_Edit(" + postid + ");\" />"; $('#bar' + postid).raw().innerHTML = '<input type="button" value="Preview" onclick="Preview_Edit(' + postid + ');" /><input type="button" value="Post" onclick="Save_Edit(' + postid + ')" /><input type="button" value="Cancel" onclick="Cancel_Edit(' + postid + ');" />';
ajax.get("?action=get_post&post=" + postid, function(response){ ajax.get("?action=get_post&post=" + postid, function(response){
$('#editbox' + postid).raw().value = html_entity_decode(response); $('#editbox' + postid).raw().value = html_entity_decode(response);
resize('editbox' + postid); resize('editbox' + postid);
@ -76,6 +82,7 @@ function Save_Edit(postid) {
$('#bar' + postid).raw().innerHTML = "<a href=\"reports.php?action=report&amp;type=post&amp;id="+postid+"\">[Report]</a>&nbsp;<a href=\"#\">&uarr;</a>"; $('#bar' + postid).raw().innerHTML = "<a href=\"reports.php?action=report&amp;type=post&amp;id="+postid+"\">[Report]</a>&nbsp;<a href=\"#\">&uarr;</a>";
$('#preview' + postid).raw().innerHTML = response; $('#preview' + postid).raw().innerHTML = response;
$('#editbox' + postid).hide(); $('#editbox' + postid).hide();
$('#pmbox' + postid).hide();
}); });
} else if (location.href.match(/collages?\.php/)) { } else if (location.href.match(/collages?\.php/)) {
ajax.post("collages.php?action=takeedit_comment","form" + postid, function (response) { ajax.post("collages.php?action=takeedit_comment","form" + postid, function (response) {