]> source.dussan.org Git - nextcloud-server.git/commitdiff
Merge github.com:owncloud/core
authorSam Tuke <samtuke@owncloud.com>
Thu, 31 Jan 2013 16:30:37 +0000 (16:30 +0000)
committerSam Tuke <samtuke@owncloud.com>
Thu, 31 Jan 2013 16:30:37 +0000 (16:30 +0000)
Conflicts:
lib/public/share.php

1  2 
apps/files_encryption/test/crypt.php
apps/files_encryption/test/util.php
lib/public/share.php

Simple merge
Simple merge
index 5fd1e2e29f388e75de34d5a2dd1d9c875fadca6b,3c5c2d53782ac793db96ca92cbcf169a2233b3f5..9894f1550a87a84667e69307a29d54c987b740a0
@@@ -456,22 -341,7 +341,14 @@@ class Share 
        * @return Returns true on success or false on failure
        */
        public static function unshare($itemType, $itemSource, $shareType, $shareWith) {
-               $item = self::getItems($itemType,
-                                                          $itemSource,
-                                                          $shareType,
-                                                          $shareWith,
-                                                          \OC_User::getUser(),
-                                                          self::FORMAT_NONE,
-                                                          null,
-                                                          1);
-               if ($item) {
+               if ($item = self::getItems($itemType, $itemSource, $shareType, $shareWith, \OC_User::getUser(), self::FORMAT_NONE, null, 1)) {
 +                      // Pass all the vars we have for now, they may be useful
 +                      \OC_Hook::emit('OCP\Share', 'pre_unshare', array(
 +                              'itemType' => $itemType,
 +                              'itemSource' => $itemSource,
 +                              'shareType' => $shareType,
 +                              'shareWith' => $shareWith,
-                       ));
++                      ));                     
                        self::delete($item['id']);
                        return true;
                }
        * @return Returns true on success or false on failure
        */
        public static function unshareAll($itemType, $itemSource) {
-               $shares = self::getItemShared($itemType, $itemSource);
-               if ($shares) {
+               if ($shares = self::getItemShared($itemType, $itemSource)) {
 +                      // Pass all the vars we have for now, they may be useful
 +                      \OC_Hook::emit('OCP\Share', 'pre_unshareAll', array(
 +                              'itemType' => $itemType,
 +                              'itemSource' => $itemSource,
 +                              'shares' => $shares
-                       ));
++                      ));                     
                        foreach ($shares as $share) {
                                self::delete($share['id']);
                        }
                                        continue;
                                }
                        }
 -                      if ( isset($row['uid_owner']) && $row['uid_owner'] != '') {\r
 -                              $row['displayname_owner'] = \OCP\User::getDisplayName($row['uid_owner']);\r
+                       // Add display names to result
+                       if ( isset($row['share_with']) && $row['share_with'] != '') {
+                               $row['share_with_displayname'] = \OCP\User::getDisplayName($row['share_with']);
+                       }
++                      if ( isset($row['uid_owner']) && $row['uid_owner'] != '') {
++                              $row['displayname_owner'] = \OCP\User::getDisplayName($row['uid_owner']);
+                       }
+                       
                        $items[$row['id']] = $row;
                }
                if (!empty($items)) {