From: Sylvie G. <sgr...@gm...> - 2010-04-16 15:24:50
|
I propose a rollback of this one. I will accept it but it has not been tested enough 1/ false comment: file has perm via the category 2/ one notice $object_type that has not been replaced 3/ the check of perms is no more done : tiki_view_file_gallery is only for file not for file_galleries Thread: Re: [Tikiwiki-devel] Problem with File galleries and object permission in Tiki 4.2 .. need to find time to fix properly. sylvie As I said on the devel list , the fix is in the perm syustem. On Wed, 2010-03-24 at 05:15 +0000, sam...@us... wrote: > Revision: 26283 > http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=26283&view=rev > Author: sampaioprimo > Date: 2010-03-24 05:15:34 +0000 (Wed, 24 Mar 2010) > > Log Message: > ----------- > [FIX] list files in a gallery even if user does not have global permission to view galleries but has permission to view a single gallery > > Modified Paths: > -------------- > branches/5.x/lib/tikilib.php > > Modified: branches/5.x/lib/tikilib.php > =================================================================== > --- branches/5.x/lib/tikilib.php 2010-03-24 05:06:48 UTC (rev 26282) > +++ branches/5.x/lib/tikilib.php 2010-03-24 05:15:34 UTC (rev 26283) > @@ -2402,14 +2402,16 @@ > $fgal_perms = array(); > } > foreach( $result as $res ) { > - $object_type = ( $res['isgal'] == 1 ? 'file gallery' : 'file'); > - if (isset($fgal_perms[$res['id']])) { > - $res['perms'] = $fgal_perms[$res['id']]; > + // there are no permission for individual files, so if $res is a file we use galleryId to check for permissions > + $galleryId = $res['isgal'] == 1 ? $res['id'] : $res['galleryId']; > + > + if (isset($fgal_perms[$galleryId])) { > + $res['perms'] = $fgal_perms[$galleryId]; > } else { > - $fgal_perms[$res['id']] = $res['perms'] = $this->get_perm_object($res['id'], $object_type, array(), false); > + $fgal_perms[$galleryId] = $res['perms'] = $this->get_perm_object($galleryId, 'file gallery', array(), false); > } > if ($galleryId <=0) { > - $cachelib->cacheItem($cacheName, serialize($fgal_perms), 'fgals_perms_'.$res['id'].'_'); > + $cachelib->cacheItem($cacheName, serialize($fgal_perms), 'fgals_perms_'.$galleryId.'_'); > } > // Don't return the current item, if : > // the user has no rights to view the file gallery AND no rights to list all galleries (in case it's a gallery) > > > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > Tikiwiki-cvs mailing list > Tik...@li... > https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs |