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 $Cache = NEW CACHE($MemcachedServers); //Load the caching class
$Enc = NEW CRYPT; //Load the encryption class $Enc = NEW CRYPT; //Load the encryption class
$SSL = ($_SERVER['SERVER_PORT'] === '443'); $SSL = $_SERVER['SERVER_PORT'] === '443';
if (isset($_COOKIE['session'])) { if (isset($_COOKIE['session'])) {
$LoginCookie = $Enc->decrypt($_COOKIE['session']); $LoginCookie = $Enc->decrypt($_COOKIE['session']);
@ -20,15 +20,15 @@
die('Not logged in!'); 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 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(" $DB->query("
SELECT Enabled SELECT Enabled
FROM users_main FROM users_main
WHERE ID='$UserID'"); WHERE ID = '$UserID'");
list($Enabled) = $DB->next_record(); list($Enabled) = $DB->next_record();
$Cache->cache_value('enabled_'.$UserID, $Enabled, 0); $Cache->cache_value("enabled_$UserID", $Enabled, 0);
} }
} else { } else {
die('Not logged in!'); die('Not logged in!');

View File

@ -1,5 +1,11 @@
CHANGE LOG 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 2013-11-09 by mcnellis
Set image max-width explicitly for each stylesheet. 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 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(" $DB->query("
SELECT Name, UserID SELECT Name, CategoryID, UserID
FROM collages FROM collages
WHERE ID = '$CollageID'"); 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']) { if (!check_perms('site_collages_delete') && $UserID != $LoggedUser['ID']) {
error(403); error(403);
@ -27,6 +27,15 @@
<input type="hidden" name="action" value="take_delete" /> <input type="hidden" name="action" value="take_delete" />
<input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" /> <input type="hidden" name="auth" value="<?=$LoggedUser['AuthKey']?>" />
<input type="hidden" name="collageid" value="<?=$CollageID?>" /> <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"> <div class="field_div">
<strong>Reason: </strong> <strong>Reason: </strong>
<input type="text" name="reason" size="40" /> <input type="text" name="reason" size="40" />

View File

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

View File

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

View File

@ -6,15 +6,6 @@
View::show_header($Title); View::show_header($Title);
$Balance = DonationsBitcoin::get_balance() . ' BTC'; $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"> <div class="header">
<h2><?=$Title?></h2> <h2><?=$Title?></h2>
@ -23,6 +14,20 @@
<div class="header"> <div class="header">
<h3><?=$Balance?></h3> <h3><?=$Balance?></h3>
</div> </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> <table>
<tr class="colhead"> <tr class="colhead">
<th>Username</th> <th>Username</th>
@ -30,10 +35,10 @@
<th>Amount</th> <th>Amount</th>
</tr> </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])) { if (!isset($BitcoinAddresses[$BitcoinAddress])) {
continue; continue;
} }
?> ?>
<tr> <tr>
<td><?=Users::format_username($UserID, true, false, false, false)?></td> <td><?=Users::format_username($UserID, true, false, false, false)?></td>
@ -41,9 +46,11 @@
<td><?=$BitcoinAddresses[$BitcoinAddress]?> BTC</td> <td><?=$BitcoinAddresses[$BitcoinAddress]?> BTC</td>
</tr> </tr>
<? <?
$DB->set_query_id($UserQ); }
}
?> ?>
</table> </table>
<?
}
?>
</div> </div>
<? View::show_footer(); ?> <? View::show_footer(); ?>

View File

@ -196,6 +196,7 @@ function create_row($Title, $URL, $HasPermission = false, $Tooltip = false) {
// begin Torrents category // begin Torrents category
$ToolsHTML = ""; $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("\"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("Manage freeleech tokens", "tools.php?action=tokens", check_perms("users_mod"));
create_row("Label aliases", "tools.php?action=label_aliases", 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 DELETE FROM xbt_snatched
WHERE uid = '$UserID'"); WHERE uid = '$UserID'");
$EditSummary[] = 'Snatch list cleared'; $EditSummary[] = 'Snatch list cleared';
$Cache->delete_value("recent_snatches_$UserID");
} }
if ($_POST['ResetDownloadList'] && check_perms('users_edit_reset_keys')) { 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="thin">
<h2><?=Users::format_username($UserID, true, true, true, false, true)?></h2> <div class="header">
<h2><?=Users::format_username($UserID, true, true, true, false, true)?></h2>
</div>
<div class="linkbox"> <div class="linkbox">
<? <?
if (!$OwnProfile) { if (!$OwnProfile) {

View File

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