Example #1
0
 */
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : '';
if (empty($action) || $action == 'stream' || $action == 'download') {
    define('NO_SESSION', '1');
}
require_once 'lib/init.php';
Preference::init();
if (!AmpConfig::get('share')) {
    debug_event('UI::access_denied', 'Access Denied: sharing features are not enabled.', '3');
    UI::access_denied();
    exit;
}
switch ($action) {
    case 'show_create':
        UI::show_header();
        $type = Share::format_type($_REQUEST['type']);
        if (!empty($type) && !empty($_REQUEST['id'])) {
            $oid = $_REQUEST['id'];
            if (is_array($oid)) {
                $oid = $oid[0];
            }
            $object = new $type($oid);
            if ($object->id) {
                $object->format();
                require_once AmpConfig::get('prefix') . '/templates/show_add_share.inc.php';
            }
        }
        UI::show_footer();
        exit;
    case 'create':
        if (AmpConfig::get('demo_mode')) {