Pages (2): 1 2   
Member
Member
froschfinger   19-07-2010, 17:06
#1

Hello there,

please bear with me if this has been discussed widely (I hope not), I was not able to find anything too close related to my case.

I am currently setting up a website for a photographer who wants to have a login area where customers of her can view an album of photographs they had ordered, so they can re-order them. No need for getting any web shop or data transmission to a contact form, it's just that those customers should be able to see a specific album after they logged on, and nobody else.

Setting up the basics is simple - we have some open albums visible to anyone, and one that is connected to a user, i.e. it has not been published, but is tied to a specific user with limited rights (viewing etc.) so that he is able to see them when he is on while nobody else sees the albums.

My question is: is it possible to have this very album/the pictures for the customer on a separate page and not in the main gallery, and make the login form redirect to that page? The photographer will have more than one customer, so sending them to a straight URI of a specific album will not work well . Can anybody help me out with some hints on this?

Thanks in advance .

Administrator
Administrator
acrylian   19-07-2010, 17:21
#2

That is possible. Since you can only assign passwords to top level albums I suggest this:

Create a toplevel album where you put all open viewable albums in and link directly to that via a main navigation for example. That will look like the index page.

Then you create a page that displays all future password albums except that one. We have some functions for that like isMyAlbum.

Member
Member
sbillard   19-07-2010, 17:46
#3

Guess you looked in the wrong place Maybe this is what you are lookin for http://www.zenphoto.org/2009/11/zenphoto-single-login/

Administrator
Administrator
acrylian   19-07-2010, 17:50
#4

And my suggestion was more for a separate client area, just to add.

Member
Member
froschfinger   19-07-2010, 22:18
#5

Hey you two,

thank you for helping me out a second time today. Not sure whether you nailed it or not, but it sounds helpful in the first place. What I want to achieve is a) an area where each and every visitor of the site can see some public albums and b) an area where a registered user can see his or her own album(s).

Suggestion 1 - acrylian - wouldn't that mean I have maybe a big album for all client sub-albums, and everyone, each client, can at least see that other clients also have albums up there, only that they cannot access it without the password?

Suggestion 2 - sbillard - I may be a complete stupid person, but I had already tried that out, resulting in a redirect to an upgrade for zenphoto - each time I try it out. No upgrade preinstalled for zenPhoto, so I wonder what that means...

Thank you again for your help!

Member
Member
sbillard   19-07-2010, 23:20
#6

2: The hack is a bit old. The zp-config.php file has moved. Change the line which reads:


if (!file_exists(dirname(__FILE__) . '/' . ZENFOLDER . "/zp-config.php")) {
to be:
if (!file_exists(dirname(__FILE__) . '/zp-data/zp-config.php")) {
alo change:
require_once(SERVERPATH . "/" . ZENFOLDER . PLUGIN_FOLDER . 'user_logout.php');
to be:
require_once(SERVERPATH . "/" . ZENFOLDER . "/" . PLUGIN_FOLDER . '/user_login-out.php');

Administrator
Administrator
acrylian   20-07-2010, 08:46
#7

As to my suggestion 1: Yes, you would have one top level album with subalbums for the public ones that you link to directly.
Since the client albums would also be top level albums (as only those can be password protected) no one visiting would see them. If you use the helper function isMyAlbum() to test the clients will only see their own albums if they are loggedin and nothing if not.

Rough code for a client page (a custom theme page like clientlogin.php):
`

Member
Member
froschfinger   20-07-2010, 09:37
#8

Hey there,

I will try out both later to see what helps me most. So far acrylian's approach seems closer to what I need, but my tests will tell .

Thanks again for so much help!

Member
Member
froschfinger   21-07-2010, 16:02
#9

Hey there,

I checked with the single_login approach and am having trouble to get any further. Once the login is processed, it leads to an 'object not found' page created by zenphoto. In my lay interpretation of the PHP code I'd think that

if (!is_null($_zp_current_admin)) {
if ($_zp_loggedin & ADMIN_RIGHTS) {
header("Location: " . WEBPATH . "/");
} else {
$albums = getManagedAlbumList();
$album = array_shift($albums);
header("Location: " . WEBPATH . "/".$album.'/');
}

is not leading to the page it should. I tried with a super admin and a normal user who is able to see an album exclusively. No avail so far....

Can somebody point me in the right direction?

Thanks as usual .

Member
Member
froschfinger   21-07-2010, 16:13
#10

I might add that nearly all paths seem to be wrong in the hack version.

EDIT: No, just my wrong interpretation of PHP code .

Member
Member
sbillard   22-07-2010, 00:06
#11

What do the links look like? One thing you should try is to hard code a link to a known album and see if that works. Anyway, compare the links to those that you get when you visit the album through the gallery. Let us know.

Member
Member
froschfinger   22-07-2010, 14:38
#12

Well, the page I land on after logging on is index.php?userlog=1&p= where I get the "The object cannot be found" (I see it in German, only assume it's named that way in English) error. It just doesn't seem to find the right path.

If I put up a

if (!defined('WEBPATH')) { define('WEBPATH', ''); }

for the

if (!is_null($_zp_current_admin)) {
if ($_zp_loggedin & ADMIN_RIGHTS) {
header("Location: " . WEBPATH . "/");
} else {
$albums = getManagedAlbumList();
$album = array_shift($albums);
header("Location: " . WEBPATH . "/".$album.'/');
}

stuff I get a successful redirect, but each time to the home page of my site, not the portfolio url (home: www.address.com, portfolio at www.address.com/portfolio) or the specific albums or or the user manages....

Member
Member
kagutsuchi   22-07-2010, 14:52
#13

Assuming that you have ADMIN_RIGHTS, then that behavior is exactly as prescribed in the code you posted. If the user logged in and has those rights, he will be redirected to the home page. Otherwise, the user will be redirected to a managed album.

Member
Member
froschfinger   22-07-2010, 21:17
#14

Just to get it straight: when I set up a user to be able to visit a certain album that hasn't been published, nothing else - is that user an admin then? I mean I choose 'Show all' and 'Overview' as his rights and select an unpublished album under 'Manage'?

If I leave out my !define WEBPATH, I get the 'Object not found' error, if I include it, I get redirected to the frontpage of my website (not the portfolio), be it an admin or the user form I described above... sorry if I start sounding lame .

Member
Member
sbillard   23-07-2010, 02:23
#15

It sounds like WEBPATH has not been defined. Does your script include the zenphoto scripts? You should probably check your CGI error log as well to see if it shows some errors.

Member
Member
froschfinger   24-07-2010, 09:20
#16

Yes, it has not been in the original script (http://www.zenphoto.org/2009/11/zenphoto-single-login/).
If I define webpath this way:

if (!defined('WEBPATH')) { define('WEBPATH', ''); }

the script leads me to the homepage of the site (not the portfolio), no matter what kind of user I am. If I leave it out like in the original script, I get these 'object not found' errors.

Administrator
Administrator
acrylian   24-07-2010, 09:28
#17

Do you use the recently updated file from the extensions section?

Member
Member
froschfinger   29-07-2010, 10:25
#18

I use exactly the one pointed to above: http://www.zenphoto.org/2009/11/zenphoto-single-login/

Administrator
Administrator
acrylian   29-07-2010, 10:51
#19

I think sbillard had updated that file either quite while you ask or shortly after. That's why I asked if it is the recent one. The one shortly before was not compatible.

Member
Member
jakeferguson   02-08-2010, 14:56
#20

Hey

I have tried also using the single user login extension and have followed the instructions to the T but when I navigate to where the index.php page included to use this I receive the error:

Fatal error: Call to undefined function printuserlogout() in /home/mysite/public_html/sitetest/single_login.php on line 41

any clues?

Jake

Pages (2): 1 2   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.