Exemplo n.º 1
0
                if ($podcast->save()) {
                    if ($redirect == '') {
                        $redirect = 'viewcache.php?cacheid=' . urlencode($podcast->getCacheId());
                    }
                    $tpl->redirect($redirect);
                } else {
                    $tpl->assign('errorfile', ERROR_UPLOAD_UNKNOWN);
                    $bError = true;
                }
            }
        }
    }
} else {
    if ($action == 'edit' || $action == 'delete') {
        $uuid = isset($_REQUEST['uuid']) ? $_REQUEST['uuid'] : 0;
        $podcast = podcast::fromUUID($uuid);
        if ($podcast === null) {
            $tpl->error(ERROR_PODCAST_NOT_EXISTS);
        }
        if ($redirect == '') {
            $redirect = 'viewcache.php?cacheid=' . urlencode($podcast->getCacheId());
        }
        if ($podcast->allowEdit() == false) {
            $tpl->error(ERROR_NO_ACCESS);
        }
        if ($action == 'edit') {
            if (isset($_REQUEST['ok'])) {
                // overwrite values
                $title = isset($_REQUEST['title']) ? $_REQUEST['title'] : $podcast->getTitle();
                if ($title == '') {
                    $tpl->assign('errortitle', true);