Update jQuery from 1.12.4 to 3.7.1
[phorkie.git] / www / index.php
index 31aef7d0d35257db0c5dd90a4f082a097d49237d..5b5e4f64288e2b326d11a90908dcdcf1787d2544 100644 (file)
@@ -1,53 +1,13 @@
 <?php
-namespace Phorkie;
 /**
- * Show paste creation form
- *
- * Elements:
- * - description
- * - file name (default: default.php)
- * - content
- *
- * Creates and redirects to display page
+ * Jump to the index as per the configuration
  */
+namespace phorkie;
+$reqWritePermissions = false;
 require_once 'www-header.php';
 
-if (isset($_POST['file'])) {
-    //save
-    $repoDir = $GLOBALS['phorkie']['cfg']['repos'];
-    $n = count(glob($repoDir . '/*', GLOB_ONLYDIR));
-    $dir = $repoDir . '/' . $n . '/'; 
-    mkdir($dir, 0777);//FIXME
-    $vc = new VersionControl_Git($dir);
-    $vc->initRepository();
-    file_put_contents($dir . '.git/description', $_POST['description']);
-
-    foreach ($_POST['file'] as $num => $arFile) {
-        if ($arFile['name'] != '') {
-            $fname = $arFile['name'];
-        } else {
-            $fname = 'phork' . $num . '.' . $arFile['type'];
-        }
-        $fpath = $dir . $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')
-        ->execute();
-    //redirect to phork
-    redirect($n);
-}
-
-$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
+?>