Merged in paulis/processmaker/HOR-1472 (pull request #4611)

HOR-1472
This commit is contained in:
Julio Cesar Laura Avendaño
2016-07-28 18:28:25 -04:00
7 changed files with 19 additions and 240 deletions

View File

@@ -886,44 +886,6 @@ class ProcessMakerWebDav extends HTTP_WebDAV_Server
return ($new && !$existing_col) ? "201 Created" : "204 No Content";
}
/**
* PROPPATCH method handler
*
* @param array general parameter passing array
* @return bool true on success
*/
public function PROPPATCH(&$options)
{
global $prefs, $tab;
$msg = "";
$path = $options["path"];
$dir = dirname($path) . "/";
$base = basename($path);
G::LoadSystem('inputfilter');
$filter = new InputFilter();
foreach ($options["props"] as $key => $prop) {
if ($prop["ns"] == "DAV:") {
$options["props"][$key]['status'] = "403 Forbidden";
} else {
if (isset($prop["val"])) {
$query = "REPLACE INTO properties SET path = '%s', name = '%s', ns= '%s', value = '%s'";
$query = $filter->preventSqlInjection($query, Array($options['path'],$prop['name'],$prop['ns'],$prop['val']));
error_log($query);
} else {
$query = "DELETE FROM properties WHERE path = '%s' AND name = '%s' AND ns = '%s'";
$query = $filter->preventSqlInjection($query, Array($options['path'],$prop['name'],$prop['ns']));
}
mysql_query($query);
}
}
return "";
}
/**
* LOCK method handler
*

View File

@@ -1136,10 +1136,8 @@ class workspaceTools
$oDbMaintainer = new DataBaseMaintenance($dbInfo["host"], $dbInfo["user"], $dbInfo["pass"]);
CLI::logging("Saving database {$dbInfo["name"]}\n");
$oDbMaintainer->connect($dbInfo["name"]);
$oDbMaintainer->lockTables();
$oDbMaintainer->setTempDir($path . "/");
$oDbMaintainer->backupDataBase($oDbMaintainer->getTempDir() . $dbInfo["name"] . ".sql");
$oDbMaintainer->unlockTables();
$dbNames[] = $dbInfo;
}
return $dbNames;