Empty commit

This commit is contained in:
Git 2013-11-23 08:01:14 +00:00
parent f2d5000e81
commit af4086f355
10 changed files with 60 additions and 31 deletions

View File

@ -8,7 +8,7 @@
$Cache = NEW CACHE($MemcachedServers); //Load the caching class
$Enc = NEW CRYPT; //Load the encryption class
$SSL = ($_SERVER['SERVER_PORT'] === '443');
$SSL = $_SERVER['SERVER_PORT'] === '443';
if (isset($_COOKIE['session'])) {
$LoginCookie = $Enc->decrypt($_COOKIE['session']);
@ -20,15 +20,15 @@
die('Not logged in!');
}
if (!$Enabled = $Cache->get_value('enabled_'.$UserID)) {
if (!$Enabled = $Cache->get_value("enabled_$UserID")) {
require(SERVER_ROOT.'/classes/mysql.class.php'); //Require the database wrapper
$DB=NEW DB_MYSQL; //Load the database wrapper
$DB = NEW DB_MYSQL; //Load the database wrapper
$DB->query("
SELECT Enabled
FROM users_main
WHERE ID='$UserID'");
WHERE ID = '$UserID'");
list($Enabled) = $DB->next_record();
$Cache->cache_value('enabled_'.$UserID, $Enabled, 0);
$Cache->cache_value("enabled_$UserID", $Enabled, 0);
}
} else {
die('Not logged in!');

View File

@ -1,5 +1,11 @@
CHANGE LOG
2013-11-23 by alderaan
Add a warning message when attempting to delete a personal collage
2013-11-23 by alderaan
Add collage recovery link to the Staff Toolbox
2013-11-09 by mcnellis
Set image max-width explicitly for each stylesheet.
Also added new classes for news_post, blog_post, wiki_article, torrent_comments, request_comments, artist information, and more

View File

@ -6,10 +6,10 @@
}
$DB->query("
SELECT Name, UserID
SELECT Name, CategoryID, UserID
FROM collages
WHERE ID = '$CollageID'");
list($Name, $UserID) = $DB->next_record();
list($Name, $CategoryID, $UserID) = $DB->next_record();
if (!check_perms('site_collages_delete') && $UserID != $LoggedUser['ID']) {
error(403);
@ -27,6 +27,15 @@
<input type="hidden" name="action" value="take_delete" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" name="collageid" value="<?=$CollageID?>" />
<?
if ($CategoryID == 0) {
?>
<div class="alertbar" style="margin-bottom: 1em;">
<strong>Warning: This is a personal collage. If you delete this collage, it <em>cannot</em> be recovered!</strong>
</div>
<?
}
?>
<div class="field_div">
<strong>Reason: </strong>
<input type="text" name="reason" size="40" />

View File

@ -35,7 +35,7 @@
<input type="hidden" name="action" value="recover" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<div class="field_div">
<strong>ID: </strong>
<strong>Collage ID: </strong>
<input type="text" name="collage_id" size="8" />
</div>
<div class="submit_div">
@ -45,5 +45,5 @@
</div>
</div>
</div>
<? View::show_footer();
<?
View::show_footer();

View File

@ -1,7 +1,6 @@
<?
authorize();
$CollageID = $_POST['collageid'];
if (!is_number($CollageID) || !$CollageID) {
error(404);
@ -34,8 +33,12 @@
//Personal collages have CategoryID 0
if ($CategoryID == 0) {
$DB->query("DELETE FROM collages WHERE ID = '$CollageID'");
$DB->query("DELETE FROM collages_torrents WHERE CollageID = '$CollageID'");
$DB->query("
DELETE FROM collages
WHERE ID = '$CollageID'");
$DB->query("
DELETE FROM collages_torrents
WHERE CollageID = '$CollageID'");
Comments::delete_page('collages', $CollageID);
} else {
$DB->query("

View File

@ -6,15 +6,6 @@
View::show_header($Title);
$Balance = DonationsBitcoin::get_balance() . ' BTC';
$BitcoinAddresses = DonationsBitcoin::get_received();
$Debug->log_var($BitcoinAddresses, 'Bitcoin addresses');
$UserQ = $DB->query("
SELECT i.UserID, i.BitcoinAddress
FROM users_info AS i
JOIN users_main AS m ON m.ID = i.UserID
WHERE BitcoinAddress != ''
ORDER BY m.Username ASC");
?>
<div class="header">
<h2><?=$Title?></h2>
@ -23,6 +14,20 @@
<div class="header">
<h3><?=$Balance?></h3>
</div>
<?
if (empty($_GET['list'])) {
?>
<a href="?action=<?=$_GET['action']?>&amp;list=1" class="brackets">Show donor list</a>
<?
} else {
$BitcoinAddresses = DonationsBitcoin::get_received();
$DB->query("
SELECT i.UserID, i.BitcoinAddress
FROM users_info AS i
JOIN users_main AS m ON m.ID = i.UserID
WHERE BitcoinAddress != ''
ORDER BY m.Username ASC");
?>
<table>
<tr class="colhead">
<th>Username</th>
@ -30,7 +35,7 @@
<th>Amount</th>
</tr>
<?
while (list($UserID, $BitcoinAddress) = $DB->next_record(MYSQLI_NUM, false)) {
while (list($UserID, $BitcoinAddress) = $DB->next_record(MYSQLI_NUM, false)) {
if (!isset($BitcoinAddresses[$BitcoinAddress])) {
continue;
}
@ -41,9 +46,11 @@
<td><?=$BitcoinAddresses[$BitcoinAddress]?> BTC</td>
</tr>
<?
$DB->set_query_id($UserQ);
}
}
?>
</table>
<?
}
?>
</div>
<? View::show_footer(); ?>

View File

@ -196,6 +196,7 @@ function create_row($Title, $URL, $HasPermission = false, $Tooltip = false) {
// begin Torrents category
$ToolsHTML = "";
create_row("Collage recovery", "collages.php?action=recover", check_perms("site_collages_recover"));
create_row("\"Do Not Upload\" list", "tools.php?action=dnu", check_perms("admin_dnu"));
create_row("Manage freeleech tokens", "tools.php?action=tokens", check_perms("users_mod"));
create_row("Label aliases", "tools.php?action=label_aliases", check_perms("users_mod"));

View File

@ -244,6 +244,7 @@
DELETE FROM xbt_snatched
WHERE uid = '$UserID'");
$EditSummary[] = 'Snatch list cleared';
$Cache->delete_value("recent_snatches_$UserID");
}
if ($_POST['ResetDownloadList'] && check_perms('users_edit_reset_keys')) {

View File

@ -175,7 +175,9 @@ function check_paranoia_here($Setting) {
?>
<div class="thin">
<div class="header">
<h2><?=Users::format_username($UserID, true, true, true, false, true)?></h2>
</div>
<div class="linkbox">
<?
if (!$OwnProfile) {

View File

@ -133,7 +133,7 @@ pre {
display: none;
}
form textarea,form input {
form textarea, form input {
max-width: 100%;
}
@ -152,7 +152,7 @@ strong.important_text_alt {
font-weight: bold;
}
.invalid,.warning,.error,.new {
.invalid, .warning, .error, .new {
color: #ff0000;
}