Empty commit

This commit is contained in:
Git 2013-11-13 08:00:59 +00:00
parent bef5cd9ec8
commit 01f0561cd3
3 changed files with 19 additions and 19 deletions

View File

@ -7,7 +7,7 @@
$Reason = $_POST['reason'];
$PrivateMessage = $_POST['privatemessage'];
$Body = $_POST['body'];
$Length = $_POST['length'];
$WarningLength = $_POST['length'];
$PostID = (int)$_POST['postid'];
$UserID = (int)$_POST['userid'];
$Key = (int)$_POST['key'];
@ -19,19 +19,19 @@
}
$URL = site_url() . "forums.php?action=viewthread&postid=$PostID#post$PostID";
if ($Length != 'verbal') {
$Time = ((int)$Length) * (7 * 24 * 60 * 60);
if ($WarningLength !== 'verbal') {
$Time = (int)$WarningLength * (7 * 24 * 60 * 60);
Tools::warn_user($UserID, $Time, "$URL - $Reason");
$Subject = 'You have received a warning';
$PrivateMessage = "You have received a $Length week warning for [url=$URL]this post[/url].\n\n" . $PrivateMessage;
$PrivateMessage = "You have received a $WarningLength week warning for [url=$URL]this post[/url].\n\n" . $PrivateMessage;
$WarnTime = time_plus($Time);
$AdminComment = date('Y-m-d') . " - Warned until $WarnTime by " . $LoggedUser['Username'] . " for $URL \nReason: $Reason\n\n";
$AdminComment = date('Y-m-d') . " - Warned until $WarnTime by " . $LoggedUser['Username'] . " for $URL\nReason: $Reason\n\n";
} else {
$Subject = 'You have received a verbal warning';
$PrivateMessage = "You have received a verbal warning for [url=$URL]this post[/url].\n\n" . $PrivateMessage;
$AdminComment = date('Y-m-d') . ' - Verbally warned by ' . $LoggedUser['Username'] . " for $URL \nReason: $Reason\n\n";
$AdminComment = date('Y-m-d') . ' - Verbally warned by ' . $LoggedUser['Username'] . " for $URL\nReason: $Reason\n\n";
Tools::update_user_notes($UserID, $AdminComment);
}

View File

@ -16,7 +16,6 @@
list($PostBody, $ForumID) = $DB -> next_record();
View::show_header('Warn User');
?>
<div class="thin">
<div class="header">
<h2>Warning <a href="user.php?id=<?=$UserID?>"><?=$UserInfo['Username']?></a></h2>
@ -31,26 +30,27 @@
<tr>
<td class="label">Reason:</td>
<td>
<input type="text" name="reason" size="60" />
<input type="text" name="reason" size="60" />
</td>
</tr>
<tr>
<td class="label">Length:</td>
<td>
<select name="length">
<option value="verbal">Verbal</option>
<option value="1">1 week</option>
<option value="2">2 weeks</option>
<option value="4">4 weeks</option>
<select name="length">
<option value="verbal">Verbal</option>
<option value="1">1 week</option>
<option value="2">2 weeks</option>
<option value="4">4 weeks</option>
<? if (check_perms('users_mod')) { ?>
<option value="8">8 weeks</option>
<option value="8">8 weeks</option>
<? } ?>
</select></td>
</select>
</td>
</tr>
<tr>
<td class="label">Private message:</td>
<td>
<textarea id="message" style="width: 95%;" tabindex="1" onkeyup="resize('message');" name="privatemessage" cols="90" rows="4"></textarea>
<textarea id="message" style="width: 95%;" tabindex="1" onkeyup="resize('message');" name="privatemessage" cols="90" rows="4"></textarea>
</td>
</tr>
<tr>

View File

@ -446,7 +446,7 @@
}
if ($Warned == 1 && $Cur['Warned'] == '0000-00-00 00:00:00' && check_perms('users_warn')) {
$Weeks = 'week' . $WarnLength === 1 ? '' : 's';
$Weeks = 'week' . ($WarnLength === 1 ? '' : 's');
Misc::send_pm($UserID, 0, 'You have received a warning', "You have been [url=".site_url()."wiki.php?action=article&amp;id=218]warned for $WarnLength {$Weeks}[/url] by [user]".$LoggedUser['Username']."[/user]. The reason given was:
[quote]{$WarnReason}[/quote]");
$UpdateSet[] = "Warned = '".sqltime()."' + INTERVAL $WarnLength WEEK";
@ -463,7 +463,7 @@
$LightUpdates['Warned'] = '0000-00-00 00:00:00';
} elseif ($Warned == 1 && $ExtendWarning != '---' && check_perms('users_warn')) {
$Weeks = 'week' . $ExtendWarning === 1 ? '' : 's';
$Weeks = 'week' . ($ExtendWarning === 1 ? '' : 's');
Misc::send_pm($UserID, 0, 'Your warning has been extended', "Your warning has been extended by $ExtendWarning $Weeks by [user]".$LoggedUser['Username']."[/user]. The reason given was:
[quote]{$WarnReason}[/quote]");
@ -481,7 +481,7 @@
$LightUpdates['Warned'] = $WarnedUntil;
} elseif ($Warned == 1 && $ExtendWarning == '---' && $ReduceWarning != '---' && check_perms('users_warn')) {
$Weeks = 'week' . $ReduceWarning === 1 ? '' : 's';
$Weeks = 'week' . ($ReduceWarning === 1 ? '' : 's');
Misc::send_pm($UserID, 0, 'Your warning has been reduced', "Your warning has been reduced by $ReduceWarning $Weeks by [user]".$LoggedUser['Username']."[/user]. The reason given was:
[quote]{$WarnReason}[/quote]");
$UpdateSet[] = "Warned = Warned - INTERVAL $ReduceWarning WEEK";