case 'create': if (AmpConfig::get('demo_mode')) { UI::access_denied(); exit; } if (!Core::form_verify('add_share', 'post')) { UI::access_denied(); exit; } UI::show_header(); $id = Share::create_share($_REQUEST['type'], $_REQUEST['id'], $_REQUEST['allow_stream'], $_REQUEST['allow_download'], $_REQUEST['expire'], $_REQUEST['secret'], $_REQUEST['max_counter']); if (!$id) { require_once AmpConfig::get('prefix') . '/templates/show_add_share.inc.php'; } else { $share = new Share($id); $body = T_('Share created.') . '<br />' . T_('You can now start sharing the following url:') . '<br />' . '<a href="' . $share->public_url . '" target="_blank">' . $share->public_url . '</a><br />' . '<div id="share_qrcode" style="text-align: center"></div>' . '<script language="javascript" type="text/javascript">$(\'#share_qrcode\').qrcode({text: "' . $share->public_url . '", width: 128, height: 128});</script>' . '<br /><br />' . T_('You can also embed this share as a web player into your website, with the following html code:') . '<br />' . '<i>' . htmlentities('<iframe style="width: 630px; height: 75px;" src="' . Share::get_url($share->id, $share->secret) . '&embed=true"></iframe>') . '</i><br />'; $title = T_('Object Shared'); show_confirmation($title, $body, AmpConfig::get('web_path') . '/stats.php?action=share'); } UI::show_footer(); 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();