Empty commit

This commit is contained in:
Git 2013-10-01 08:00:53 +00:00
parent 44fb15b6be
commit 9c736fd946
7 changed files with 285 additions and 213 deletions

View File

@ -31,7 +31,6 @@
'site_moderate_requests' => 'Request moderation access.',
'site_delete_artist' => 'Can delete artists (must be able to delete torrents+requests).',
'site_moderate_forums' => 'Forum moderation access.',
'site_admin_forums' => 'Forum administrator access.',
'site_forums_double_post' => 'Can double post in the forums.',
'site_view_flow' => 'Can view stats and data pools.',
@ -45,7 +44,6 @@
'site_debug' => 'Developer access.',
'site_proxy_images' => 'Image proxy & anti-canary.',
'site_search_many' => 'Can go past low limit of search results.',
'users_edit_usernames' => 'Can edit usernames.',
'users_edit_ratio' => 'Can edit anyone\'s upload/download amounts.',
'users_edit_own_ratio' => 'Can edit own upload/download amounts.',
@ -72,12 +70,10 @@
'users_view_keys' => 'Can view passkeys.',
'users_view_ips' => 'Can view IP addresses.',
'users_view_email' => 'Can view email addresses.',
'users_override_paranoia' => 'Can override paranoia.',
'users_logout' => 'Can log users out (old?).',
'users_make_invisible' => 'Can make users invisible.',
'users_mod' => 'Basic moderator tools.',
'torrents_edit' => 'Can edit any torrent.',
'torrents_delete' => 'Can delete torrents.',
'torrents_delete_fast' => 'Can delete more than 3 torrents at a time.',
@ -112,10 +108,10 @@
'torrents_edit_vanityhouse' => 'Can mark groups as part of Vanity House.',
'artist_edit_vanityhouse' => 'Can mark artists as part of Vanity House.',
'site_tag_aliases_read' => 'Can view the list of tag aliases.'
);
function permissions_form() { ?>
function permissions_form() {
?>
<div class="permissions">
<div class="permission_container">
<table>
@ -124,47 +120,49 @@ function permissions_form() { ?>
</tr>
<tr>
<td>
<? display_perm('site_leech','Can leech.'); ?>
<? display_perm('site_upload','Can upload.'); ?>
<? display_perm('site_vote','Can vote on requests.'); ?>
<? display_perm('site_submit_requests','Can submit requests.'); ?>
<? display_perm('site_see_old_requests','Can see old requests.'); ?>
<? display_perm('site_advanced_search','Can use advanced search.'); ?>
<? display_perm('site_top10','Can access top 10.'); ?>
<? display_perm('site_torrents_notify','Can access torrents notifications system.'); ?>
<? display_perm('site_collages_create','Can create collages.'); ?>
<? display_perm('site_collages_manage','Can manage collages (add torrents, sorting).'); ?>
<? display_perm('site_collages_delete','Can delete collages.'); ?>
<? display_perm('site_collages_subscribe','Can access collage subscriptions.'); ?>
<? display_perm('site_collages_personal','Can have a personal collage.'); ?>
<? display_perm('site_collages_renamepersonal','Can rename own personal collages.'); ?>
<? display_perm('site_advanced_top10','Can access advanced top 10.'); ?>
<? display_perm('site_album_votes', 'Can vote for favorite torrents.'); ?>
<? display_perm('site_make_bookmarks','Can make bookmarks.'); ?>
<? display_perm('site_edit_wiki','Can edit wiki pages.'); ?>
<? display_perm('site_can_invite_always', 'Can invite users even when invites are closed.'); ?>
<? display_perm('site_send_unlimited_invites', 'Can send unlimited invites.'); ?>
<? display_perm('site_moderate_requests', 'Can moderate any request.'); ?>
<? display_perm('site_delete_artist', 'Can delete artists (must be able to delete torrents+requests).'); ?>
<? display_perm('forums_polls_create','Can create polls in the forums.') ?>
<? display_perm('forums_polls_moderate','Can feature and close polls.') ?>
<? display_perm('site_moderate_forums', 'Can moderate the forums.'); ?>
<? display_perm('site_admin_forums', 'Can administrate the forums.'); ?>
<? display_perm('site_view_flow', 'Can view site stats and data pools.'); ?>
<? display_perm('site_view_full_log', 'Can view the full site log.'); ?>
<? display_perm('site_view_torrent_snatchlist', 'Can view torrent snatch lists.'); ?>
<? display_perm('site_recommend_own', 'Can add own torrents to recommendations list.'); ?>
<? display_perm('site_manage_recommendations', 'Can edit recommendations list.'); ?>
<? display_perm('site_delete_tag', 'Can delete tags.'); ?>
<? display_perm('site_disable_ip_history', 'Disable IP history.'); ?>
<? display_perm('zip_downloader', 'Download multiple torrents at once.'); ?>
<? display_perm('site_debug', 'View site debug tables.'); ?>
<? display_perm('site_proxy_images', 'Proxy images through the server.'); ?>
<? display_perm('site_search_many', 'Can go past low limit of search results.'); ?>
<? display_perm('site_collages_recover', 'Can recover \'deleted\' collages.'); ?>
<? display_perm('site_forums_double_post', 'Can double post in the forums.'); ?>
<? display_perm('project_team', 'Part of the project team.'); ?>
<? display_perm('site_tag_aliases_read', 'Can view the list of tag aliases.'); ?>
<?
display_perm('site_leech','Can leech.');
display_perm('site_upload','Can upload.');
display_perm('site_vote','Can vote on requests.');
display_perm('site_submit_requests','Can submit requests.');
display_perm('site_see_old_requests','Can see old requests.');
display_perm('site_advanced_search','Can use advanced search.');
display_perm('site_top10','Can access top 10.');
display_perm('site_torrents_notify','Can access torrents notifications system.');
display_perm('site_collages_create','Can create collages.');
display_perm('site_collages_manage','Can manage collages (add torrents, sorting).');
display_perm('site_collages_delete','Can delete collages.');
display_perm('site_collages_subscribe','Can access collage subscriptions.');
display_perm('site_collages_personal','Can have a personal collage.');
display_perm('site_collages_renamepersonal','Can rename own personal collages.');
display_perm('site_advanced_top10','Can access advanced top 10.');
display_perm('site_album_votes', 'Can vote for favorite torrents.');
display_perm('site_make_bookmarks','Can make bookmarks.');
display_perm('site_edit_wiki','Can edit wiki pages.');
display_perm('site_can_invite_always', 'Can invite users even when invites are closed.');
display_perm('site_send_unlimited_invites', 'Can send unlimited invites.');
display_perm('site_moderate_requests', 'Can moderate any request.');
display_perm('site_delete_artist', 'Can delete artists (must be able to delete torrents+requests).');
display_perm('forums_polls_create','Can create polls in the forums.');
display_perm('forums_polls_moderate','Can feature and close polls.');
display_perm('site_moderate_forums', 'Can moderate the forums.');
display_perm('site_admin_forums', 'Can administrate the forums.');
display_perm('site_view_flow', 'Can view site stats and data pools.');
display_perm('site_view_full_log', 'Can view the full site log.');
display_perm('site_view_torrent_snatchlist', 'Can view torrent snatch lists.');
display_perm('site_recommend_own', 'Can add own torrents to recommendations list.');
display_perm('site_manage_recommendations', 'Can edit recommendations list.');
display_perm('site_delete_tag', 'Can delete tags.');
display_perm('site_disable_ip_history', 'Disable IP history.');
display_perm('zip_downloader', 'Download multiple torrents at once.');
display_perm('site_debug', 'View site debug tables.');
display_perm('site_proxy_images', 'Proxy images through the server.');
display_perm('site_search_many', 'Can go past low limit of search results.');
display_perm('site_collages_recover', 'Can recover \'deleted\' collages.');
display_perm('site_forums_double_post', 'Can double post in the forums.');
display_perm('project_team', 'Part of the project team.');
display_perm('site_tag_aliases_read', 'Can view the list of tag aliases.');
?>
</td>
</tr>
</table>
@ -176,36 +174,38 @@ function permissions_form() { ?>
</tr>
<tr>
<td>
<? display_perm('users_edit_usernames', 'Can edit usernames.'); ?>
<? display_perm('users_edit_ratio', 'Can edit anyone\'s upload/download amounts.'); ?>
<? display_perm('users_edit_own_ratio', 'Can edit own upload/download amounts.'); ?>
<? display_perm('users_edit_titles', 'Can edit titles.'); ?>
<? display_perm('users_edit_avatars', 'Can edit avatars.'); ?>
<? display_perm('users_edit_invites', 'Can edit invite numbers and cancel sent invites.'); ?>
<? display_perm('users_edit_watch_hours', 'Can edit contrib watch hours.'); ?>
<? display_perm('users_edit_reset_keys', 'Can reset any passkey/authkey.'); ?>
<? display_perm('users_edit_profiles', 'Can edit anyone\'s profile.'); ?>
<? display_perm('users_view_friends', 'Can view anyone\'s friends.'); ?>
<? display_perm('users_reset_own_keys', 'Can reset own passkey/authkey.'); ?>
<? display_perm('users_edit_password', 'Can change password.'); ?>
<? display_perm('users_promote_below', 'Can promote users to below current level.'); ?>
<? display_perm('users_promote_to', 'Can promote users up to current level.'); ?>
<? display_perm('users_give_donor', 'Can give donor access.'); ?>
<? display_perm('users_warn', 'Can warn users.'); ?>
<? display_perm('users_disable_users', 'Can disable users.'); ?>
<? display_perm('users_disable_posts', 'Can disable users\' posting privileges.'); ?>
<? display_perm('users_disable_any', 'Can disable any users\' rights.'); ?>
<? display_perm('users_delete_users', 'Can delete anyone\'s account'); ?>
<? display_perm('users_view_invites', 'Can view who user has invited'); ?>
<? display_perm('users_view_seedleech', 'Can view what a user is seeding or leeching'); ?>
<? display_perm('users_view_uploaded', 'Can view a user\'s uploads, regardless of privacy level'); ?>
<? display_perm('users_view_keys', 'Can view passkeys'); ?>
<? display_perm('users_view_ips', 'Can view IP addresses'); ?>
<? display_perm('users_view_email', 'Can view email addresses'); ?>
<? display_perm('users_override_paranoia', 'Can override paranoia'); ?>
<? display_perm('users_make_invisible', 'Can make users invisible'); ?>
<? display_perm('users_logout', 'Can log users out'); ?>
<? display_perm('users_mod', 'Can access basic moderator tools (Admin comment)'); ?>
<?
display_perm('users_edit_usernames', 'Can edit usernames.');
display_perm('users_edit_ratio', 'Can edit anyone\'s upload/download amounts.');
display_perm('users_edit_own_ratio', 'Can edit own upload/download amounts.');
display_perm('users_edit_titles', 'Can edit titles.');
display_perm('users_edit_avatars', 'Can edit avatars.');
display_perm('users_edit_invites', 'Can edit invite numbers and cancel sent invites.');
display_perm('users_edit_watch_hours', 'Can edit contrib watch hours.');
display_perm('users_edit_reset_keys', 'Can reset any passkey/authkey.');
display_perm('users_edit_profiles', 'Can edit anyone\'s profile.');
display_perm('users_view_friends', 'Can view anyone\'s friends.');
display_perm('users_reset_own_keys', 'Can reset own passkey/authkey.');
display_perm('users_edit_password', 'Can change password.');
display_perm('users_promote_below', 'Can promote users to below current level.');
display_perm('users_promote_to', 'Can promote users up to current level.');
display_perm('users_give_donor', 'Can give donor access.');
display_perm('users_warn', 'Can warn users.');
display_perm('users_disable_users', 'Can disable users.');
display_perm('users_disable_posts', 'Can disable users\' posting privileges.');
display_perm('users_disable_any', 'Can disable any users\' rights.');
display_perm('users_delete_users', 'Can delete anyone\'s account');
display_perm('users_view_invites', 'Can view who user has invited');
display_perm('users_view_seedleech', 'Can view what a user is seeding or leeching');
display_perm('users_view_uploaded', 'Can view a user\'s uploads, regardless of privacy level');
display_perm('users_view_keys', 'Can view passkeys');
display_perm('users_view_ips', 'Can view IP addresses');
display_perm('users_view_email', 'Can view email addresses');
display_perm('users_override_paranoia', 'Can override paranoia');
display_perm('users_make_invisible', 'Can make users invisible');
display_perm('users_logout', 'Can log users out');
display_perm('users_mod', 'Can access basic moderator tools (Admin comment)');
?>
*Everything is only applicable to users with the same or lower class level
</td>
</tr>
@ -218,19 +218,19 @@ function permissions_form() { ?>
</tr>
<tr>
<td>
<? display_perm('torrents_edit', 'Can edit any torrent'); ?>
<? display_perm('torrents_delete', 'Can delete torrents'); ?>
<? display_perm('torrents_delete_fast', 'Can delete more than 3 torrents at a time.'); ?>
<? display_perm('torrents_freeleech', 'Can make torrents freeleech'); ?>
<? display_perm('torrents_search_fast', 'Unlimit search frequency (for scripts).'); ?>
<? display_perm('torrents_add_artist', 'Can add artists to any group.'); ?>
<? display_perm('edit_unknowns', 'Can edit unknown release information.'); ?>
<? display_perm('torrents_edit_vanityhouse', 'Can mark groups as part of Vanity House.'); ?>
<? display_perm('artist_edit_vanityhouse', 'Can mark artists as part of Vanity House.'); ?>
<? display_perm('torrents_hide_dnu', 'Hide the Do Not Upload list by default.'); ?>
<? display_perm('torrents_fix_ghosts', 'Can fix ghost groups on artist pages.'); ?>
<?
display_perm('torrents_edit', 'Can edit any torrent');
display_perm('torrents_delete', 'Can delete torrents');
display_perm('torrents_delete_fast', 'Can delete more than 3 torrents at a time.');
display_perm('torrents_freeleech', 'Can make torrents freeleech');
display_perm('torrents_search_fast', 'Unlimit search frequency (for scripts).');
display_perm('torrents_add_artist', 'Can add artists to any group.');
display_perm('edit_unknowns', 'Can edit unknown release information.');
display_perm('torrents_edit_vanityhouse', 'Can mark groups as part of Vanity House.');
display_perm('artist_edit_vanityhouse', 'Can mark artists as part of Vanity House.');
display_perm('torrents_hide_dnu', 'Hide the Do Not Upload list by default.');
display_perm('torrents_fix_ghosts', 'Can fix ghost groups on artist pages.');
?>
</td>
</tr>
</table>
@ -242,28 +242,31 @@ function permissions_form() { ?>
</tr>
<tr>
<td>
<? display_perm('admin_manage_news', 'Can manage site news'); ?>
<? display_perm('admin_manage_blog', 'Can manage the site blog'); ?>
<? display_perm('admin_manage_polls', 'Can manage polls'); ?>
<? display_perm('admin_manage_forums', 'Can manage forums (add/edit/delete)'); ?>
<? display_perm('admin_manage_fls', 'Can manage FLS'); ?>
<? display_perm('admin_reports', 'Can access reports system'); ?>
<? display_perm('admin_advanced_user_search', 'Can access advanced user search'); ?>
<? display_perm('admin_create_users', 'Can create users through an administrative form'); ?>
<? display_perm('admin_donor_log', 'Can view the donor log'); ?>
<? display_perm('admin_manage_ipbans', 'Can manage IP bans'); ?>
<? display_perm('admin_dnu', 'Can manage do not upload list'); ?>
<? display_perm('admin_clear_cache', 'Can clear cached pages'); ?>
<? display_perm('admin_whitelist', 'Can manage the list of allowed clients.'); ?>
<? display_perm('admin_manage_permissions', 'Can edit permission classes/user permissions.'); ?>
<? display_perm('admin_schedule', 'Can run the site schedule.'); ?>
<? display_perm('admin_login_watch', 'Can manage login watch.'); ?>
<? display_perm('admin_manage_wiki', 'Can manage wiki access.'); ?>
<? display_perm('admin_update_geoip', 'Can update geoIP data.'); ?>
<?
display_perm('admin_manage_news', 'Can manage site news');
display_perm('admin_manage_blog', 'Can manage the site blog');
display_perm('admin_manage_polls', 'Can manage polls');
display_perm('admin_manage_forums', 'Can manage forums (add/edit/delete)');
display_perm('admin_manage_fls', 'Can manage FLS');
display_perm('admin_reports', 'Can access reports system');
display_perm('admin_advanced_user_search', 'Can access advanced user search');
display_perm('admin_create_users', 'Can create users through an administrative form');
display_perm('admin_donor_log', 'Can view the donor log');
display_perm('admin_manage_ipbans', 'Can manage IP bans');
display_perm('admin_dnu', 'Can manage do not upload list');
display_perm('admin_clear_cache', 'Can clear cached pages');
display_perm('admin_whitelist', 'Can manage the list of allowed clients.');
display_perm('admin_manage_permissions', 'Can edit permission classes/user permissions.');
display_perm('admin_schedule', 'Can run the site schedule.');
display_perm('admin_login_watch', 'Can manage login watch.');
display_perm('admin_manage_wiki', 'Can manage wiki access.');
display_perm('admin_update_geoip', 'Can update geoIP data.');
?>
</td>
</tr>
</table>
</div>
<div class="submit_container"><input type="submit" name="submit" value="Save Permission Class" /></div>
</div>
<? } ?>
<?
}

View File

@ -129,10 +129,9 @@ function check_perms($PermissionName, $MinClass = 0) {
return Permissions::check_perms($PermissionName, $MinClass);
}
/*
* Print json status result with an optional message and die.
/**
* Print JSON status result with an optional message and die.
*/
function json_die($Status, $Message) {
if ($Status == 'success' && $Message) {
print json_encode(array('status' => $Status, 'response' => $Message));
@ -143,4 +142,13 @@ function json_die($Status, $Message) {
}
die();
}
/**
* Print the site's URL including the appropriate URI scheme, including the trailing slash
*
* @param bool $SSL - whether the URL should be crafted for HTTPS or regular HTTP
*/
function site_url($SSL = true) {
return $SSL ? 'https://' . SSL_SITE_URL . '/' : 'http://' . NONSSL_SITE_URL . '/';
}
?>

View File

@ -1,5 +1,11 @@
CHANGELOG
2013-09-30 by alderaan
Refactored backend code for staff toolbox
2013-09-30 by alderaan
Add function site_url() for printing the site's URL
2013-09-28 by Ajax
Added top artists data to top10 page using last.fm chart data

View File

@ -175,7 +175,7 @@
$UserIDs = $DB->to_array();
foreach ($UserIDs as $User) {
list($VoterID) = $User;
Misc::send_pm($VoterID, 0, "The request \"$FullName\" has been filled", 'One of your requests&#8202;&mdash;&#8202;[url=https://'.SSL_SITE_URL.'/requests.php?action=view&amp;id='.$RequestID.']'.$FullName.'[/url]&#8202;&mdash;&#8202;has been filled. You can view it here: [url]https://'.SSL_SITE_URL.'/torrents.php?torrentid='.$TorrentID.'[/url]');
Misc::send_pm($VoterID, 0, "The request \"$FullName\" has been filled", 'One of your requests&#8202;&mdash;&#8202;[url=https://'.SSL_SITE_URL."/requests.php?action=view&amp;id=$RequestID]$FullName".'[/url]&#8202;&mdash;&#8202;has been filled. You can view it here: [url]https://'.SSL_SITE_URL."/torrents.php?torrentid=$TorrentID".'[/url]');
}
$RequestVotes = Requests::get_votes_array($RequestID);

View File

@ -1,10 +1,12 @@
<?
function display_perm($Key,$Title) {
function display_perm($Key, $Title) {
global $Values;
$Perm='<input type="checkbox" name="perm_'.$Key.'" id="'.$Key.'" value="1"';
if (!empty($Values[$Key])) { $Perm.=' checked="checked"'; }
$Perm.=' /> <label for="'.$Key.'">'.$Title.'</label><br />';
echo $Perm;
$Perm = "<input type=\"checkbox\" name=\"perm_$Key\" id=\"$Key\" value=\"1\"";
if (!empty($Values[$Key])) {
$Perm .= ' checked="checked"';
}
$Perm .= " /> <label for=\"$Key\">$Title</label><br />";
echo "$Perm\n";
}
View::show_header('Manage Permissions','validate');

View File

@ -2,108 +2,161 @@
if (!check_perms('users_mod')) {
error(403);
}
/**
* Used for rendering a single table row in the staff toolbox
*
* @param string $Title - the displayed name of the tool
* @param string $URL - the relative URL of the tool
* @param bool $HasPermission - whether the user has permission to view/use the tool
* @param string $Tooltip - optional tooltip
*
*/
function create_row($Title, $URL, $HasPermission = false, $Tooltip = false) {
$TooltipHTML = $Tooltip !== false ? " class=\"tooltip\" title=\"$Tooltip\"" : "";
if ($HasPermission) {
echo "\t\t\t\t<tr><td><a href=\"$URL\"$TooltipHTML>$Title</a></td></tr>\n";
}
}
View::show_header('Staff Tools');
?>
<div class="permissions">
<div class="permission_container">
<!-- begin left column -->
<div class="permission_container">
<table class="layout">
<tr class="colhead"><td>Announcements</td></tr>
<?
create_row("Calendar", "tools.php?action=calendar", Calendar::can_view());
create_row("Change log", "tools.php?action=change_log", check_perms("users_mod"));
create_row("Global notification", "tools.php?action=global_notification", check_perms("users_mod"));
create_row("News post", "tools.php?action=news", check_perms("admin_manage_news"));
create_row("Vanity House additions", "tools.php?action=recommend", check_perms("site_recommend_own") || check_perms("site_manage_recommendations"));
?>
</table>
</div>
<div class="permission_container">
<table class="layout">
<tr class="colhead"><td>Community</td></tr>
<?
create_row("Forum manager", "tools.php?action=forum", check_perms("admin_manage_forums"));
create_row("Permissions manager", "tools.php?action=permissions", check_perms("admin_manage_permissions"));
create_row("Special users", "tools.php?action=special_users", check_perms("admin_manage_permissions"));
?>
</table>
</div>
<div class="permission_container">
<table class="layout">
<tr class="colhead"><td>Finances</td></tr>
<?
create_row("Bitcoin donations (balance)", "tools.php?action=bitcoin_balance", check_perms("admin_donor_log"));
create_row("Bitcoin donations (unprocessed)", "tools.php?action=bitcoin_unproc", check_perms("admin_donor_log"));
create_row("Donation log", "tools.php?action=donation_log", check_perms("admin_donor_log"));
create_row("Donor rewards", "tools.php?action=donor_rewards", check_perms("users_mod"));
?>
</table>
</div>
<div class="permission_container">
<table class="layout">
<tr class="colhead"><td>Administration</td></tr>
<?
create_row("Client whitelist", "tools.php?action=whitelist", check_perms("admin_whitelist"));
create_row("Create user", "tools.php?action=create_user", check_perms("admin_create_users"));
create_row("Global notification", "tools.php?action=global_notification", check_perms("users_mod"));
create_row("Mass PM", "tools.php?action=mass_pm", check_perms("users_mod"));
?>
</table>
</div>
<!-- end left column -->
</div>
<div class="permission_container">
<!-- begin middle column -->
<div class="permission_container">
<table class="layout">
<?
<tr class="colhead"><td>Queue</td></tr>
?>
<? create_row("Login watch", "tools.php?action=login_watch", check_perms("admin_login_watch"));
?>
</table>
</div>
<div class="permission_container">
<table class="layout">
<?
<tr class="colhead"><td>Managers</td></tr>
<? if (check_perms('admin_manage_permissions')) { ?>
<tr><td><a href="tools.php?action=permissions">Permissions</a></td></tr>
<? } if (check_perms('admin_whitelist')) { ?>
<tr><td><a href="tools.php?action=whitelist">Client whitelist</a></td></tr>
<? } if (check_perms('admin_manage_ipbans')) { ?>
<tr><td><a href="tools.php?action=ip_ban">IP address bans</a></td></tr>
<? } if (check_perms('admin_login_watch')) { ?>
<tr><td><a href="tools.php?action=login_watch">Login watch</a></td></tr>
<? } if (check_perms('admin_manage_forums')) { ?>
<tr><td><a href="tools.php?action=forum">Forums</a></td></tr>
<? } if (check_perms('admin_manage_news')) { ?>
<tr><td><a href="tools.php?action=news">News</a></td></tr>
<? } if (check_perms('admin_dnu')) { ?>
<tr><td><a href="tools.php?action=dnu">"Do Not Upload" list</a></td></tr>
<? } if (check_perms('site_recommend_own') || check_perms('site_manage_recommendations')) { ?>
<tr><td><a href="tools.php?action=recommend">Vanity House additions</a></td></tr>
<? } if (check_perms('users_view_email')) { ?>
<tr><td><a href="tools.php?action=email_blacklist">Email blacklist</a></td></tr>
<? } if (check_perms('users_mod')) { ?>
<tr><td><a href="tools.php?action=tokens">Manage freeleech tokens</a></td></tr>
<tr><td><a href="tools.php?action=official_tags">Official tags manager</a></td></tr>
<tr><td><a href="tools.php?action=tag_aliases">Tag aliases</a></td></tr>
<? } if (check_perms('users_mod') || $LoggedUser['ExtraClasses'][DELTA_TEAM]) { ?>
<tr><td><a href="tools.php?action=label_aliases">Label aliases</a></td></tr>
<? } if (check_perms('users_mod')) { ?>
<tr><td><a href="tools.php?action=change_log">Change log</a></td></tr>
<? } if (check_perms('users_mod')) { ?>
<tr><td><a href="tools.php?action=global_notification">Global Notification</a></td></tr>
<? } if (Calendar::can_view()) { ?>
<tr><td><a href="tools.php?action=calendar">Calendar</a></td></tr>
<? } if (check_perms('users_mod')) { ?>
<tr><td><a href="tools.php?action=mass_pm">Mass PM</a></td></tr>
<? } ?>
?>
<? create_row("Email blacklist", "tools.php?action=email_blacklist", check_perms("users_view_email"));
create_row("IP address bans", "tools.php?action=ip_ban", check_perms("admin_manage_ipbans"));
create_row("Duplicate IP addresses", "tools.php?action=dupe_ips", check_perms("users_view_ips"));
create_row("Manipulate invite tree", "tools.php?action=manipulate_tree", check_perms("users_mod"));
?>
</table>
</div>
<!-- end middle column -->
</div>
<div class="permission_container">
<!-- begin right column -->
<div class="permission_container">
<table class="layout">
<tr class="colhead"><td>Site Information</td></tr>
<?
create_row("Economic stats", "tools.php?action=economic_stats", check_perms("site_view_flow"));
create_row("Invite pool", "tools.php?action=invite_pool", check_perms("users_view_invites"));
create_row("Registration log", "tools.php?action=registration_log", check_perms("users_view_ips") && check_perms("users_view_email"));
create_row("Torrent stats", "tools.php?action=torrent_stats", check_perms("site_view_flow"));
// create_row("Upscale pool", "tools.php?action=upscale_pool", check_perms("site_view_flow"));
create_row("User flow", "tools.php?action=user_flow", check_perms("site_view_flow"));
?>
</table>
</div>
<div class="permission_container">
<table class="layout">
<tr class="colhead"><td>Data</td></tr>
<? if (check_perms('admin_donor_log')) { ?>
<tr><td><a href="tools.php?action=donation_log">Donation log</a></td></tr>
<tr><td><a href="tools.php?action=bitcoin_balance">Bitcoin donations (balance)</a></td></tr>
<tr><td><a href="tools.php?action=bitcoin_unproc">Bitcoin donations (unprocessed)</a></td></tr>
<? } if (check_perms('users_view_ips') && check_perms('users_view_email')) { ?>
<tr><td><a href="tools.php?action=registration_log">Registration log</a></td></tr>
<? } if (check_perms('users_view_invites')) { ?>
<tr><td><a href="tools.php?action=invite_pool">Invite pool</a></td></tr>
<? } if (check_perms('site_view_flow')) { ?>
<tr><td><a href="tools.php?action=upscale_pool">Upscale pool</a></td></tr>
<tr><td><a href="tools.php?action=user_flow">User flow</a></td></tr>
<tr><td><a href="tools.php?action=torrent_stats">Torrent stats</a></td></tr>
<tr><td><a href="tools.php?action=economic_stats">Economic stats</a></td></tr>
<? } if (check_perms('site_debug')) { ?>
<tr><td><a href="tools.php?action=opcode_stats">Opcode stats</a></td></tr>
<tr><td><a href="tools.php?action=service_stats">Service stats</a></td></tr>
<? } if (check_perms('admin_manage_permissions')) { ?>
<tr><td><a href="tools.php?action=special_users">Special users</a></td></tr>
<tr><td><a href="tools.php?action=donor_rewards">Donor Rewards</a></td></tr>
<? } ?>
<tr class="colhead"><td>Torrents</td></tr>
<?
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"));
create_row("Tag aliases", "tools.php?action=tag_aliases", check_perms("users_mod"));
create_row("Batch tag editor", "tools.php?action=edit_tags", check_perms("users_mod"));
create_row("Official tags manager", "tools.php?action=official_tags", check_perms("users_mod"));
?>
</table>
</div>
<div class="permission_container">
<table class="layout">
<tr class="colhead"><td>Misc</td></tr>
<? if (check_perms('users_mod')) { ?>
<tr><td><a href="tools.php?action=edit_tags">Batch tag editor</a></td></tr>
<? } if (check_perms('users_mod')) { ?>
<tr><td><a href="tools.php?action=manipulate_tree">Manipulate tree</a></td></tr>
<? } if (check_perms('admin_update_geoip')) { ?>
<tr><td><a href="tools.php?action=update_geoip">Update GeoIP </a></td></tr>
<? } if (check_perms('admin_create_users')) { ?>
<tr><td><a href="tools.php?action=create_user">Create user</a></td></tr>
<? } if (check_perms('users_mod')) { ?>
<tr><td><a href="tools.php?action=clear_cache">Clear/view a cache key</a></td></tr>
<? } if (check_perms('users_view_ips')) { ?>
<tr><td><a href="tools.php?action=dupe_ips">Duplicate IP addresses</a></td></tr>
<? } if (check_perms('site_debug')) { ?>
<tr><td><a href="tools.php?action=process_info">PHP processes</a></td></tr>
<tr><td><a href="tools.php?action=sandbox1">Sandbox (1)</a></td></tr>
<tr><td><a href="tools.php?action=sandbox2">Sandbox (2)</a></td></tr>
<tr><td><a href="tools.php?action=sandbox3">Sandbox (3)</a></td></tr>
<tr><td><a href="tools.php?action=sandbox4">Sandbox (4)</a></td></tr>
<tr><td><a href="tools.php?action=sandbox5">Sandbox (5)</a></td></tr>
<tr><td><a href="tools.php?action=sandbox6">Sandbox (6)</a></td></tr>
<tr><td><a href="tools.php?action=sandbox7">Sandbox (7)</a></td></tr>
<tr><td><a href="tools.php?action=sandbox8">Sandbox (8)</a></td></tr>
<tr><td><a href="schedule.php?auth=<?=$LoggedUser['AuthKey']?>">Schedule</a></td></tr>
<? } if (check_perms('admin_clear_cache') || check_perms('users_mod')) { ?>
<tr><td><a href="tools.php?action=rerender_gallery">Rerender stylesheet gallery images</a></td></tr>
<? } if (check_perms('users_mod')) { ?>
<tr><td><a href="tools.php?action=bbcode_sandbox">BBCode Sandbox</a></td></tr>
<tr><td><strong><a href="tools.php?action=public_sandbox">Public sandbox</a></strong></td></tr>
<? } if (check_perms('users_mod')) { ?>
<tr><td><strong><a href="tools.php?action=mod_sandbox">Mod-level sandbox</a></strong></td></tr>
<? } ?>
<tr class="colhead"><td>Development</td></tr>
<?
create_row("Clear/view a cache key", "tools.php?action=clear_cache", check_perms("users_mod"));
create_row("Opcode stats", "tools.php?action=opcode_stats", check_perms("site_debug"));
create_row("PHP processes", "tools.php?action=process_info", check_perms("site_debug"));
create_row("Rerender stylesheet gallery images", "tools.php?action=rerender_gallery", check_perms("admin_clear_cache") || check_perms("users_mod"));
create_row("Schedule", "schedule.php?auth=$LoggedUser[AuthKey]", check_perms("site_debug"));
create_row("Service stats", "tools.php?action=service_stats", check_perms("site_debug"));
create_row("Update GeoIP", "tools.php?action=update_geoip", check_perms("admin_update_geoip"));
?>
</table>
</div>
<div class="permission_container">
<table class="layout">
<tr class="colhead"><td>Developer Sandboxes</td></tr>
<?
create_row("Sandbox (1)", "tools.php?action=sandbox1", check_perms("site_debug"));
create_row("Sandbox (2)", "tools.php?action=sandbox2", check_perms("site_debug"));
create_row("Sandbox (3)", "tools.php?action=sandbox3", check_perms("site_debug"));
create_row("Sandbox (4)", "tools.php?action=sandbox4", check_perms("site_debug"));
create_row("Sandbox (5)", "tools.php?action=sandbox5", check_perms("site_debug"));
create_row("Sandbox (6)", "tools.php?action=sandbox6", check_perms("site_debug"));
create_row("Sandbox (7)", "tools.php?action=sandbox7", check_perms("site_debug"));
create_row("Sandbox (8)", "tools.php?action=sandbox8", check_perms("site_debug"));
create_row("BBCode sandbox", "tools.php?action=bbcode_sandbox", check_perms("users_mod"));
create_row("Public sandbox", "tools.php?action=public_sandbox", check_perms("users_mod"), "Do not click this!");
create_row("Mod-level sandbox", "tools.php?action=mod_sandbox", check_perms("users_mod"), "Do not click this!");
?>
</table>
</div>
<!-- end right column -->
</div>
</div>
<? View::show_footer(); ?>

View File

@ -62,7 +62,7 @@ function display_perm($Key, $Title) {
$Perm .= ' checked="checked"';
}
$Perm .= " /> <label for=\"$Key\">$Title</label><br />";
echo $Perm;
echo "$Perm\n";
}
View::show_header("$Username &gt; Permissions");