diff options
author | jfd <jfd@underverse> | 2012-07-30 22:46:14 +0400 |
---|---|---|
committer | Jörn Friedrich Dreyer <jfd@butonic.de> | 2012-07-31 20:53:05 +0400 |
commit | ede464f05872574a703c36d8d976b5c97e55c23f (patch) | |
tree | c075f46d52b905a93cb5d3137af5198de83d34f2 /apps/calendar | |
parent | 3c5670b662ea9e5ee36146f10f63faaadacb8187 (diff) |
escape all identifiers with backticks
Diffstat (limited to 'apps/calendar')
-rw-r--r-- | apps/calendar/appinfo/update.php | 6 | ||||
-rw-r--r-- | apps/calendar/lib/calendar.php | 20 | ||||
-rw-r--r-- | apps/calendar/lib/object.php | 28 | ||||
-rw-r--r-- | apps/calendar/lib/share.php | 36 |
4 files changed, 45 insertions, 45 deletions
diff --git a/apps/calendar/appinfo/update.php b/apps/calendar/appinfo/update.php index ce7f304a499..3b5998d9987 100644 --- a/apps/calendar/appinfo/update.php +++ b/apps/calendar/appinfo/update.php @@ -2,7 +2,7 @@ $installedVersion=OCP\Config::getAppValue('calendar', 'installed_version'); if (version_compare($installedVersion, '0.2.1', '<')) { - $stmt = OCP\DB::prepare( 'SELECT id, calendarcolor FROM *PREFIX*calendar_calendars WHERE calendarcolor IS NOT NULL' ); + $stmt = OCP\DB::prepare( 'SELECT `id`, `calendarcolor` FROM `*PREFIX*calendar_calendars` WHERE `calendarcolor` IS NOT NULL' ); $result = $stmt->execute(); while( $row = $result->fetchRow()) { $id = $row['id']; @@ -11,7 +11,7 @@ if (version_compare($installedVersion, '0.2.1', '<')) { continue; } $color = '#' .$color; - $stmt = OCP\DB::prepare( 'UPDATE *PREFIX*calendar_calendars SET calendarcolor=? WHERE id=?' ); + $stmt = OCP\DB::prepare( 'UPDATE `*PREFIX*calendar_calendars` SET `calendarcolor`=? WHERE `id`=?' ); $r = $stmt->execute(array($color,$id)); } -}
\ No newline at end of file +} diff --git a/apps/calendar/lib/calendar.php b/apps/calendar/lib/calendar.php index 869b35e2e1b..09cbee204dc 100644 --- a/apps/calendar/lib/calendar.php +++ b/apps/calendar/lib/calendar.php @@ -51,10 +51,10 @@ class OC_Calendar_Calendar{ $values = array($uid); $active_where = ''; if (!is_null($active) && $active){ - $active_where = ' AND active = ?'; + $active_where = ' AND `active` = ?'; $values[] = $active; } - $stmt = OCP\DB::prepare( 'SELECT * FROM *PREFIX*calendar_calendars WHERE userid = ?' . $active_where ); + $stmt = OCP\DB::prepare( 'SELECT * FROM `*PREFIX*calendar_calendars` WHERE `userid` = ?' . $active_where ); $result = $stmt->execute($values); $calendars = array(); @@ -81,7 +81,7 @@ class OC_Calendar_Calendar{ * @return associative array */ public static function find($id){ - $stmt = OCP\DB::prepare( 'SELECT * FROM *PREFIX*calendar_calendars WHERE id = ?' ); + $stmt = OCP\DB::prepare( 'SELECT * FROM `*PREFIX*calendar_calendars` WHERE `id` = ?' ); $result = $stmt->execute(array($id)); return $result->fetchRow(); @@ -106,7 +106,7 @@ class OC_Calendar_Calendar{ $uri = self::createURI($name, $uris ); - $stmt = OCP\DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' ); + $stmt = OCP\DB::prepare( 'INSERT INTO `*PREFIX*calendar_calendars` (`userid`,`displayname`,`uri`,`ctag`,`calendarorder`,`calendarcolor`,`timezone`,`components`) VALUES(?,?,?,?,?,?,?,?)' ); $result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components)); return OCP\DB::insertid('*PREFIX*calendar_calendars'); @@ -126,7 +126,7 @@ class OC_Calendar_Calendar{ public static function addCalendarFromDAVData($principaluri,$uri,$name,$components,$timezone,$order,$color){ $userid = self::extractUserID($principaluri); - $stmt = OCP\DB::prepare( 'INSERT INTO *PREFIX*calendar_calendars (userid,displayname,uri,ctag,calendarorder,calendarcolor,timezone,components) VALUES(?,?,?,?,?,?,?,?)' ); + $stmt = OCP\DB::prepare( 'INSERT INTO `*PREFIX*calendar_calendars` (`userid`,`displayname`,`uri`,`ctag`,`calendarorder`,`calendarcolor`,`timezone`,`components`) VALUES(?,?,?,?,?,?,?,?)' ); $result = $stmt->execute(array($userid,$name,$uri,1,$order,$color,$timezone,$components)); return OCP\DB::insertid('*PREFIX*calendar_calendars'); @@ -155,7 +155,7 @@ class OC_Calendar_Calendar{ if(is_null($order)) $order = $calendar['calendarorder']; if(is_null($color)) $color = $calendar['calendarcolor']; - $stmt = OCP\DB::prepare( 'UPDATE *PREFIX*calendar_calendars SET displayname=?,calendarorder=?,calendarcolor=?,timezone=?,components=?,ctag=ctag+1 WHERE id=?' ); + $stmt = OCP\DB::prepare( 'UPDATE `*PREFIX*calendar_calendars` SET `displayname`=?,`calendarorder`=?,`calendarcolor`=?,`timezone`=?,`components`=?,`ctag`=`ctag`+1 WHERE `id`=?' ); $result = $stmt->execute(array($name,$order,$color,$timezone,$components,$id)); return true; @@ -168,7 +168,7 @@ class OC_Calendar_Calendar{ * @return boolean */ public static function setCalendarActive($id,$active){ - $stmt = OCP\DB::prepare( 'UPDATE *PREFIX*calendar_calendars SET active = ? WHERE id = ?' ); + $stmt = OCP\DB::prepare( 'UPDATE `*PREFIX*calendar_calendars` SET `active` = ? WHERE `id` = ?' ); $stmt->execute(array($active, $id)); return true; @@ -180,7 +180,7 @@ class OC_Calendar_Calendar{ * @return boolean */ public static function touchCalendar($id){ - $stmt = OCP\DB::prepare( 'UPDATE *PREFIX*calendar_calendars SET ctag = ctag + 1 WHERE id = ?' ); + $stmt = OCP\DB::prepare( 'UPDATE `*PREFIX*calendar_calendars` SET `ctag` = `ctag` + 1 WHERE `id` = ?' ); $stmt->execute(array($id)); return true; @@ -192,10 +192,10 @@ class OC_Calendar_Calendar{ * @return boolean */ public static function deleteCalendar($id){ - $stmt = OCP\DB::prepare( 'DELETE FROM *PREFIX*calendar_calendars WHERE id = ?' ); + $stmt = OCP\DB::prepare( 'DELETE FROM `*PREFIX*calendar_calendars` WHERE `id` = ?' ); $stmt->execute(array($id)); - $stmt = OCP\DB::prepare( 'DELETE FROM *PREFIX*calendar_objects WHERE calendarid = ?' ); + $stmt = OCP\DB::prepare( 'DELETE FROM `*PREFIX*calendar_objects` WHERE `calendarid` = ?' ); $stmt->execute(array($id)); return true; diff --git a/apps/calendar/lib/object.php b/apps/calendar/lib/object.php index 2a6ceaf4684..df866bd3c5f 100644 --- a/apps/calendar/lib/object.php +++ b/apps/calendar/lib/object.php @@ -19,7 +19,7 @@ class OC_Calendar_Object{ * ['calendardata'] */ public static function all($id){ - $stmt = OCP\DB::prepare( 'SELECT * FROM *PREFIX*calendar_objects WHERE calendarid = ?' ); + $stmt = OCP\DB::prepare( 'SELECT * FROM `*PREFIX*calendar_objects` WHERE `calendarid` = ?' ); $result = $stmt->execute(array($id)); $calendarobjects = array(); @@ -41,10 +41,10 @@ class OC_Calendar_Object{ * in ['calendardata'] */ public static function allInPeriod($id, $start, $end){ - $stmt = OCP\DB::prepare( 'SELECT * FROM *PREFIX*calendar_objects WHERE calendarid = ?' - .' AND ((startdate >= ? AND startdate <= ? AND repeating = 0)' - .' OR (enddate >= ? AND enddate <= ? AND repeating = 0)' - .' OR (startdate <= ? AND repeating = 1))' ); + $stmt = OCP\DB::prepare( 'SELECT * FROM `*PREFIX*calendar_objects` WHERE `calendarid` = ?' + .' AND ((`startdate` >= ? AND `startdate` <= ? AND `repeating` = 0)' + .' OR (`enddate` >= ? AND `enddate` <= ? AND `repeating` = 0)' + .' OR (`startdate` <= ? AND `repeating` = 1))' ); $start = self::getUTCforMDB($start); $end = self::getUTCforMDB($end); $result = $stmt->execute(array($id, @@ -66,7 +66,7 @@ class OC_Calendar_Object{ * @return associative array */ public static function find($id){ - $stmt = OCP\DB::prepare( 'SELECT * FROM *PREFIX*calendar_objects WHERE id = ?' ); + $stmt = OCP\DB::prepare( 'SELECT * FROM `*PREFIX*calendar_objects` WHERE `id` = ?' ); $result = $stmt->execute(array($id)); return $result->fetchRow(); @@ -79,7 +79,7 @@ class OC_Calendar_Object{ * @return associative array */ public static function findWhereDAVDataIs($cid,$uri){ - $stmt = OCP\DB::prepare( 'SELECT * FROM *PREFIX*calendar_objects WHERE calendarid = ? AND uri = ?' ); + $stmt = OCP\DB::prepare( 'SELECT * FROM `*PREFIX*calendar_objects` WHERE `calendarid` = ? AND `uri` = ?' ); $result = $stmt->execute(array($cid,$uri)); return $result->fetchRow(); @@ -103,7 +103,7 @@ class OC_Calendar_Object{ $uri = 'owncloud-'.md5($data.rand().time()).'.ics'; - $stmt = OCP\DB::prepare( 'INSERT INTO *PREFIX*calendar_objects (calendarid,objecttype,startdate,enddate,repeating,summary,calendardata,uri,lastmodified) VALUES(?,?,?,?,?,?,?,?,?)' ); + $stmt = OCP\DB::prepare( 'INSERT INTO `*PREFIX*calendar_objects` (`calendarid`,`objecttype`,`startdate`,`enddate`,`repeating`,`summary`,`calendardata`,`uri`,`lastmodified`) VALUES(?,?,?,?,?,?,?,?,?)' ); $stmt->execute(array($id,$type,$startdate,$enddate,$repeating,$summary,$data,$uri,time())); $object_id = OCP\DB::insertid('*PREFIX*calendar_objects'); @@ -123,7 +123,7 @@ class OC_Calendar_Object{ $object = OC_VObject::parse($data); list($type,$startdate,$enddate,$summary,$repeating,$uid) = self::extractData($object); - $stmt = OCP\DB::prepare( 'INSERT INTO *PREFIX*calendar_objects (calendarid,objecttype,startdate,enddate,repeating,summary,calendardata,uri,lastmodified) VALUES(?,?,?,?,?,?,?,?,?)' ); + $stmt = OCP\DB::prepare( 'INSERT INTO `*PREFIX*calendar_objects` (`calendarid`,`objecttype`,`startdate`,`enddate`,`repeating`,`summary`,`calendardata`,`uri`,`lastmodified`) VALUES(?,?,?,?,?,?,?,?,?)' ); $stmt->execute(array($id,$type,$startdate,$enddate,$repeating,$summary,$data,$uri,time())); $object_id = OCP\DB::insertid('*PREFIX*calendar_objects'); @@ -145,7 +145,7 @@ class OC_Calendar_Object{ OC_Calendar_App::loadCategoriesFromVCalendar($object); list($type,$startdate,$enddate,$summary,$repeating,$uid) = self::extractData($object); - $stmt = OCP\DB::prepare( 'UPDATE *PREFIX*calendar_objects SET objecttype=?,startdate=?,enddate=?,repeating=?,summary=?,calendardata=?, lastmodified = ? WHERE id = ?' ); + $stmt = OCP\DB::prepare( 'UPDATE `*PREFIX*calendar_objects` SET `objecttype`=?,`startdate`=?,`enddate`=?,`repeating`=?,`summary`=?,`calendardata`=?,`lastmodified`= ? WHERE `id` = ?' ); $stmt->execute(array($type,$startdate,$enddate,$repeating,$summary,$data,time(),$id)); OC_Calendar_Calendar::touchCalendar($oldobject['calendarid']); @@ -166,7 +166,7 @@ class OC_Calendar_Object{ $object = OC_VObject::parse($data); list($type,$startdate,$enddate,$summary,$repeating,$uid) = self::extractData($object); - $stmt = OCP\DB::prepare( 'UPDATE *PREFIX*calendar_objects SET objecttype=?,startdate=?,enddate=?,repeating=?,summary=?,calendardata=?, lastmodified = ? WHERE id = ?' ); + $stmt = OCP\DB::prepare( 'UPDATE `*PREFIX*calendar_objects` SET `objecttype`=?,`startdate`=?,`enddate`=?,`repeating`=?,`summary`=?,`calendardata`=?,`lastmodified`= ? WHERE `id` = ?' ); $stmt->execute(array($type,$startdate,$enddate,$repeating,$summary,$data,time(),$oldobject['id'])); OC_Calendar_Calendar::touchCalendar($oldobject['calendarid']); @@ -181,7 +181,7 @@ class OC_Calendar_Object{ */ public static function delete($id){ $oldobject = self::find($id); - $stmt = OCP\DB::prepare( 'DELETE FROM *PREFIX*calendar_objects WHERE id = ?' ); + $stmt = OCP\DB::prepare( 'DELETE FROM `*PREFIX*calendar_objects` WHERE `id` = ?' ); $stmt->execute(array($id)); OC_Calendar_Calendar::touchCalendar($oldobject['calendarid']); @@ -195,7 +195,7 @@ class OC_Calendar_Object{ * @return boolean */ public static function deleteFromDAVData($cid,$uri){ - $stmt = OCP\DB::prepare( 'DELETE FROM *PREFIX*calendar_objects WHERE calendarid = ? AND uri=?' ); + $stmt = OCP\DB::prepare( 'DELETE FROM `*PREFIX*calendar_objects` WHERE `calendarid`= ? AND `uri`=?' ); $stmt->execute(array($cid,$uri)); OC_Calendar_Calendar::touchCalendar($cid); @@ -203,7 +203,7 @@ class OC_Calendar_Object{ } public static function moveToCalendar($id, $calendarid){ - $stmt = OCP\DB::prepare( 'UPDATE *PREFIX*calendar_objects SET calendarid=? WHERE id = ?' ); + $stmt = OCP\DB::prepare( 'UPDATE `*PREFIX*calendar_objects` SET `calendarid`=? WHERE `id`=?' ); $stmt->execute(array($calendarid,$id)); OC_Calendar_Calendar::touchCalendar($id); diff --git a/apps/calendar/lib/share.php b/apps/calendar/lib/share.php index 54c531892f0..aba27221653 100644 --- a/apps/calendar/lib/share.php +++ b/apps/calendar/lib/share.php @@ -25,7 +25,7 @@ class OC_Calendar_Share{ }else{ $active_where = ''; } - $stmt = OCP\DB::prepare("SELECT * FROM *PREFIX*calendar_share_" . $type . " WHERE ((share = ? AND sharetype = 'user') " . $group_where . ") AND owner <> ? " . $permission_where . " " . $active_where); + $stmt = OCP\DB::prepare("SELECT * FROM `*PREFIX*calendar_share_" . $type . "` WHERE ((`share` = ? AND `sharetype` = 'user') " . $group_where . ") AND `owner` <> ? " . $permission_where . " " . $active_where); $result = $stmt->execute(array($userid, $userid)); $return = array(); while( $row = $result->fetchRow()){ @@ -40,7 +40,7 @@ class OC_Calendar_Share{ * @return: (array) $users - information about users a calendar / event is shared with */ public static function allUsersSharedwith($id, $type){ - $stmt = OCP\DB::prepare('SELECT * FROM *PREFIX*calendar_share_' . $type . ' WHERE ' . $type . 'id = ? ORDER BY share'); + $stmt = OCP\DB::prepare('SELECT * FROM `*PREFIX*calendar_share_' . $type . '` WHERE `' . $type . 'id` = ? ORDER BY `share`'); $result = $stmt->execute(array($id)); $users = array(); while( $row = $result->fetchRow()){ @@ -72,7 +72,7 @@ class OC_Calendar_Share{ if($sharetype == 'public'){ $share = self::generate_token($id, $type); } - $stmt = OCP\DB::prepare('INSERT INTO *PREFIX*calendar_share_' . $type . ' (owner,share,sharetype,' . $type . 'id,permissions' . (($type == self::CALENDAR)?', active':'') . ') VALUES(?,?,?,?,0' . (($type == self::CALENDAR)?', 1':'') . ')' ); + $stmt = OCP\DB::prepare('INSERT INTO `*PREFIX*calendar_share_' . $type . '` (`owner`,`share`,`sharetype`,`' . $type . 'id`,`permissions`' . (($type == self::CALENDAR)?',`active`':'') . ') VALUES(?,?,?,?,0' . (($type == self::CALENDAR)?', 1':'') . ')' ); $result = $stmt->execute(array($owner,$share,$sharetype,$id)); if($sharetype == 'public'){ return $share; @@ -90,7 +90,7 @@ class OC_Calendar_Share{ * @return (bool) */ public static function unshare($owner, $share, $sharetype, $id, $type){ - $stmt = OCP\DB::prepare('DELETE FROM *PREFIX*calendar_share_' . $type . ' WHERE owner = ? ' . (($sharetype != 'public')?'AND share = ?':'') . ' AND sharetype = ? AND ' . $type . 'id = ?'); + $stmt = OCP\DB::prepare('DELETE FROM `*PREFIX*calendar_share_' . $type . '` WHERE `owner` = ? ' . (($sharetype != 'public')?'AND `share` = ?':'') . ' AND `sharetype` = ? AND `' . $type . 'id` = ?'); if($sharetype != 'public'){ $stmt->execute(array($owner,$share,$sharetype,$id)); }else{ @@ -111,7 +111,7 @@ class OC_Calendar_Share{ if($sharetype == 'public' && $permission == 1){ $permission = 0; } - $stmt = OCP\DB::prepare('UPDATE *PREFIX*calendar_share_' . $type . ' SET permissions = ? WHERE share = ? AND sharetype = ? AND ' . $type . 'id = ?'); + $stmt = OCP\DB::prepare('UPDATE `*PREFIX*calendar_share_' . $type . '` SET `permissions` = ? WHERE `share` = ? AND `sharetype` = ? AND `' . $type . 'id` = ?'); $stmt->execute(array($permission, $share, $sharetype, $id)); return true; } @@ -148,7 +148,7 @@ class OC_Calendar_Share{ * @return (bool) */ public static function is_already_shared($owner, $share, $sharetype, $id, $type){ - $stmt = OCP\DB::prepare('SELECT * FROM *PREFIX*calendar_share_' . $type . ' WHERE owner = ? AND share = ? AND sharetype = ? AND ' . $type . 'id = ?'); + $stmt = OCP\DB::prepare('SELECT * FROM `*PREFIX*calendar_share_' . $type . '` WHERE `owner` = ? AND `share` = ? AND `sharetype` = ? AND `' . $type . 'id` = ?'); $result = $stmt->execute(array($owner, $share, $sharetype, $id)); if($result->numRows() > 0){ return true; @@ -160,7 +160,7 @@ class OC_Calendar_Share{ $i = 0; foreach($groups as $group){ $group_where .= ' OR '; - $group_where .= " (share = '" . $group . "' AND sharetype = 'group') "; + $group_where .= ' (`share` = \'' . $group . '\' AND `sharetype` = \'group\') '; $i++; } return $group_where; @@ -168,7 +168,7 @@ class OC_Calendar_Share{ private static function permission_sql($permission = null){ $permission_where = ''; if(!is_null($permission)){ - $permission_where = ' AND permissions = '; + $permission_where = ' AND `permissions` = '; $permission_where .= ($permission=='rw')?"'1'":"'0'"; } return $permission_where; @@ -176,7 +176,7 @@ class OC_Calendar_Share{ private static function active_sql($active = null){ $active_where = ''; if(!is_null($active)){ - $active_where = 'AND active = '; + $active_where = 'AND `active` = '; $active_where .= (!is_null($active) && $active)?'1':'0'; } return $active_where; @@ -191,7 +191,7 @@ class OC_Calendar_Share{ public static function is_editing_allowed($share, $id, $type){ $group_where = self::group_sql(OC_Group::getUserGroups($share)); $permission_where = self::permission_sql('rw'); - $stmt = OCP\DB::prepare("SELECT * FROM *PREFIX*calendar_share_" . $type . " WHERE ((share = ? AND sharetype = 'user') " . $group_where . ") " . $permission_where); + $stmt = OCP\DB::prepare('SELECT * FROM `*PREFIX*calendar_share_' . $type . '` WHERE ((`share` = ? AND `sharetype` = \'user\') ' . $group_where . ') ' . $permission_where); $result = $stmt->execute(array($share)); if($result->numRows() == 1){ return true; @@ -211,7 +211,7 @@ class OC_Calendar_Share{ */ public static function check_access($share, $id, $type){ $group_where = self::group_sql(OC_Group::getUserGroups($share)); - $stmt = OCP\DB::prepare("SELECT * FROM *PREFIX*calendar_share_" . $type . " WHERE (" . $type . "id = ? AND (share = ? AND sharetype = 'user') " . $group_where . ")"); + $stmt = OCP\DB::prepare('SELECT * FROM `*PREFIX*calendar_share`_' . $type . '` WHERE (`' . $type . 'id` = ? AND (`share` = ? AND `sharetype` = \'user\') ' . $group_where . ')'); $result = $stmt->execute(array($id,$share)); $rows = $result->numRows(); if($rows > 0){ @@ -229,9 +229,9 @@ class OC_Calendar_Share{ * @return: mixed - bool if false, array with type and id if true */ public static function getElementByToken($token){ - $stmt_calendar = OCP\DB::prepare("SELECT * FROM *PREFIX*calendar_share_" . OC_Calendar_Share::CALENDAR . " WHERE sharetype = 'public' AND share = ?"); + $stmt_calendar = OCP\DB::prepare("SELECT * FROM `*PREFIX*calendar_share_" . OC_Calendar_Share::CALENDAR . "` WHERE `sharetype` = 'public' AND `share` = ?"); $result_calendar = $stmt_calendar->execute(array($token)); - $stmt_event = OCP\DB::prepare("SELECT * FROM *PREFIX*calendar_share_" . OC_Calendar_Share::EVENT . " WHERE sharetype = 'public' AND share = ?"); + $stmt_event = OCP\DB::prepare("SELECT * FROM `*PREFIX*calendar_share_" . OC_Calendar_Share::EVENT . "` WHERE `sharetype` = 'public' AND `share` = ?"); $result_event = $stmt_event->execute(array($token)); $return = array(); if($result_calendar->numRows() == 0 && $result_event->numRows() == 0){ @@ -253,7 +253,7 @@ class OC_Calendar_Share{ * @param (string) $ */ public static function set_active($share, $id, $active){ - $stmt = OCP\DB::prepare("UPDATE *PREFIX*calendar_share_calendar SET active = ? WHERE share = ? AND sharetype = 'user' AND calendarid = ?"); + $stmt = OCP\DB::prepare("UPDATE `*PREFIX*calendar_share_calendar` SET `active` = ? WHERE `share` = ? AND `sharetype` = 'user' AND `calendarid` = ?"); $stmt->execute(array($active, $share, $id)); } @@ -263,13 +263,13 @@ class OC_Calendar_Share{ * @return (bool) */ public static function post_userdelete($userid){ - $stmt = OCP\DB::prepare('DELETE FROM *PREFIX*calendar_share_calendar WHERE owner = ?'); + $stmt = OCP\DB::prepare('DELETE FROM `*PREFIX*calendar_share_calendar` WHERE `owner` = ?'); $stmt->execute(array($userid)); - $stmt = OCP\DB::prepare('DELETE FROM *PREFIX*calendar_share_event WHERE owner = ?'); + $stmt = OCP\DB::prepare('DELETE FROM `*PREFIX*calendar_share_event` WHERE `owner` = ?'); $stmt->execute(array($userid)); - $stmt = OCP\DB::prepare("DELETE FROM *PREFIX*calendar_share_calendar WHERE share = ? AND sharetype = 'user'"); + $stmt = OCP\DB::prepare("DELETE FROM `*PREFIX*calendar_share_calendar` WHERE `share` = ? AND `sharetype` = 'user'"); $stmt->execute(array($userid)); - $stmt = OCP\DB::prepare("DELETE FROM *PREFIX*calendar_share_event WHERE share = ? AND sharetype = 'user'"); + $stmt = OCP\DB::prepare("DELETE FROM `*PREFIX*calendar_share_event` WHERE `share` = ? AND `sharetype` = 'user'"); $stmt->execute(array($userid)); return true; } |