Permissions issues: Self-registered users can't edit their auto-assigned albums?

Hi -
I'm a brand-new Zenphoto user, and am trying to set up a semi-public gallery with the following behaviors:

a- All users must be registered and logged in to access anything at all (ie, no "guest" accts/passwords, etc.)

b- Because all my users are part of a large "community", any uploaded images or files should be read-only accessible to all other registered users (ie, no private albums or album-level passwords).

c- When users register (using email address as username), each user should be assigned their own auto-created album based on their email address. Users should be able to upload AND edit their own album, and also create new sub-albums beneath it. No other user should be able to upload or edit another user's album; only view it.

d- I would prefer that new registrations require approval by an admin before they become active, but this isn't a "deal-breaker".

It seems like all of this should be easy, using the 'filter-personal_album', 'register_user', and 'user_login-out' plugins. However, there seems to be some overlap between these and I just can't get everything working despite trying just about every combination I can think of. I'm running version 1.4.1.6.

I start with only the 'admin' user, and no albums created. I am using the 'default' theme, and have all three of the above plugins active. In the 'register_user' options, "user album" is NOT checked; in 'filter-personal_album' the "automatically unpublish" option IS checked.

As expected, opening the site displays the login screen, with the 'register' link at the bottom. If I try to register a new user, I get this error: "Fatal error: Call to a member function setShow() on a non-object in ....filter-personal_album.php on line 103."

However, switching to the Admin user, I find that one new album 'user@domain.com' has been created -- but no new user has been added. The new album is owned by Admin and is non-published.

So I deleted the album and tried again, but with "user album" in 'register_user' turned ON. I got the exact same error when trying to register a user.

Finally, I tried turning OFF "automatically unpublish" in 'filter-personal_album'. This time it seemed to work: I was able to register a new user without error. But when I logged in under that new username, I found that TWO new personal albums had been created. One was called 'user@domain.com (user@domain.com)', and the other was 'user@domain.com (userdomain.com)' - same, but the "@" was removed. What I had hoped to find was just ONE personal album that included the user's name, like 'Joe Smith (user@domain.com)'. Why do I get two vs. one album auto-created?

Still logged in to the new username, I was able to upload images to both of these auto-created albums. However, I was not able to edit the albums - only upload (i.e., no 'Albums' tab was shown). Looking at my 'admin' profile confirms this: I see two 'managed albums', with only the 'upload' permission shown.

So the questions become:

a) How do I get only a single personal album created for a new user, vs. two?

b) Is there a way to have that single album include the person's name and email, vs. just repeating the email twice (very confusing when I'll have up to 1000 users!)

c) How can I get both upload and edit permissions for that new album assigned to the owner, vs. just upload?

Sorry for the long explanation, but wanted to provide all the data I had. Personally, it seems like these two plugins might be better combined into just one, since they overlap so much and each seems to cause errors with the other depending on how the various options are set?

Any help would sure be appreciated!

Thanks, Rob

Comments

  • 'filter-personal_album' is not a plugin that the development team supports. However, it should also not be need to accomplish your user registrations. What it might be doing is beyond me.

    So, the short answer is don't use that plugin.

    The album then will be named from the user's ID (in your case, the e-mail) Note that the name will be "sanitized" so that no file system disallowed characters are present.

    You will need to setup a "group" or default permissions for the registered user that limits his rights as you wish. User rights are described in the documentation on our web site.

    The user will automatically get upload rights. There is an option [security tab] that controls whether he also gets edit rights.
  • Hi -
    Thanks so much for the quick reply. I've deactivated the 'filter-personal_album' plugin.

    I did create a new group with default permissions, and 'register_user' is configured to use it as the default user group. I'm probably missing something, but I still can't find a way to give users edit rights in addition to upload. You mentioned "an option [security tab] that controls whether he also gets edit rights": The only security tab I can find is the one under Options / Security, and that has nothing to do with permissions. I've looked through every option of every tab and plugin, and can't find anything to assign edit rights other than "manage all albums" (which I don't want; users should only be able to manage their own assigned albums). Where should I be looking??

    Also, is there any way to have the users real name displayed as part of the auto-assigned album, instead of seeing their email duplicated? With so many users, seeing real names would sure be more useful than just email addresses!

    Thanks again,
    Rob
  • The option you are looking for is indeed on the security tab. Look down at the bottom for the one called "primary album edit".

    You can, of course, also enable this individually on the user's album listed in his managed album list.

    As built Zenphoto will default the title of an album to an seo friendly rendition of the folder name of the album. But of course, the title can be edited to anything you want.

    A filter could be build that automatically did this if you have skills in PHP and spend some time learning how Zenphoto works.
  • Hi -
    Well, turns out we're both right: My Options/Security tab definitely does NOT have the "primary album edit" option. So I viewed my installed version of /zp-core/lib-auth.php, and compared it to the source code on the zenphoto.org site.

    In Changeset 8135, back on 09/28/11, it looks like you added code for the "primary album edit" option as a replacement for what was apparently called "user album edit" in earlier versions? None of that code - either the original or your replacement - exists in my installed version of lib-auth.php, so it's no wonder I can't find it on the tab!

    I am totally confused at this point. I manually installed Zenphoto (i.e., not with a "one-click install") on my Dreamhost site less than a week ago. I downloaded the .ZIP package of code for version 1.4.1.6 (11/11/2011) right from your home page, and everything installed just fine.

    So I just re-downloaded that .ZIP file, opened it in WinRAR, and viewed the /zp-core/lib-auth.php file. It's identical to my installed version, with no mention of the "primary album edit" option. In fact, here's the getOptionsSupported function as it exists in your .ZIP file:

    `
    function getOptionsSupported() {
    return array( gettext('Minimum password length:') => array('key' => 'min_password_lenght', 'type' => OPTION_TYPE_TEXTBOX,
    'desc' => gettext('Minimum number of characters a password must contain.')),
    gettext('Password characters:') => array('key' => 'password_pattern', 'type' => OPTION_TYPE_CLEARTEXT,
    'desc' => gettext('Passwords must contain at least one of the characters from each of the groups. Groups are separated by "|". (Use "\|" to represent the "|" character in the groups.)')),
    gettext('settings')=> array('key'=>'lib_auth_info', 'type'=>OPTION_TYPE_CUSTOM,
    'order'=>9,
    'desc'=>'')
    );
    `
    }

    Did some kind of versioning error occur wnen creating that .ZIP file where an old version of the file was included vs. the newer one? And are there any similar versioning errors with any other files that would cause me problems down the road??

    Thanks, Rob
  • I am running the 1.4.2 beta, so maybe the change is introduced there. It is sometimes difficult to remember when something was introduced. I have not heard of any issues with the archive problems.
Sign In or Register to comment.