Exemplo n.º 1
0
                                $bError = true;
                            }
                        }
                    }
                }
            }
        }
        if ($bError == false) {
            $podcast->setFilenames($_FILES['file']['name']);
            $podcast->setLocal(1);
            // try saving file and record
            if (!move_uploaded_file($_FILES['file']['tmp_name'], $podcast->getFilename())) {
                $tpl->assign('errorfile', ERROR_UPLOAD_UNKNOWN);
                $bError = true;
            } else {
                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);