mirror of
https://github.com/WhatCD/Gazelle.git
synced 2025-01-19 04:31:36 +00:00
Empty commit
This commit is contained in:
parent
0c52e30873
commit
5f916db48e
@ -645,7 +645,7 @@ function authorize($Ajax = false) {
|
|||||||
// ex: 'somefile,somdire/somefile'
|
// ex: 'somefile,somdire/somefile'
|
||||||
|
|
||||||
function show_header($PageTitle='',$JSIncludes='') {
|
function show_header($PageTitle='',$JSIncludes='') {
|
||||||
global $Document, $Cache, $DB, $LoggedUser, $Mobile;
|
global $Document, $Cache, $DB, $LoggedUser, $Mobile, $Classes;
|
||||||
|
|
||||||
if($PageTitle!='') { $PageTitle.=' :: '; }
|
if($PageTitle!='') { $PageTitle.=' :: '; }
|
||||||
$PageTitle .= SITE_NAME;
|
$PageTitle .= SITE_NAME;
|
||||||
@ -2174,7 +2174,7 @@ function freeleech_torrents($TorrentIDs, $FreeNeutral = 1, $FreeLeechType = 0) {
|
|||||||
update_tracker('update_torrent', array('info_hash' => rawurlencode($InfoHash), 'freetorrent' => $FreeNeutral));
|
update_tracker('update_torrent', array('info_hash' => rawurlencode($InfoHash), 'freetorrent' => $FreeNeutral));
|
||||||
$Cache->delete_value('torrent_download_'.$TorrentID);
|
$Cache->delete_value('torrent_download_'.$TorrentID);
|
||||||
write_log($LoggedUser['Username']." marked torrent ".$TorrentID." freeleech type ".$FreeLeechType."!");
|
write_log($LoggedUser['Username']." marked torrent ".$TorrentID." freeleech type ".$FreeLeechType."!");
|
||||||
write_group_log($GroupID, $TorrentID, $LoggedUser['UserID'], "marked as freeleech type ".$FreeLeechType."!", 0);
|
write_group_log($GroupID, $TorrentID, $LoggedUser['ID'], "marked as freeleech type ".$FreeLeechType."!", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($GroupIDs as $GroupID) {
|
foreach($GroupIDs as $GroupID) {
|
||||||
|
@ -263,7 +263,7 @@
|
|||||||
|
|
||||||
$NumStaffPMs = $Cache->get_value('num_staff_pms_'.$LoggedUser['ID']);
|
$NumStaffPMs = $Cache->get_value('num_staff_pms_'.$LoggedUser['ID']);
|
||||||
if ($NumStaffPMs === false) {
|
if ($NumStaffPMs === false) {
|
||||||
$DB->query("SELECT COUNT(ID) FROM staff_pm_conversations WHERE Status='Unanswered' AND (AssignedToUser=".$LoggedUser['ID']." OR Level=".$LoggedUser['Class'].")");
|
$DB->query("SELECT COUNT(ID) FROM staff_pm_conversations WHERE Status='Unanswered' AND (AssignedToUser=".$LoggedUser['ID']." OR (Level >= ".$Classes[MOD]['Level']." AND Level <=".$LoggedUser['Class']."))");
|
||||||
list($NumStaffPMs) = $DB->next_record();
|
list($NumStaffPMs) = $DB->next_record();
|
||||||
$Cache->cache_value('num_staff_pms_'.$LoggedUser['ID'], $NumStaffPMs , 1000);
|
$Cache->cache_value('num_staff_pms_'.$LoggedUser['ID'], $NumStaffPMs , 1000);
|
||||||
}
|
}
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
include(SERVER_ROOT.'/classes/class_validate.php');
|
include(SERVER_ROOT.'/classes/class_validate.php');
|
||||||
|
|
||||||
$Val=NEW VALIDATE;
|
$Val=NEW VALIDATE;
|
||||||
|
|
||||||
if(!empty($_REQUEST['confirm'])) {
|
if(!empty($_REQUEST['confirm'])) {
|
||||||
@ -187,6 +188,8 @@
|
|||||||
send_email($_REQUEST['email'],'New account confirmation at '.SITE_NAME,$TPL->get(),'noreply');
|
send_email($_REQUEST['email'],'New account confirmation at '.SITE_NAME,$TPL->get(),'noreply');
|
||||||
update_tracker('add_user', array('id' => $UserID, 'passkey' => $torrent_pass));
|
update_tracker('add_user', array('id' => $UserID, 'passkey' => $torrent_pass));
|
||||||
$Sent=1;
|
$Sent=1;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} elseif($_GET['invite']) {
|
} elseif($_GET['invite']) {
|
||||||
|
@ -182,7 +182,8 @@
|
|||||||
list($GroupID) = $DB->next_record();
|
list($GroupID) = $DB->next_record();
|
||||||
delete_torrent($TorrentID);
|
delete_torrent($TorrentID);
|
||||||
write_log($Log);
|
write_log($Log);
|
||||||
write_group_log($GroupID, $TorrentID, $LoggedUser['ID'], "deleted torrent", 0);
|
$Log = "deleted torrent for the reason: ".$ResolveType['title'].". ( ".$Escaped['log_message']." )";
|
||||||
|
write_group_log($GroupID, $TorrentID, $LoggedUser['ID'], $Log, 0);
|
||||||
} else {
|
} else {
|
||||||
$Log = "No log message (Torrent wasn't deleted)";
|
$Log = "No log message (Torrent wasn't deleted)";
|
||||||
}
|
}
|
||||||
|
@ -1,66 +1,69 @@
|
|||||||
<?
|
<?
|
||||||
enforce_login();
|
enforce_login();
|
||||||
|
|
||||||
if(!isset($_REQUEST['action']))
|
if(!isset($_REQUEST['action']))
|
||||||
$_REQUEST['action'] = '';
|
$_REQUEST['action'] = '';
|
||||||
|
|
||||||
// Get user level
|
// Get user level
|
||||||
$DB->query("
|
$DB->query("
|
||||||
SELECT
|
SELECT
|
||||||
i.SupportFor,
|
i.SupportFor,
|
||||||
p.DisplayStaff
|
p.DisplayStaff
|
||||||
FROM users_info as i
|
FROM users_info as i
|
||||||
JOIN users_main as m ON m.ID = i.UserID
|
JOIN users_main as m ON m.ID = i.UserID
|
||||||
JOIN permissions as p ON p.ID = m.PermissionID
|
JOIN permissions as p ON p.ID = m.PermissionID
|
||||||
WHERE i.UserID = ".$LoggedUser['ID']
|
WHERE i.UserID = ".$LoggedUser['ID']
|
||||||
);
|
);
|
||||||
list($SupportFor, $DisplayStaff) = $DB->next_record();
|
list($SupportFor, $DisplayStaff) = $DB->next_record();
|
||||||
// Logged in user is staff
|
// Logged in user is staff
|
||||||
$IsStaff = ($DisplayStaff == 1);
|
$IsStaff = ($DisplayStaff == 1);
|
||||||
// Logged in user is Staff or FLS
|
// Logged in user is Staff or FLS
|
||||||
$IsFLS = ($SupportFor != '' || $IsStaff);
|
$IsFLS = ($SupportFor != '' || $IsStaff);
|
||||||
|
|
||||||
switch($_REQUEST['action']) {
|
switch($_REQUEST['action']) {
|
||||||
case 'viewconv':
|
case 'viewconv':
|
||||||
require('viewconv.php');
|
require('viewconv.php');
|
||||||
break;
|
break;
|
||||||
case 'takepost':
|
case 'takepost':
|
||||||
require('takepost.php');
|
require('takepost.php');
|
||||||
break;
|
break;
|
||||||
case 'resolve':
|
case 'resolve':
|
||||||
require('resolve.php');
|
require('resolve.php');
|
||||||
break;
|
break;
|
||||||
case 'unresolve':
|
case 'unresolve':
|
||||||
require('unresolve.php');
|
require('unresolve.php');
|
||||||
break;
|
break;
|
||||||
case 'multiresolve':
|
case 'multiresolve':
|
||||||
require('multiresolve.php');
|
require('multiresolve.php');
|
||||||
break;
|
break;
|
||||||
case 'assign':
|
case 'assign':
|
||||||
require('assign.php');
|
require('assign.php');
|
||||||
break;
|
break;
|
||||||
case 'responses':
|
case 'make_donor':
|
||||||
require('common_responses.php');
|
require('makedonor.php');
|
||||||
break;
|
break;
|
||||||
case 'get_response':
|
case 'responses':
|
||||||
require('ajax_get_response.php');
|
require('common_responses.php');
|
||||||
break;
|
break;
|
||||||
case 'delete_response':
|
case 'get_response':
|
||||||
require('ajax_delete_response.php');
|
require('ajax_get_response.php');
|
||||||
break;
|
break;
|
||||||
case 'edit_response':
|
case 'delete_response':
|
||||||
require('ajax_edit_response.php');
|
require('ajax_delete_response.php');
|
||||||
break;
|
break;
|
||||||
case 'preview':
|
case 'edit_response':
|
||||||
require('ajax_preview_response.php');
|
require('ajax_edit_response.php');
|
||||||
break;
|
break;
|
||||||
default:
|
case 'preview':
|
||||||
if ($IsStaff || $IsFLS) {
|
require('ajax_preview_response.php');
|
||||||
require('staff_inbox.php');
|
break;
|
||||||
} else {
|
default:
|
||||||
require('user_inbox.php');
|
if ($IsStaff || $IsFLS) {
|
||||||
}
|
require('staff_inbox.php');
|
||||||
break;
|
} else {
|
||||||
}
|
require('user_inbox.php');
|
||||||
|
}
|
||||||
?>
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
43
sections/staffpm/makedonor.php
Normal file
43
sections/staffpm/makedonor.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?
|
||||||
|
if (!is_number($_GET['id'])) {
|
||||||
|
error(404);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!check_perms('users_give_donor')) {
|
||||||
|
error(403);
|
||||||
|
}
|
||||||
|
|
||||||
|
$ConvID = (int)$_GET['id'];
|
||||||
|
$DB->query("SELECT c.Subject, c.UserID, c.Level, c.AssignedToUser, c.Unread, c.Status, u.Donor
|
||||||
|
FROM staff_pm_conversations AS c
|
||||||
|
JOIN users_info AS u ON u.UserID = c.UserID
|
||||||
|
WHERE ID=$ConvID");
|
||||||
|
list($Subject, $UserID, $Level, $AssignedToUser, $Unread, $Status, $Donor) = $DB->next_record();
|
||||||
|
if ($DB->record_count() == 0) {
|
||||||
|
error(404);
|
||||||
|
}
|
||||||
|
|
||||||
|
$Message = "Thank for for helping to support the site. It's users like you who make all of this possible.";
|
||||||
|
|
||||||
|
if ((int)$Donor === 0) {
|
||||||
|
$Msg = db_string(sqltime() . ' - Donated: http://'.NONSSL_SITE_URL."/staffpm.php?action=viewconv&id=$ConvID\n\n");
|
||||||
|
$DB->query("UPDATE users_info
|
||||||
|
SET Donor='1',
|
||||||
|
AdminComment = CONCAT('$Msg',AdminComment)
|
||||||
|
WHERE UserID = $UserID");
|
||||||
|
$DB->query("UPDATE users_main SET Invites=Invites+2 WHERE ID = $UserID");
|
||||||
|
|
||||||
|
$Cache->delete_value('user_info_'.$UserID);
|
||||||
|
$Cache->delete_value('user_info_heavy_'.$UserID);
|
||||||
|
$Message .= " Enjoy your new love from us!";
|
||||||
|
} else {
|
||||||
|
$Message .= " ";
|
||||||
|
}
|
||||||
|
$DB->query("INSERT INTO staff_pm_messages (UserID, SentDate, Message, ConvID)
|
||||||
|
VALUES (".$LoggedUser['ID'].", '".sqltime()."', '".db_string($Message)."', $ConvID)");
|
||||||
|
$DB->query("UPDATE staff_pm_conversations
|
||||||
|
SET Date='".sqltime()."', Unread=true,
|
||||||
|
Status='Resolved', ResolverID=".$LoggedUser['ID']."
|
||||||
|
WHERE ID=$ConvID");
|
||||||
|
header('Location: staffpm.php');
|
||||||
|
?>
|
@ -26,7 +26,7 @@
|
|||||||
default:
|
default:
|
||||||
if ($IsStaff) {
|
if ($IsStaff) {
|
||||||
$ViewString = "My unanswered";
|
$ViewString = "My unanswered";
|
||||||
$WhereCondition = "WHERE (Level = $UserLevel OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Unanswered'";
|
$WhereCondition = "WHERE ((Level >= ".$Classes[MOD]['Level']." AND Level <= $UserLevel) OR AssignedToUser='".$LoggedUser['ID']."') AND Status='Unanswered'";
|
||||||
} else {
|
} else {
|
||||||
// FLS
|
// FLS
|
||||||
$ViewString = "Unanswered";
|
$ViewString = "Unanswered";
|
||||||
@ -51,7 +51,7 @@
|
|||||||
ResolverID
|
ResolverID
|
||||||
FROM staff_pm_conversations
|
FROM staff_pm_conversations
|
||||||
$WhereCondition
|
$WhereCondition
|
||||||
ORDER BY Date DESC
|
ORDER BY IF(AssignedToUser = ".$LoggedUser['ID'].",0,1) ASC, Level DESC, Date DESC
|
||||||
LIMIT $Limit
|
LIMIT $Limit
|
||||||
");
|
");
|
||||||
|
|
||||||
|
@ -1,73 +1,73 @@
|
|||||||
<?
|
<?
|
||||||
if ($Message = db_string($_POST['message'])) {
|
if ($Message = db_string($_POST['message'])) {
|
||||||
if ($Subject = db_string($_POST['subject'])) {
|
if ($Subject = db_string($_POST['subject'])) {
|
||||||
// New staff pm conversation
|
// New staff pm conversation
|
||||||
$Level = db_string($_POST['level']);
|
$Level = db_string($_POST['level']);
|
||||||
$DB->query("
|
$DB->query("
|
||||||
INSERT INTO staff_pm_conversations
|
INSERT INTO staff_pm_conversations
|
||||||
(Subject, Status, Level, UserID, Date)
|
(Subject, Status, Level, UserID, Date)
|
||||||
VALUES
|
VALUES
|
||||||
('$Subject', 'Unanswered', $Level, ".$LoggedUser['ID'].", '".sqltime()."')"
|
('$Subject', 'Unanswered', $Level, ".$LoggedUser['ID'].", '".sqltime()."')"
|
||||||
);
|
);
|
||||||
|
|
||||||
// New message
|
// New message
|
||||||
$ConvID = $DB->inserted_id();
|
$ConvID = $DB->inserted_id();
|
||||||
$DB->query("
|
$DB->query("
|
||||||
INSERT INTO staff_pm_messages
|
INSERT INTO staff_pm_messages
|
||||||
(UserID, SentDate, Message, ConvID)
|
(UserID, SentDate, Message, ConvID)
|
||||||
VALUES
|
VALUES
|
||||||
(".$LoggedUser['ID'].", '".sqltime()."', '$Message', $ConvID)"
|
(".$LoggedUser['ID'].", '".sqltime()."', '$Message', $ConvID)"
|
||||||
);
|
);
|
||||||
|
|
||||||
header('Location: staffpm.php');
|
header('Location: staffpm.php');
|
||||||
|
|
||||||
} elseif ($ConvID = (int)$_POST['convid']) {
|
} elseif ($ConvID = (int)$_POST['convid']) {
|
||||||
// Check if conversation belongs to user
|
// Check if conversation belongs to user
|
||||||
$DB->query("SELECT UserID, AssignedToUser FROM staff_pm_conversations WHERE ID=$ConvID");
|
$DB->query("SELECT UserID, AssignedToUser FROM staff_pm_conversations WHERE ID=$ConvID");
|
||||||
list($UserID, $AssignedToUser) = $DB->next_record();
|
list($UserID, $AssignedToUser) = $DB->next_record();
|
||||||
|
|
||||||
if ($UserID == $LoggedUser['ID'] || $IsFLS || $UserID == $AssignedToUser) {
|
if ($UserID == $LoggedUser['ID'] || $IsFLS || $UserID == $AssignedToUser) {
|
||||||
// Response to existing conversation
|
// Response to existing conversation
|
||||||
$DB->query("
|
$DB->query("
|
||||||
INSERT INTO staff_pm_messages
|
INSERT INTO staff_pm_messages
|
||||||
(UserID, SentDate, Message, ConvID)
|
(UserID, SentDate, Message, ConvID)
|
||||||
VALUES
|
VALUES
|
||||||
(".$LoggedUser['ID'].", '".sqltime()."', '$Message', $ConvID)"
|
(".$LoggedUser['ID'].", '".sqltime()."', '$Message', $ConvID)"
|
||||||
);
|
);
|
||||||
|
|
||||||
// Update conversation
|
// Update conversation
|
||||||
if ($IsFLS) {
|
if ($IsFLS) {
|
||||||
// FLS/Staff
|
// FLS/Staff
|
||||||
$DB->query("UPDATE staff_pm_conversations SET Date='".sqltime()."', Unread=true, Status='Open' WHERE ID=$ConvID");
|
$DB->query("UPDATE staff_pm_conversations SET Date='".sqltime()."', Unread=true, Status='Open' WHERE ID=$ConvID");
|
||||||
$Cache->delete_value('num_staff_pms_'.$LoggedUser['ID']);
|
$Cache->delete_value('num_staff_pms_'.$LoggedUser['ID']);
|
||||||
} else {
|
} else {
|
||||||
// User
|
// User
|
||||||
$DB->query("UPDATE staff_pm_conversations SET Date='".sqltime()."', Unread=true, Status='Unanswered' WHERE ID=$ConvID");
|
$DB->query("UPDATE staff_pm_conversations SET Date='".sqltime()."', Unread=true, Status='Unanswered' WHERE ID=$ConvID");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clear cache for user
|
// Clear cache for user
|
||||||
$Cache->delete_value('staff_pm_new_'.$UserID);
|
$Cache->delete_value('staff_pm_new_'.$UserID);
|
||||||
$Cache->delete_value('staff_pm_new_'.$LoggedUser['ID']);
|
$Cache->delete_value('staff_pm_new_'.$LoggedUser['ID']);
|
||||||
|
|
||||||
header("Location: staffpm.php?action=viewconv&id=$ConvID");
|
header("Location: staffpm.php?action=viewconv&id=$ConvID");
|
||||||
} else {
|
} else {
|
||||||
// User is trying to respond to conversation that does no belong to them
|
// User is trying to respond to conversation that does no belong to them
|
||||||
error(403);
|
error(403);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Message but no subject or conversation id
|
// Message but no subject or conversation id
|
||||||
header("Location: staffpm.php?action=viewconv&id=$ConvID");
|
header("Location: staffpm.php?action=viewconv&id=$ConvID");
|
||||||
|
|
||||||
}
|
}
|
||||||
} elseif ($ConvID = (int)$_POST['convid']) {
|
} elseif ($ConvID = (int)$_POST['convid']) {
|
||||||
// No message, but conversation id
|
// No message, but conversation id
|
||||||
header("Location: staffpm.php?action=viewconv&id=$ConvID");
|
header("Location: staffpm.php?action=viewconv&id=$ConvID");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// No message or conversation id
|
// No message or conversation id
|
||||||
header('Location: staffpm.php');
|
header('Location: staffpm.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@ -6,6 +6,8 @@
|
|||||||
// Get conversation info
|
// Get conversation info
|
||||||
$DB->query("SELECT Subject, UserID, Level, AssignedToUser, Unread, Status FROM staff_pm_conversations WHERE ID=$ConvID");
|
$DB->query("SELECT Subject, UserID, Level, AssignedToUser, Unread, Status FROM staff_pm_conversations WHERE ID=$ConvID");
|
||||||
list($Subject, $UserID, $Level, $AssignedToUser, $Unread, $Status) = $DB->next_record();
|
list($Subject, $UserID, $Level, $AssignedToUser, $Unread, $Status) = $DB->next_record();
|
||||||
|
$DB->query("SELECT Subject, UserID, Level, AssignedToUser, Unread, Status FROM staff_pm_conversations WHERE ID=$ConvID");
|
||||||
|
list($Subject, $UserID, $Level, $AssignedToUser, $Unread, $Status) = $DB->next_record();
|
||||||
|
|
||||||
if (!(($UserID == $LoggedUser['ID']) || ($AssignedToUser == $LoggedUser['ID']) || (($Level > 0 && $Level <= $LoggedUser['Class']) || ($Level == 0 && $IsFLS)))) {
|
if (!(($UserID == $LoggedUser['ID']) || ($AssignedToUser == $LoggedUser['ID']) || (($Level > 0 && $Level <= $LoggedUser['Class']) || ($Level == 0 && $IsFLS)))) {
|
||||||
// User is trying to view someone else's conversation
|
// User is trying to view someone else's conversation
|
||||||
@ -206,6 +208,10 @@
|
|||||||
<input type="submit" value="Send message" />
|
<input type="submit" value="Send message" />
|
||||||
<? } else { ?>
|
<? } else { ?>
|
||||||
<input type="button" value="Unresolve" onClick="location.href='staffpm.php?action=unresolve&id=<?=$ConvID?>';" />
|
<input type="button" value="Unresolve" onClick="location.href='staffpm.php?action=unresolve&id=<?=$ConvID?>';" />
|
||||||
|
<? }
|
||||||
|
if (check_perms('users_give_donor')) { ?>
|
||||||
|
<br />
|
||||||
|
<input type="button" value="Make Donor" onClick="location.href='staffpm.php?action=make_donor&id=<?=$ConvID?>';" />
|
||||||
<? } ?>
|
<? } ?>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user