Gazelle/sections/user/index.php

134 lines
3.6 KiB
PHP
Raw Normal View History

2011-03-28 14:21:28 +00:00
<?
//TODO
/*****************************************************************
Finish removing the take[action] pages and utilize the index correctly
Should the advanced search really only show if they match 3 perms?
Make sure all constants are defined in config.php and not in random files
*****************************************************************/
enforce_login();
2013-05-27 08:00:58 +00:00
include(SERVER_ROOT."/classes/validate.class.php");
$Val = NEW VALIDATE;
2011-03-28 14:21:28 +00:00
2013-04-17 08:00:58 +00:00
if (empty($_REQUEST['action'])) {
$_REQUEST['action'] = '';
}
2011-03-28 14:21:28 +00:00
switch ($_REQUEST['action']) {
case 'notify':
include('notify_edit.php');
break;
case 'notify_handle':
include('notify_handle.php');
break;
case 'notify_delete':
authorize();
2013-04-01 08:00:47 +00:00
if ($_GET['id'] && is_number($_GET['id'])) {
2011-03-28 14:21:28 +00:00
$DB->query("DELETE FROM users_notify_filters WHERE ID='".db_string($_GET['id'])."' AND UserID='$LoggedUser[ID]'");
$ArtistNotifications = $Cache->get_value('notify_artists_'.$LoggedUser['ID']);
2013-04-01 08:00:47 +00:00
if (is_array($ArtistNotifications) && $ArtistNotifications['ID'] == $_GET['id']) {
2011-03-28 14:21:28 +00:00
$Cache->delete_value('notify_artists_'.$LoggedUser['ID']);
}
}
$Cache->delete_value('notify_filters_'.$LoggedUser['ID']);
header('Location: user.php?action=notify');
break;
case 'search':// User search
if (check_perms('admin_advanced_user_search') && check_perms('users_view_ips') && check_perms('users_view_email')) {
include('advancedsearch.php');
2013-05-16 16:15:57 +00:00
} else {
2011-03-28 14:21:28 +00:00
include('search.php');
2012-09-09 08:00:26 +00:00
}
2011-03-28 14:21:28 +00:00
break;
case 'edit':
include('edit.php');
break;
case 'takeedit':
include('takeedit.php');
break;
case 'invitetree':
include(SERVER_ROOT.'/sections/user/invitetree.php');
break;
case 'invite':
include('invite.php');
break;
case 'takeinvite':
include('takeinvite.php');
2013-02-22 08:00:24 +00:00
break;
2011-03-28 14:21:28 +00:00
case 'deleteinvite':
include('deleteinvite.php');
break;
case 'sessions':
include('sessions.php');
break;
case 'connchecker':
include('connchecker.php');
break;
case 'permissions':
include('permissions.php');
break;
case 'similar':
include('similar.php');
2013-02-22 08:00:24 +00:00
break;
2011-03-28 14:21:28 +00:00
case 'moderate':
include('takemoderate.php');
2012-03-29 08:00:19 +00:00
break;
case 'clearcache':
2012-05-03 08:00:25 +00:00
if (!check_perms('admin_clear_cache') || !check_perms('users_override_paranoia')) {
2012-03-29 08:00:19 +00:00
error(403);
}
$UserID = $_REQUEST['id'];
$Cache->delete_value('user_info_'.$UserID);
$Cache->delete_value('user_info_heavy_'.$UserID);
$Cache->delete_value('subscriptions_user_new_'.$UserID);
$Cache->delete_value('staff_pm_new_'.$UserID);
$Cache->delete_value('inbox_new_'.$UserID);
$Cache->delete_value('notifications_new_'.$UserID);
$Cache->delete_value('collage_subs_user_new_'.$UserID);
2012-09-21 08:00:25 +00:00
include(SERVER_ROOT.'/sections/user/user.php');
2012-09-12 08:00:27 +00:00
break;
2013-05-16 16:15:57 +00:00
// Provide public methods for Last.fm data gets.
2013-04-01 08:00:47 +00:00
case 'lastfm_compare':
if (isset($_GET['username'])) {
echo LastFM::compare_user_with($_GET['username']);
}
break;
case 'lastfm_last_played_track':
if (isset($_GET['username'])) {
echo LastFM::get_last_played_track($_GET['username']);
}
break;
case 'lastfm_top_artists':
if (isset($_GET['username'])) {
echo LastFM::get_top_artists($_GET['username']);
}
break;
case 'lastfm_top_albums':
if (isset($_GET['username'])) {
echo LastFM::get_top_albums($_GET['username']);
}
break;
case 'lastfm_top_tracks':
if (isset($_GET['username'])) {
echo LastFM::get_top_tracks($_GET['username']);
}
break;
case 'lastfm_clear_cache':
if (isset($_GET['username']) && isset($_GET['uid'])) {
echo LastFM::clear_cache($_GET['username'],$_GET['uid']);
}
break;
2013-08-28 23:08:41 +00:00
case 'take_donate':
break;
case 'take_update_rank':
break;
2011-03-28 14:21:28 +00:00
default:
if (isset($_REQUEST['id'])) {
include(SERVER_ROOT.'/sections/user/user.php');
} else {
header('Location: index.php');
}
}
?>