Skip to content
Snippets Groups Projects
Commit abc521db authored by Jörn Friedrich Dreyer's avatar Jörn Friedrich Dreyer
Browse files

add missing backticks

parent 75a5746b
No related branches found
No related tags found
No related merge requests found
......@@ -50,8 +50,11 @@ class Manager {
public function addShare($remote, $token, $password, $name, $owner) {
$user = $this->userSession->getUser();
if ($user) {
$query = $this->connection->prepare('INSERT INTO *PREFIX*share_external(`remote`, `share_token`, `password`,
`name`, `owner`, `user`, `mountpoint`, `mountpoint_hash`) VALUES(?, ?, ?, ?, ?, ?, ?, ?)');
$query = $this->connection->prepare('
INSERT INTO `*PREFIX*share_external`
(`remote`, `share_token`, `password`, `name`, `owner`, `user`, `mountpoint`, `mountpoint_hash`)
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
');
$mountPoint = Filesystem::normalizePath('/' . $name);
$hash = md5($mountPoint);
$query->execute(array($remote, $token, $password, $name, $owner, $user->getUID(), $mountPoint, $hash));
......@@ -75,8 +78,11 @@ class Manager {
$user = $this->userSession->getUser();
if ($user) {
$query = $this->connection->prepare('SELECT `remote`, `share_token`, `password`, `mountpoint`, `owner`
FROM *PREFIX*share_external WHERE `user` = ?');
$query = $this->connection->prepare('
SELECT `remote`, `share_token`, `password`, `mountpoint`, `owner`
FROM `*PREFIX*share_external`
WHERE `user` = ?
');
$query->execute(array($user->getUID()));
while ($row = $query->fetch()) {
......@@ -132,8 +138,12 @@ class Manager {
$sourceHash = md5($source);
$targetHash = md5($target);
$query = $this->connection->prepare('UPDATE *PREFIX*share_external SET
`mountpoint` = ?, `mountpoint_hash` = ? WHERE `mountpoint_hash` = ? AND `user` = ?');
$query = $this->connection->prepare('
UPDATE `*PREFIX*share_external`
SET `mountpoint` = ?, `mountpoint_hash` = ?
WHERE `mountpoint_hash` = ?
AND `user` = ?
');
$result = (bool)$query->execute(array($target, $targetHash, $sourceHash, $user->getUID()));
return $result;
......@@ -143,7 +153,11 @@ class Manager {
$user = $this->userSession->getUser();
$mountPoint = $this->stripPath($mountPoint);
$hash = md5($mountPoint);
$query = $this->connection->prepare('DELETE FROM *PREFIX*share_external WHERE `mountpoint_hash` = ? AND `user` = ?');
$query = $this->connection->prepare('
DELETE FROM `*PREFIX*share_external`
WHERE `mountpoint_hash` = ?
AND `user` = ?
');
return (bool)$query->execute(array($hash, $user->getUID()));
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment