/** * deleteShare * Delete an existing share. * Takes the share id to delete in parameters. */ public static function deleteshare($input) { self::check_version($input, "1.6.0"); $id = self::check_parameter($input, 'id'); if (AmpConfig::get('share')) { if (Share::delete_share($id)) { $r = Subsonic_XML_Data::createSuccessResponse(); } 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); }
exit; case 'show_delete': UI::show_header(); $id = $_REQUEST['id']; $next_url = AmpConfig::get('web_path') . '/share.php?action=delete&id=' . scrub_out($id); show_confirmation(T_('Share Delete'), T_('Confirm Deletion Request'), $next_url, 1, 'delete_share'); UI::show_footer(); exit; case 'delete': if (AmpConfig::get('demo_mode')) { UI::access_denied(); exit; } UI::show_header(); $id = $_REQUEST['id']; if (Share::delete_share($id)) { $next_url = AmpConfig::get('web_path') . '/stats.php?action=share'; show_confirmation(T_('Share Deleted'), T_('The Share has been deleted'), $next_url); } UI::show_footer(); exit; case 'clean': if (AmpConfig::get('demo_mode')) { UI::access_denied(); exit; } UI::show_header(); Share::gc(); $next_url = AmpConfig::get('web_path') . '/stats.php?action=share'; show_confirmation(T_('Shared Objects cleaned'), T_('Expired shared objects have been cleaned.'), $next_url); UI::show_footer();