summaryrefslogtreecommitdiffstats
path: root/playlist.php
diff options
context:
space:
mode:
authorPaul 'flowerysong' Arthur <flowerysong00@yahoo.com>2010-04-28 05:32:10 +0000
committerPaul 'flowerysong' Arthur <flowerysong00@yahoo.com>2010-04-28 05:32:10 +0000
commit1a0c72d524221419e1ba9ca5ff6049de04199911 (patch)
treed65d71e977fa5f3d7bf0bafd82a91338d4b6b105 /playlist.php
parent34739b2af797e3e981a30a41ec9db19bdf5c158f (diff)
downloadampache-1a0c72d524221419e1ba9ca5ff6049de04199911.tar.gz
ampache-1a0c72d524221419e1ba9ca5ff6049de04199911.tar.bz2
ampache-1a0c72d524221419e1ba9ca5ff6049de04199911.zip
Add the ability to edit or delete a playlist from the normal playlist display,
not just while browsing. Fixes FS#16
Diffstat (limited to 'playlist.php')
-rw-r--r--playlist.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/playlist.php b/playlist.php
index 226c0e35..db68c8b0 100644
--- a/playlist.php
+++ b/playlist.php
@@ -27,6 +27,17 @@
require_once 'lib/init.php';
+// We special-case this so we can send a 302 if the delete succeeded
+if ($_REQUEST['action'] == 'delete_playlist') {
+ // Check rights
+ $playlist = new Playlist($_REQUEST['playlist_id']);
+ if ($playlist->has_access()) {
+ $playlist->delete();
+ // Go elsewhere
+ header('Location: ' . Config::get('web_path') . '/browse.php?action=playlist');
+ }
+}
+
show_header();
@@ -57,6 +68,10 @@ switch ($_REQUEST['action']) {
$_SESSION['data']['playlist_id'] = $playlist->id;
show_confirmation(_('Playlist Created'),$playlist_name . ' (' . $playlist_type . ') ' . _(' has been created'),'playlist.php');
break;
+ case 'delete_playlist':
+ // If we made it here, we didn't have sufficient rights.
+ access_denied();
+ break;
case 'remove_song':
/* Check em for rights */
if (!$playlist->has_access()) {