ADD: Commit as logged in user
[phorkie.git] / www / new.php
1 <?php
2 namespace phorkie;
3 /**
4  * Show paste creation form
5  *
6  * Elements:
7  * - description
8  * - file name (default: default.php)
9  * - content
10  *
11  * Creates and redirects to display page
12  */
13 require_once 'www-header.php';
14 if ($GLOBALS['phorkie']['auth']['secure'] > 0) {
15     require_once 'secure.php';
16 }
17
18 $repopo = new Repository_Post();
19 if ($repopo->process($_POST, $_SESSION)) {
20     redirect($repopo->repo->getLink('display'));
21 }
22
23 $phork = array(
24     '1' => new File(null, null)
25 );
26 $db = new Database();
27 render(
28     'new',
29     array(
30         'files'       => $phork,
31         'description' => '',
32         'htmlhelper'  => new HtmlHelper(),
33         'recents'     => $db->getSearch()->listAll(0, 5, 'crdate', 'desc'),
34         'dh'          => new \Date_HumanDiff(),
35     )
36 );
37 ?>