Exemple #1
0
 /**
  * deletePodcastChannel
  * Delete an existing podcast channel
  * Takes the podcast id in parameter.
  */
 public static function deletepodcastchannel($input)
 {
     self::check_version($input, "1.9.0");
     $id = self::check_parameter($input, 'id');
     if (AmpConfig::get('podcast') && Access::check('interface', 75)) {
         $podcast = new Podcast(Subsonic_XML_Data::getAmpacheId($id));
         if ($podcast->id) {
             if ($podcast->remove()) {
                 $r = Subsonic_XML_Data::createSuccessResponse();
             } else {
                 $r = Subsonic_XML_Data::createError(Subsonic_XML_Data::SSERROR_GENERIC);
             }
         } else {
             $r = Subsonic_XML_Data::createError(Subsonic_XML_Data::SSERROR_DATA_NOTFOUND);
         }
     } else {
         $r = Subsonic_XML_Data::createError(Subsonic_XML_Data::SSERROR_UNAUTHORIZED);
     }
     self::apiOutput($input, $r);
 }
Exemple #2
0
     break;
 case 'delete':
     if (!Access::check('interface', 75) || AmpConfig::get('demo_mode')) {
         UI::access_denied();
         exit;
     }
     $podcast_id = scrub_in($_REQUEST['podcast_id']);
     show_confirmation(T_('Podcast Deletion'), T_('Are you sure you want to delete this podcast?'), AmpConfig::get('web_path') . "/podcast.php?action=confirm_delete&podcast_id=" . $podcast_id, 1, 'delete_podcast');
     break;
 case 'confirm_delete':
     if (!Access::check('interface', 75) || AmpConfig::get('demo_mode')) {
         UI::access_denied();
         exit;
     }
     $podcast = new Podcast($_REQUEST['podcast_id']);
     if ($podcast->remove()) {
         show_confirmation(T_('Podcast Deletion'), T_('Podcast has been deleted.'), AmpConfig::get('web_path') . '/browse.php?action=podcast');
     } else {
         show_confirmation(T_('Podcast Deletion'), T_('Cannot delete this podcast.'), AmpConfig::get('web_path') . '/browse.php?action=podcast');
     }
     break;
 case 'show':
     $podcast_id = intval($_REQUEST['podcast']);
     if ($podcast_id > 0) {
         $podcast = new Podcast($podcast_id);
         $podcast->format();
         $object_ids = $podcast->get_episodes();
         $object_type = 'podcast_episode';
         require_once AmpConfig::get('prefix') . UI::find_template('show_podcast.inc.php');
     }
     break;