X-Git-Url: https://git.cweiske.de/phorkie.git/blobdiff_plain/ec66a5c7d17cb1e67ee066f2e9bdaf5bbc9ab614..49a42cb5ac2e29668d2ac584e1a84d9818b047ea:/www/index.php diff --git a/www/index.php b/www/index.php index f821c84..5b5e4f6 100644 --- a/www/index.php +++ b/www/index.php @@ -1,51 +1,13 @@ createNew(); - $vc = $repo->getVc(); - $vc->initRepository(); - foreach (glob($repo->repoDir . '/.git/hooks/*') as $hookfile) { - unlink($hookfile); - } - file_put_contents($repo->repoDir . '.git/description', $_POST['description']); - - foreach ($_POST['files'] 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' => new File(null, null) +header( + 'Location: ' + . Tools::fullUrl($GLOBALS['phorkie']['cfg']['index']) ); -render('index', array('files' => $phork, 'description' => '')); -?> \ No newline at end of file +?>