Adds logic for making folders
This commit is contained in:
parent
e71f55cbc4
commit
c1dd5e1957
6 changed files with 210 additions and 5 deletions
31
php/MakeFolder.php
Normal file
31
php/MakeFolder.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
|
||||
if(!defined("COMMON"))
|
||||
require("Common.php");
|
||||
|
||||
$js = getJsonizedInput();
|
||||
$DB = get_DB();
|
||||
|
||||
$clientKey = $js['client'];
|
||||
|
||||
$complete=false;
|
||||
if($clientKey == md5(CLIENTPSK)) {
|
||||
// Authorized
|
||||
$complete=true;
|
||||
$name = $js['name'];
|
||||
$type = $js['invType'];
|
||||
$parent = $js['parent'];
|
||||
$owner = $js['owner'];
|
||||
$id = $js['id'];
|
||||
|
||||
$res = $DB->query("INSERT INTO `inventoryFolders` (folderName, type, version, folderID, agentID, parentFolderID ) VALUES ('$name', '$type', 0, '$id', '$owner', '$parent');");
|
||||
|
||||
if(!$res) $complete=false;
|
||||
}
|
||||
|
||||
|
||||
die(json_encode(array(
|
||||
"done" => $complete,
|
||||
"type" => "S2CSimpleReply"
|
||||
)));
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue