-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathstage_commit.php
More file actions
executable file
·38 lines (33 loc) · 1.09 KB
/
stage_commit.php
File metadata and controls
executable file
·38 lines (33 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
require("./etc/file_dispatcher/config.php");
require("./etc/sql.php");
require("./modules/file_dispatcher/sql/db_dispatcher.php");
require('./modules/file_dispatcher/main.php');?>
<?php
session_start();
echo 'POST'.$_POST["article"].$_SESSION["path"];
$z = new dispatcher("./data",$_SESSION["path"],'r',1);
echo '<br>lecture mode get this code:'.$z->get_h_code().'<br>';
if( $z->get_h_code() != "NOT_FOUND" ){ //UPDATE
$z = new dispatcher("./data",$_SESSION["path"],'u',1);
echo $_SESSION["path"]." - 'u',1";
echo $z->getError();
}
else { //CREATE
$cnnx = new db_dispatcher();
$z = new dispatcher("./data",$_SESSION["path"],'c',$cnnx->get_userid($_SESSION['user']));
echo $_SESSION["path"]." - 'c',1";
echo $z->getError();
}
$a = $z->get_version();
$z->new_version();
$z->save_in_file($_POST['article']);
$z->set_version($a);
echo "<br><br>FILES : ";
print_r($_FILES);
echo "<br>finfiles<br>";
$z->create_attach($_FILES['fileToUpload']);
echo '<br>H8CODE'.$z->get_h_code()." saved in:";
print_r($z->get_tree());
header("Location: "."/lecture/".$_SESSION["path"]);
?>