diff --git a/appinfo/info.xml b/appinfo/info.xml index 8c7feea..90cbfb8 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -10,6 +10,6 @@ curl - + diff --git a/lib/backend.php b/lib/backend.php index 4fcf039..3cec2a6 100644 --- a/lib/backend.php +++ b/lib/backend.php @@ -136,7 +136,7 @@ public function getListing($FOLDER, $showdel) { // Get the listing from the database $requery = false; $uid = \OCP\User::getUser(); - $query = "SELECT id, name, grouping, mtime, deleted FROM *PREFIX*ownnote WHERE uid=? ORDER BY name"; + $query = "SELECT id, name, `grouping`, mtime, deleted FROM *PREFIX*ownnote WHERE uid=? ORDER BY name"; $results = $this->db->executeQuery($query, Array($uid))->fetchAll(); $results2 = $results; if ($results) @@ -164,7 +164,7 @@ public function getListing($FOLDER, $showdel) { } } if ($requery) { - $query = "SELECT id, name, grouping, mtime, deleted FROM *PREFIX*ownnote WHERE uid=? ORDER BY name"; + $query = "SELECT id, name, `grouping`, mtime, deleted FROM *PREFIX*ownnote WHERE uid=? ORDER BY name"; $results = $this->db->executeQuery($query, Array($uid))->fetchAll(); $requery = false; } @@ -248,7 +248,7 @@ public function getListing($FOLDER, $showdel) { } } if ($requery) { - $query = "SELECT id, name, grouping, mtime, deleted FROM *PREFIX*ownnote WHERE uid=? ORDER BY name"; + $query = "SELECT id, name, `grouping`, mtime, deleted FROM *PREFIX*ownnote WHERE uid=? ORDER BY name"; $results = $this->db->executeQuery($query, Array($uid))->fetchAll(); } // Now also make sure the files exist, they may not if the user switched folders in admin. @@ -304,7 +304,7 @@ public function createNote($FOLDER, $in_name, $in_group) { $fileindb = false; $filedeldb = false; $ret = -1; - $query = "SELECT id, name, grouping, mtime, deleted FROM *PREFIX*ownnote WHERE uid=? and name=? and grouping=?"; + $query = "SELECT id, name, `grouping`, mtime, deleted FROM *PREFIX*ownnote WHERE uid=? and name=? and `grouping`=?"; $results = $this->db->executeQuery($query, Array($uid, $name, $group))->fetchAll(); foreach($results as $result) if ($result['deleted'] == 0) { @@ -314,7 +314,7 @@ public function createNote($FOLDER, $in_name, $in_group) { $filedeldb = true; } if ($filedeldb) { - $query = "DELETE FROM *PREFIX*ownnote WHERE uid=? and name=? and grouping=?"; + $query = "DELETE FROM *PREFIX*ownnote WHERE uid=? and name=? and `grouping`=?"; $results = $this->db->executeQuery($query, Array($uid, $name, $group)); } if (! $fileindb) { @@ -329,7 +329,7 @@ public function createNote($FOLDER, $in_name, $in_group) { $mtime = $info['mtime']; } } - $query = "INSERT INTO *PREFIX*ownnote (uid, name, grouping, mtime, note, shared) VALUES (?,?,?,?,?,?)"; + $query = "INSERT INTO *PREFIX*ownnote (uid, name, `grouping`, mtime, note, shared) VALUES (?,?,?,?,?,?)"; $this->db->executeQuery($query, Array($uid,$name,$group,$mtime,'','')); $ret = $this->db->lastInsertId('*PREFIX*ownnote'); } @@ -341,9 +341,9 @@ public function deleteNote($FOLDER, $name, $group) { $now = new DateTime(); $mtime = $now->getTimestamp(); $uid = \OCP\User::getUser(); - $query = "UPDATE *PREFIX*ownnote set note='', deleted=1, mtime=? WHERE uid=? and name=? and grouping=?"; + $query = "UPDATE *PREFIX*ownnote set note='', deleted=1, mtime=? WHERE uid=? and name=? and `grouping`=?"; $results = $this->db->executeQuery($query, Array($mtime, $uid, $name, $group)); - $query = "SELECT id FROM *PREFIX*ownnote WHERE uid=? and name=? and grouping=?"; + $query = "SELECT id FROM *PREFIX*ownnote WHERE uid=? and name=? and `grouping`=?"; $results = $this->db->executeQuery($query, Array($uid, $name, $group))->fetchAll(); foreach($results as $result) { $query2 = "DELETE FROM *PREFIX*ownnote_parts WHERE id=?"; @@ -363,7 +363,7 @@ public function deleteNote($FOLDER, $name, $group) { public function editNote($name, $group) { $ret = ""; $uid = \OCP\User::getUser(); - $query = "SELECT id,note FROM *PREFIX*ownnote WHERE uid=? and name=? and grouping=?"; + $query = "SELECT id,note FROM *PREFIX*ownnote WHERE uid=? and name=? and `grouping`=?"; $results = $this->db->executeQuery($query, Array($uid, $name, $group))->fetchAll(); foreach($results as $result) { $ret = $result['note']; @@ -397,7 +397,7 @@ public function saveNote($FOLDER, $name, $group, $content, $in_mtime) { $mtime = $info['mtime']; } } - $query = "UPDATE *PREFIX*ownnote set note='', mtime=? WHERE uid=? and name=? and grouping=?"; + $query = "UPDATE *PREFIX*ownnote set note='', mtime=? WHERE uid=? and name=? and `grouping`=?"; $results = $this->db->executeQuery($query, Array($mtime, $uid, $name, $group)); $query = "DELETE FROM *PREFIX*ownnote_parts WHERE id=?"; $results = $this->db->executeQuery($query, Array($id)); @@ -426,7 +426,7 @@ public function renameNote($FOLDER, $name, $group, $in_newname, $in_newgroup) { public function deleteGroup($FOLDER, $group) { // We actually need to just rename all the notes $uid = \OCP\User::getUser(); - $query = "SELECT id, name, grouping, mtime FROM *PREFIX*ownnote WHERE deleted=0 and uid=? and grouping=?"; + $query = "SELECT id, name, `grouping`, mtime FROM *PREFIX*ownnote WHERE deleted=0 and uid=? and `grouping`=?"; $results = $this->db->executeQuery($query, Array($uid, $group))->fetchAll(); foreach($results as $result) { $this->renameNote($FOLDER, $result['name'], $group, $result['name'], ''); @@ -436,7 +436,7 @@ public function deleteGroup($FOLDER, $group) { public function renameGroup($FOLDER, $group, $newgroup) { $uid = \OCP\User::getUser(); - $query = "SELECT id, name, grouping, mtime FROM *PREFIX*ownnote WHERE deleted=0 and uid=? and grouping=?"; + $query = "SELECT id, name, `grouping`, mtime FROM *PREFIX*ownnote WHERE deleted=0 and uid=? and `grouping`=?"; $results = $this->db->executeQuery($query, Array($uid, $group))->fetchAll(); foreach($results as $result) { $this->renameNote($FOLDER, $result['name'], $group, $result['name'], $newgroup);