]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
File access control omits now access to owner control.
authorSrokap <srokap@gmail.com>
Thu, 25 Oct 2012 12:45:02 +0000 (14:45 +0200)
committerSrokap <srokap@gmail.com>
Thu, 25 Oct 2012 12:45:02 +0000 (14:45 +0200)
engine/classes/ElggDiskFilestore.php

index f003764814dc24b048762791a8ab275be21bbf55..7aace43ba8452d7fd2d7e61ca8a0942cd3abb3d8 100644 (file)
@@ -200,18 +200,18 @@ class ElggDiskFilestore extends ElggFilestore {
         * @return string The full path of where the file is stored
         */
        public function getFilenameOnFilestore(ElggFile $file) {
-               $owner = $file->getOwnerEntity();
-               if (!$owner) {
-                       $owner = elgg_get_logged_in_user_entity();
+               $owner_guid = $file->getOwnerGuid();
+               if (!$owner_guid) {
+                       $owner_guid = elgg_get_logged_in_user_guid();
                }
 
-               if (!$owner) {
+               if (!$owner_guid) {
                        $msg = elgg_echo('InvalidParameterException:MissingOwner',
                                array($file->getFilename(), $file->guid));
                        throw new InvalidParameterException($msg);
                }
 
-               return $this->dir_root . $this->makefileMatrix($owner->guid) . $file->getFilename();
+               return $this->dir_root . $this->makefileMatrix($owner_guid) . $file->getFilename();
        }
 
        /**