Is there way force users to register to view inside album?

jinspin

Joined: 2005-08-26
Posts: 26
Posted: Sat, 2005-08-27 21:04

Hi

I want to be able to force users to register to view the items in an album.
I want the user to see the albums but then if they click into the album, a message will appear that says they must register to view photos or comments.

Is there an easy good way to do this?

It is a really cool feature because i want to see who is viewing my albums and I don't want a bunch of unknown guests posting comments.

Thanks

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2005-08-27 22:29

this has been suggested before.. i think requiring core.viewSource permission to view contents of an album would work well.. ie, give core.view permission to see just the thumbnail, but if you don't have viewSource (view full size) then when you click on the thumbnail you'll see the login page. (this hasn't been implemented..)

 
jinspin

Joined: 2005-08-26
Posts: 26
Posted: Sat, 2005-08-27 22:43

I see what you are saying.
Just have permissions for Everybody to see album thumbnails.
And then have permissions for Registered Users to see full size photos or go to login page if not registered.

I think this would be very popular.
I hope this is on their future functionality because its dang cool.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2005-08-27 23:32

Try this patch for modules/core/ShowItem.inc..

Index: modules/core/ShowItem.inc
===================================================================
RCS file: /cvsroot/gallery/gallery2/modules/core/ShowItem.inc,v
retrieving revision 1.69
diff -u -r1.69 ShowItem.inc
--- modules/core/ShowItem.inc   23 Aug 2005 03:49:02 -0000      1.69
+++ modules/core/ShowItem.inc   27 Aug 2005 23:31:05 -0000
@@ -74,6 +74,10 @@
 
        /* Make sure we have permission to view this item */
        $ret = GalleryCoreApi::assertHasItemPermission($item->getId(), 'core.view');
+       if ($ret->isSuccess() && $item->getCanContainChildren()) {
+           /* We also need viewSource permission to see the contents of an album */
+           $ret = GalleryCoreApi::assertHasItemPermission($item->getId(), 'core.viewSource');
+       }
        if ($ret->isError()) {
            if ($ret->getErrorCode() & ERROR_PERMISSION_DENIED) {
                list ($ret2, $anonymousId) = GalleryCoreApi::getPluginParameter(
 
jinspin

Joined: 2005-08-26
Posts: 26
Posted: Sun, 2005-08-28 00:46

thanks for the code but the code does not seem to change anything. I did not see any difference. Am I doing something wrong? When I am logged in as a guest and click into pics, I can still see full size view.

I did try this also which seem to work- I set the Everybody permission to just View Item and set for registered users View All Versions. In this way, anon users can only see thumbnails even when they click on a thumbnail. If they were registered user- they could view the full size version. It woud be nice if they were prompted to register to see full size views.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2005-08-28 06:48

Everybody: no pemission
Registered users: view all versions

Set the above permissions for the album and all subitems. Then add view permission on just the album (uncheck the apply-to-subitems checkbox).
With this setup on current G2 you'll see the album thumbnail and can click it to see an empty album (no permission on the items). With the patch above, you can see the thumbnail and when you click it you get the login page.. after login you'll jump to the album and see the items (now you are a registered user and have permission)

 
jinspin

Joined: 2005-08-26
Posts: 26
Posted: Sun, 2005-08-28 16:13

Great- I will do what you say and see if it works for me :)

 
jinspin

Joined: 2005-08-26
Posts: 26
Posted: Sun, 2005-08-28 16:55

I set permissions and added the patch to code.
But when I click on album- it says Album is empty. It does not take me to login page. Is there other code I have to add? This is the code I copied and pasted from you into ShowItem.inc

/* Make sure we have permission to view this item */
$ret = GalleryCoreApi::assertHasItemPermission($item->getId(), 'core.view');
if ($ret->isSuccess() && $item->getCanContainChildren())
{
/* We also need viewSource permission to see the contents of an album */
$ret = GalleryCoreApi::assertHasItemPermission($item->getId(), 'core.viewSource');
}

if ($ret->isError()) {
if ($ret->getErrorCode() & ERROR_PERMISSION_DENIED) {
list ($ret2, $anonymousId) = GalleryCoreApi::getPluginParameter('module', 'core', 'id.anonymousUser');
if ($ret2->isError()) {
return array($ret->wrap(__FILE__, __LINE__), null);
}

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2005-08-28 21:03

sorry, don't know what to say.. it works for me, so there's either a problem with the permissions or the patch isn't applied correctly. do you have any permissions assigned directly to guest user?

 
jinspin

Joined: 2005-08-26
Posts: 26
Posted: Sun, 2005-08-28 22:12

hello

well hopefully final Gallery version will have this feature and I can upgrade to the working version when it comes out :) Thanks for the help though

These are my permissions which I believe is working correctly
album
- Everybody view all versions
- registered users view all versions
photo
- registered users view all versions

Theres only a few lines to this patch which i copied and pasted so i dunno what else could be wrong.
if ($ret->isSuccess() && $item->getCanContainChildren())
{
/* We also need viewSource permission to see the contents of an album */
$ret = GalleryCoreApi::assertHasItemPermission($item->getId(), 'core.viewSource');
}

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2005-08-29 01:36

yes, we did decide to add this for G2.0 final.. it's in cvs now, you can get it in tomorrow's nightly build.

"Everybody view all versions" is wrong. just view.

 
jinspin

Joined: 2005-08-26
Posts: 26
Posted: Mon, 2005-08-29 18:37

hey

i am just writing to let you know the patch all of a sudden does work now. It takes me to login page if I am not registered. So friggin cool!

FYI-
I did what you said and changed Everybody permission to View Item instead of View All.
I also noticed that when I flip to guest view after I login - it says album is empty when i click into it.
But when I actually logout and then try to view an album- then the patch works correctly and I am brought into login view.

Gallery 2 is so cool! And thanks for being so helpful.

 
jschmittat

Joined: 2005-08-28
Posts: 25
Posted: Mon, 2005-10-10 12:44

I applied the above mentioned changes some weeks ago. I work very fine. Thank you!

Now I updated to the final release. The feature does not work anymore and I had to enter the changes again. Did you decide not to add this feature it to the final version?

 
valiant

Joined: 2003-01-04
Posts: 32509
Posted: Mon, 2005-10-10 13:32

yep, we reverted the decision since it changed too much. it changed the definition / interpretion of the existing permissions. so we got a dozen users who complained and reverted it.
maybe we'll offer a similar fix which doesn;t affect the existing permissions. but for now, it't not part of g2.

 
jschmittat

Joined: 2005-08-28
Posts: 25
Posted: Mon, 2005-10-10 14:11

Ok, thanks for the information. It is easy to add the few lines of codes to make it work even in the latest version, now I know how to do it.

 
alphazap

Joined: 2005-10-12
Posts: 1
Posted: Wed, 2005-10-12 00:02

Where do you add the lines of code at within that core file? As I'm wanting to have users to be able to view thumbnails, but have it when they click the thumbnails, it takes them to the Registration page. Let me know how you did it! Thanks...

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Wed, 2005-10-12 02:27

I believe this is the post he's referring to: http://gallery.menalto.com/node/35288#comment-128874
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
jschmittat

Joined: 2005-08-28
Posts: 25
Posted: Wed, 2005-10-12 08:12

Yepp

 
mambocreed

Joined: 2005-08-26
Posts: 19
Posted: Mon, 2005-10-31 02:59

Is this patch working with the current release, or is there an alternate fix?

I've applied the patch and permissions as described - but rather than taking the user to a registration page, it's just stating that the album is empty (same as if patch wasn't applied). Maybe I edited the code incorrectly - here's what I've got:

/* Make sure we have permission to view this item */
if ($ret->isSuccess() && $item->getCanContainChildren()) {
/* We also need viewSource permission to see the contents of an album */
$ret = GalleryCoreApi::assertHasItemPermission($item->getId(), 'core.viewSource');
}
$ret = GalleryCoreApi::assertHasItemPermission($item->getId(), 'core.view');
if ($ret->isError()) {
if ($ret->getErrorCode() & ERROR_PERMISSION_DENIED) {
list ($ret2, $anonymousId) = GalleryCoreApi::getPluginParameter(

I've set the root album permissions (and all subs) to:

Everybody : None

I then went down the "chain" to an actual album, assigning throughout (without subs):

Everybody: View Item

Everything works until I get to the final album (which has also been set without subs to Everybody: View Item) - but no thumbnails are presented, only "No Items".

Please let me know what I'm doing wrong, or if this no longer works. Thanks for any help.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Mon, 2005-10-31 03:27

look where the line that checks 'core.view' is in the patch above.. you don't have it in the same place.
(you were supposed to add the new lines just below 'core.view', not just above)

 
mambocreed

Joined: 2005-08-26
Posts: 19
Posted: Wed, 2005-11-02 06:10

Mindless,

Thanks for replying so quickly - I'm sorry I haven't responded sooner. I forgot that the forum doesn't have notification.

I've reset the code as follows:

/* Make sure we have permission to view this item */
$ret = GalleryCoreApi::assertHasItemPermission($item->getId(), 'core.view');
if ($ret->isSuccess() && $item->getCanContainChildren()) {
/* We also need viewSource permission to see the contents of an album */
$ret = GalleryCoreApi::assertHasItemPermission($item->getId(), 'core.viewSource');
}

if ($ret->isError()) {
if ($ret->getErrorCode() & ERROR_PERMISSION_DENIED) {

I also set permissions as indicated:

Everyone: No Permissions (empty)

I issued that through the root album, checking the box to apply that to all sub-items.

I then set permissions to:

Everyone: View Item

With the sub-items box not checked, following down the chain, applying this to the album I had created with images in it and stopping. There is only one album with images at the moment, 3 levels down. Root > Parent > Parent > Images

But I am now being sent to the registration page on any attempt to visit the forum as a non-registered member.

Thanks very much for any help.

 
mambocreed

Joined: 2005-08-26
Posts: 19
Posted: Wed, 2005-11-02 18:56

Mindless,

Also, I was just wondering - I'm not sure if this is caused by the same problem I'm already having, but when I use this setup for requiring user registration, the random image modules (being called from external programs) no longer show images either.

I'm considering just altering the template to show the message "Please register to view full-size images" that appears next to the thumbnails that show up when Everybody is restricted to "View Item".

Also, given I'm actually integrating Gallery2 with Joomla and bypassing the Gallery2 registration process altogether, perhaps that would be a better method?

Or is there any patch or hack that would automatically replace all calls to the Gallery2 registration to the registration for the CMS? If, when a non-registered user clicks to view a thumbnail, they could be transported immediately to the CMS registration page (where I'm also taking a lot of time to hack that code to present users with nice forms and teasers on why they should register), that would be very cool.

Basically I'm using the photos to help drive registration.

Thanks again for all your help.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2005-11-03 01:57

when embedded we expect that you'll use CMS login/registration and the embed module uses the G2 embed api appropriately.
the above patch should not affect image block at all, but perhaps you changed your item permissions such that images are not accessible.

 
jschmittat

Joined: 2005-08-28
Posts: 25
Posted: Thu, 2005-11-03 10:36
Quote:
I also set permissions as indicated:

Everyone: No Permissions (empty)

I issued that through the root album, checking the box to apply that to all sub-items.

I then set permissions to:

Everyone: View Item

With the sub-items box not checked, following down the chain, applying this to the album I had created with images in it and stopping. There is only one album with images at the moment, 3 levels down. Root > Parent > Parent > Images

But I am now being sent to the registration page on any attempt to visit the forum as a non-registered member.

Try this:
For Root and the first parent album: Everyone: view all items.
For the second parent album: Everyone: view item
For the Images album and items: registered users view all versions

 
mambocreed

Joined: 2005-08-26
Posts: 19
Posted: Thu, 2005-11-03 20:24

Still a no go. Also, I'm testing this approach with the gallery as a standalone, not integrated with the CMS. I'm hoping that if I can get this approach to work, I can switch out the redirect to suit my purposes?
Here's where I'm at - which is prompting the "This album is empty." message when attempting to view the album.

Root --> Everyone: core[View all versions] : Box checked for apply changes to sub-items
Parent --> Everyone: core[View all versions] : Box checked for apply changes to sub-items
Image Album --> Everyone: Removed : Box checked for apply changes to sub-items

This results in the Parent album displaying "This album is empty."

Attempting, with initial settings above:

Image Album --> Everyone: core[View all version] : Box not checked for applying changes

This results in the Album displaying "This album is empty."

Attempting, with initial settings above:

Image Album --> Everyone: core[View item] : Box checked for applying changes

This results in Album thumbnails being displayed, and thumbnail being displayed when user clicks on thumbnail.

Attempting, with initial settings above:

Image Album --> Everyone: core[View item] : Box checked for applying changes
Image Album [Step 2] --> Everyone: Removed : Box not checked for applying changes

This ALSO results in Album thumbnails being displayed, and thumbnail being displayed when user clicks on thumbnail. HOWEVER, when navigating backwards to the Parent album, the Parent album displayed "This album is empty."

At this point, I became utterly confused and shot myself in the head :)

FINALLY, I gave this a shot, based again on the intial settings:

Image Album --> Everyone: core[View all versions] : Box checekd for applying changes
Individual Image --> Remove Everyone

At which point, just the individual image disappeared from the album.

This led me to believe that I've done something horribly wrong - my code is the same as the fixed code posted above.

For whatever reason, Gallery2 seems to be ignoring that code completely, treating the permissions on the parent album as THE permissions, and not looking to the children (as the code seems to be attempting?) for permissions.

At any rate, I think I've tried every possible combination here and I can not get the system to work on the latest release of Gallery2? Maybe there's some code lurking elsewhere (given this code was put in and removed at one point) that's negating this code?

And please don't take this as thought I'm questioning the validity of the code or Gallery2 - just wondering if there might be a chance that something has occurred along the way that broke the ability of this patch to work?

Also, thanks to some good advice :) - I now have my account set up to monitor the topic here, so hopefully I'll respond much sooner :) Doh.

Thanks.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Thu, 2005-11-03 22:36

sorry, i haven't read thru all that in detail (so possibly i'm repeating), but the patch is intended to allow:

Album:
Everybody: core.view
Registered Users (or any other users/groups): core.viewAll

Items in the album:
Everybody: no view permission
Registered Users (or any other users/groups): core.viewAll

Items have no permission for guests so they won't show up in search, imageblock, etc.
Album has core.view so you can see the thumbnail when browsing the parent; the album itself could show up in search, imageblock, etc. When you click to view the album it finds you don't have core.viewSource and redirects to login page. After login you should have permission so you can see the album and its contents.

 
mambocreed

Joined: 2005-08-26
Posts: 19
Posted: Thu, 2005-11-03 23:10

Ahhh... well that wouldn't work anyway - particularly with the inability to display the images in the image blocks.

Is there any way to restrict guests to thumbnail views only AND when clicking through to view the thumbnail, prompt them with a message that reads "Please register to view full-size photo".

Sorry for all of the bother. It's too bad, though, that the attempt to incorporate this into the core didn't go over :(

It'd be really nice to allow people to view thumbnails, and - realizing that when people click a thumbnail, they don't wish to see the same thumbnail, prompt for some action (registration or otherwise) to allow for viewing of the full-size photo.

Is there a way to just reroute the "view item" page to check to see if it's attempting to display a thumbnail image, and then redirect if that's the case?

Thanks for any help - and sorry for the two part question :)

I was just thinking that prompting users to register with a text link accompanying the thumbnail in image view would be easier to implement than the alternative.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Fri, 2005-11-04 15:11

sure..

Album and items:
Everybody: core.view
Registered Users (or any other users/groups): core.viewAll

Now the album and items may appear in imageblock, search, etc.
Adjust the patch above to check for core.viewSource on all items, not just albums.

 
mambocreed

Joined: 2005-08-26
Posts: 19
Posted: Sat, 2005-11-05 09:32

SUHWEET!!!!!!!!
You had to go and make me think :) Whenever I see code, I just automatically blank out.
I adjusted the permissions and made the edit you prescribed and BAM -
Michiel (the developer of the Joomla integration) already had the integration set up to deal with this permissions situation.
So within the CMS, a user clicks on the thumbnail and immediately gets routed to the CMS registration page (or any other page I want to set up for the purpose).
THANK YOU VERY MUCH!!!! But my head did explode from thinking about code :)

For anyone else trying to pull this one off real quick, look at the line directly above mindless' patch:

/* Make sure we have permission to view this item */
$ret = GalleryCoreApi::assertHasItemPermission($item->getId(), 'core.view');

Change this out to read:

/* Make sure we have permission to view this item */
$ret = GalleryCoreApi::assertHasItemPermission($item->getId(), 'core.viewSource');

THANK YOU VERY MUCH!

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2005-11-05 19:15

:)

 
jadmanx
jadmanx's picture

Joined: 2005-09-06
Posts: 83
Posted: Sun, 2005-11-20 02:41

i downt anderstand that ...
did it worke now ?
what file i must edit and how to do?
i whant that everybody can see the gallerys preview picture and whan everybody click on it there come the register forum not only the small preview picture

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2005-11-20 09:43

Just from reading through the thread....
Here's what to change:
http://gallery.menalto.com/node/35288#comment-128874

Here are the permissions to set:
http://gallery.menalto.com/node/35288#comment-146774
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
jadmanx
jadmanx's picture

Joined: 2005-09-06
Posts: 83
Posted: Sun, 2005-11-27 08:37

i downt anderstand that :-(

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2005-11-27 12:21

Sorry I don't know what to say. All you do is edit /modules/core/ShowItem.inc

and add these 4 lines:

        /* Make sure we have permission to view this item */
        $ret = GalleryCoreApi::assertHasItemPermission($item->getId(), 'core.view');
       if ($ret->isSuccess() && $item->getCanContainChildren()) {
           /* We also need viewSource permission to see the contents of an album */
           $ret = GalleryCoreApi::assertHasItemPermission($item->getId(), 'core.viewSource');
       }
        if ($ret->isError()) {
            if ($ret->getErrorCode() & ERROR_PERMISSION_DENIED) {
                list ($ret2, $anonymousId) = GalleryCoreApi::getPluginParameter(

____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
jadmanx
jadmanx's picture

Joined: 2005-09-06
Posts: 83
Posted: Thu, 2005-12-01 13:44

yes that i now but i downt anderstand the permissions to set i must edit it on every new pic ?!?
i cant edit the permission the page downt whant to load ...
where can i edit it manuel wich file...

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sat, 2005-12-03 17:06
mindless wrote:
Album and items:
Everybody: core.view
Registered Users (or any other users/groups): core.viewAll

Now the album and items may appear in imageblock, search, etc.
Adjust the patch above to check for core.viewSource on all items, not just albums.

To edit the permissions, just click on Edit Permissions for the album not the photo and change the permissions there.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
jadmanx
jadmanx's picture

Joined: 2005-09-06
Posts: 83
Posted: Sun, 2005-12-04 11:27

i have on everybody [core] View all versions but i cant edit it whan i use remove it make Nothing only a white page come and no message or somthing... whan i klick reloade ii always "everybody [core] View all versions"...
whats wrong ?

 
nivekiam
nivekiam's picture

Joined: 2002-12-10
Posts: 16504
Posted: Sun, 2005-12-04 16:02

Ah, so when you click on Remove to remove a permission you get a blank page.

First, did this happen before you modified the code above? Though that modification should not have affected this at all.

If that is the case, please post about that problem in Troubleshooting and Problems forum. Be sure to fill out the support template and also let them know what changes you've made.
____________________________________________
Like Gallery? Like the support? Donate now!!! See G2 live here

 
axisoverdrive
axisoverdrive's picture

Joined: 2005-12-09
Posts: 5
Posted: Fri, 2005-12-09 17:22

^Jadmanx, i had the same "white page" problem as well. The problem seems to be in how you patch your "showitem.inc". Make sure the lines of copied and pasted exactly from Mindless' code. I had some comments in there through the patch that ended up screwing the whole thing over (not much of a coder, i am).

 
axisoverdrive
axisoverdrive's picture

Joined: 2005-12-09
Posts: 5
Posted: Fri, 2005-12-09 17:27

Now i seem to be experiencing another problem; i think it has something with the way i've set up my permissions. Patch worked fine, but this is what happens:

PROBLEM: as a guest/ unlogged user, i can't see thumbnails in my root gallery. I'm being forced to the "login" page.

STATUS:
Root Gallery-
Everybody -- [core] View Item
Registered Users -- [core] View All Versions

I figure it has something to do with these permissions here? For some reason i can't find the "[core] view" option, or it's not there. What could i be doing wrong?

Do i need to go in and manually set all the permissions for each individual album?

Thanks.

 
axisoverdrive
axisoverdrive's picture

Joined: 2005-12-09
Posts: 5
Posted: Fri, 2005-12-09 20:55

Apparently as well, even if i set the Permissions for EVERYBODY to [core] View ALL Versions, I'm STILL being redirected to a login page when i try to access the gallery (when i'm not logged in).

Any help? Thanks.

 
axisoverdrive
axisoverdrive's picture

Joined: 2005-12-09
Posts: 5
Posted: Fri, 2005-12-09 21:01

(just in case, this is how my showitem.inc is structured...)

/* Make sure we have permission to view this item */
$ret = GalleryCoreApi::assertHasItemPermission($item->getId(), 'core.view');
if ($ret->isSuccess() && $item->getCanContainChildren()) {
/* We also need viewSource permission to see the contents of an album */
$ret = GalleryCoreApi::assertHasItemPermission($item->getId(), 'core.viewSource');
}
if ($ret->isError()) {
if ($ret->getErrorCode() & ERROR_PERMISSION_DENIED) {
list ($ret2, $anonymousId) = GalleryCoreApi::getPluginParameter(

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2005-12-10 05:40

try rolling back the patch and sorting out the permissions, then reapply the patch.

 
axisoverdrive
axisoverdrive's picture

Joined: 2005-12-09
Posts: 5
Posted: Mon, 2005-12-12 16:37

Hi Mindless,

I rolled back the patch. The result was being able to view everything, except for the final photo which turned out to be only a thumbnail.

however, when i reapplied the patch, the same problem occurred; i could not view the gallery at all without having first to login.

My permissions settings are the following:

Gallery/Album
Everybody -- [core]View item
Registered Users -- [core] View All Versions

Are these correct? Thanks.

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Tue, 2005-12-13 04:08

yes, those are the permissions to set on the albums where you want login required. if you set that on your root album then login is required to see that album too.

 
mambocreed

Joined: 2005-08-26
Posts: 19
Posted: Tue, 2005-12-13 05:52

For those of you having problems - given I had quite a few issues myself...

Mindless' code actually follows logic. If you're trying to approach the problem by applying the code and not understanding the logic behind it, you're likely to spin your wheels for a few days (like I did).

Seriously not being wise - but read the code. It's not as hard as it seems. Once you understand the code, everything else will fall into place.

I promise you that, if you put your fears aside, you can actually read through it.

I absolutely could NOT get it to work until I finally broke down and tried to understand what it was doing. Once you do, you can then apply it to different situations.

Good luck.

And no, it doesn't work until you understand it. I don't know whether that's by design :) - but it seems like a little effort, beyond simply applying a patch, is required here.

In other words, this is kind of like a solution wrapped in a puzzle. You can't apply it without understanding it.

And my apologies to Mindless if I'm wrong on that - just seemed that way to me.

When I tried to take the shortcut and apply the patch, set permissions, and run with it - I had pretty much all of the same problems listed in this thread.

 
neo314

Joined: 2005-07-31
Posts: 28
Posted: Sat, 2006-03-25 20:55

Does this patch no longer work on the Blackjack release of the code?

have reapplied and permissions are the same, yet it lets me straight into the galleries

any help would be great

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sat, 2006-03-25 23:03

It's basically the same for 2.1, just anywhere you see $ret->isError() just put $ret and any GalleryStatus::error is GalleryCoreApi::error

 
mambocreed

Joined: 2005-08-26
Posts: 19
Posted: Sat, 2006-03-25 23:22
        /* Make sure we have permission to view this item */
        $ret = GalleryCoreApi::assertHasItemPermission($item->getId(), 'core.viewSource');
+       if ($ret->isSuccess() && $item->getCanContainChildren()) {
+           /* We also need viewSource permission to see the contents of an album */
+           $ret = GalleryCoreApi::assertHasItemPermission($item->getId(), 'core.viewSource');
+       }
        if ($ret) {
            if ($ret->getErrorCode() & ERROR_PERMISSION_DENIED) {
                list ($ret2, $anonymousId) = GalleryCoreApi::getPluginParameter(

Mindless, this is the new code per your instructions? I'm not seeing GalleryStatus::error anywhere?

What does "anywhere" mean?

 
mindless
mindless's picture

Joined: 2004-01-04
Posts: 8601
Posted: Sun, 2006-03-26 01:33

it means i didn't look at the patch, just telling you API changes that could have an effect.
$ret->isSuccess() should be changed to !$ret
it seems odd to me that the code above shows core.viewSource twice.. isn't the first one just core.view?

 
neo314

Joined: 2005-07-31
Posts: 28
Posted: Sun, 2006-03-26 01:41

done as the above comments suggested, now instead of an error message, i get a blank white screen?

any ideas?