]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix sql command in calendar's share lib
authorGeorg Ehrke <dev@georgswebsite.de>
Mon, 26 Mar 2012 07:48:58 +0000 (09:48 +0200)
committerGeorg Ehrke <dev@georgswebsite.de>
Mon, 26 Mar 2012 07:48:58 +0000 (09:48 +0200)
apps/calendar/lib/share.php

index a5ca0a6e7385049f3e1bc3277bddfba40f41fe03..def1026c5e1fcec4c4b318577f66c66bb4fee6cb 100644 (file)
@@ -21,7 +21,7 @@ class OC_Calendar_Share{
                $group_where = self::group_sql(OC_Group::getUserGroups($userid));
                $permission_where = self::permission_sql($permission);
                $active_where = self::active_sql($active);
-               $stmt = OC_DB::prepare('SELECT * FROM *PREFIX*calendar_share_' . $type . ' WHERE ((share = ? AND sharetype = "user") ' . $group_where . ') AND owner <> ? ' . $permission_where . ' ' . $active_where . ')');
+               $stmt = OC_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()){
@@ -168,8 +168,8 @@ class OC_Calendar_Share{
        private static function permission_sql($permission = null){
                $permission_where = '';
                if(!is_null($permission)){
-                       $permission_where = 'AND permissions = ';
-                       $permission_where .= ($permission=='rw')?'1':'0';
+                       $permission_where = ' AND permissions = ';
+                       $permission_where .= ($permission=='rw')?'"1"':'"0"';
                }
                return $permission_where;
        }