X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/bfa1501efa1a49893208c794ea262a075b13fc1d..92d6cf1f537c2126baf324cbdadbef1067e156b6:/www/index.php diff --git a/www/index.php b/www/index.php index 8fc2405..7ff1814 100644 --- a/www/index.php +++ b/www/index.php @@ -1,52 +1,13 @@ createNew(); - $vc = $repo->getVc(); - $vc->initRepository(); - file_put_contents($repo->repoDir . '.git/description', $_POST['description']); - - foreach ($_POST['file'] as $num => $arFile) { - if ($arFile['name'] != '') { - $fname = $arFile['name']; - } else { - $fname = 'phork' . $num . '.' . $arFile['type']; - } - $fpath = $repo->repoDir . $fname; - file_put_contents($fpath, $arFile['content']); - //fixme: let the class do that when it is able to - $command = $vc->getCommand('add') - ->addArgument($fname) - ->execute(); - } - $command = $vc->getCommand('commit') - ->setOption('message', 'initial paste') - ->setOption('author', 'Anonymous ') - ->execute(); - //redirect to phork - redirect($repo->getLink('display')); -} - -$phork = array( - '1' => array( - 'filename' => '', - 'content' => '', - 'type' => '' - ) +header( + 'Location: ' + . Tools::fullUrl('/' . $GLOBALS['phorkie']['cfg']['index']) ); -render('index', array('file' => $phork, 'description' => '')); -?> \ No newline at end of file +?>