How do I create client/member access pages?
Posted: 10 July 2007 11:25 PM   [ Ignore ]  
Lab Assistant
RankRank
Total Posts:  108
Joined  08-18-2006

I’m working on a site for a client who wants to have a client access page. He wants to be able to give a client a password where he or she will be able to review and download .jpgs and video files. How best do I accomplish this? I was thinking of creating a weblog called “clients” where he could post an entry that would contain links to the files for review/download. Then each new client would be an entry in the “clients” weblog. How do I go about limiting access to a specific entry for a specific client/member in a way that would be easy for my client to enable?

 Signature 

qrux :: design :: photography

Profile
 
 
Posted: 11 July 2007 05:45 AM   [ Ignore ]   [ # 1 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1097
Joined  03-22-2006

Instead of a weblog for clients, just hold them in a new ‘Clients’ member group, and only allow that group access to the template. You could also use robin’s Download Lock module tied in with the downloads weblog to ensure that only members in that group can download the files.

To restrict entries to individual members, you could ensure that the client group is in the multi-author list for that weblog, and set the intended recipient as the author, then on template use the {logged_in_member_id} variable inside the author_id=”” weblog entries parameter.

This will mean that it will ONLY show entries that the client has faux-authored, but there is nothing stopping you from adding an additional weblog entries tag with an author_id=”” parameter that is set to your clients superadmin account, that way generic downloads can be handled also.

Edit: You could even, instead of using your clients superadmin member id in this second tag, create a fake member in the clients member group called something like ‘Generic Client Download’ or something to that effect, this might be slightly easier to understand from your clients point-of-view.

 Signature 

(a.k.a the_butcher)

Profile
 
 
Posted: 11 July 2007 11:39 PM   [ Ignore ]   [ # 2 ]  
Lab Assistant
RankRank
Total Posts:  108
Joined  08-18-2006

Thanks for the great info. I knew there was an easier way, I’ve been wracking my brain trying to figure this out. I’ll give your ideas a shot. Thanks again!

 Signature 

qrux :: design :: photography

Profile
 
 
Posted: 12 July 2007 12:11 AM   [ Ignore ]   [ # 3 ]  
Research Assistant
RankRankRank
Total Posts:  529
Joined  10-24-2005
the_butcher - 11 July 2007 05:45 AM

To restrict entries to individual members, you could ensure that the client group is in the multi-author list for that weblog, and set the intended recipient as the author, then on template use the {logged_in_member_id} variable inside the author_id=”” weblog entries parameter.

This seems interesting.  Could you clarify what “client group is in the multi-author list for that weblog, and set the intended recipient as the author” means?  I’m not sure I know where this is located.

Thanks!

 Signature 

Stephen Slater

Profile
 
 
Posted: 12 July 2007 03:23 AM   [ Ignore ]   [ # 4 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1097
Joined  03-22-2006

Well, it seems I got confused. The ‘Include user in PUBLISH page multi-author list?’ setting is actually per member, and can be found in the member administration section of the member’s preferences pane.

Since this is going to be a private feature, ticking this box for each client I don’t see being too much pain - if it was public then yes, no good.

Perhaps this should be a per group default setting also?

 Signature 

(a.k.a the_butcher)

Profile
 
 
Posted: 12 July 2007 05:27 PM   [ Ignore ]   [ # 5 ]  
Research Assistant
RankRankRank
Total Posts:  529
Joined  10-24-2005

Yeah, this is a clever approach, but I’m not sure it will work on a per client basis.  It would work if it was a per group… no?

Any other thoughts?

 Signature 

Stephen Slater

Profile
 
 
Posted: 12 July 2007 07:32 PM   [ Ignore ]   [ # 6 ]  
Research Assistant
RankRankRank
Total Posts:  529
Joined  10-24-2005

I’ve come up with this…

{exp:weblog:entries weblog="my_weblog" group_id="{logged_in_group_id}"}
<a href="{path=group/template}">{title}</a>
{/exp:weblog:entries}

...but {logged_in_group_id} is throwing it off.  Why won’t this variable work inside a parameter?  ...and what would be an alternate solution?

Thanks for any help you can provide.

 Signature 

Stephen Slater

Profile
 
 
Posted: 13 July 2007 03:09 AM   [ Ignore ]   [ # 7 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1097
Joined  03-22-2006

Ah, silly me yet again, that variable is available only inside the weblog tag, you would have to use {group_id}

smile

Still, using group_id instead of member_id will still enable them to see all of the downloads… no?

 Signature 

(a.k.a the_butcher)

Profile
 
 
Posted: 13 July 2007 06:40 AM   [ Ignore ]   [ # 8 ]  
Research Assistant
RankRankRank
Total Posts:  529
Joined  10-24-2005

{exp:weblog:entries weblog="my_weblog" group_id="{group_id}"

I believe the logic will work but now we’re running into a parse order issue.  Parameters cannot contain variables unless I’m mistaking?  Nothing is rendered when I use the above tag.  If I hard code the member group ID, it works great, so the logic is fine.  Trying to make the group_id dynamic with a variable won’t work.

I’ve tried group_id, member_id, logged_in_member_id, dynamic variables, segment variables, etc… all within group_id=”” with no luck.  Since this is proving to be a parse order issue, can you think of any other solutions for limiting the weblog entries to a specific group?

Thanks Butcher for your thoughts on this!

 Signature 

Stephen Slater

Profile
 
 
Posted: 13 July 2007 07:28 AM   [ Ignore ]   [ # 9 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6077
Joined  08-04-2002

Haven’t really delved into this thread so this is just off the top…
Could you append the identifier to the end of the URL (segment) and use that instead. So, if a client is logged in, all their links have their group or member id in the links.

Profile
 
 
Posted: 13 July 2007 07:44 AM   [ Ignore ]   [ # 10 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1097
Joined  03-22-2006

PHP on input would definately work

<?php
global $SESS;
?>

{exp
:weblog:entries group_id="<?php echo $SESS->userdata['group_id']; ?>"}

The problem with using anything from the URL is that it can be changed, allowing people to see and/or potentially download files not assigned to them.

 Signature 

(a.k.a the_butcher)

Profile
 
 
Posted: 13 July 2007 08:14 AM   [ Ignore ]   [ # 11 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6077
Joined  08-04-2002

The problem with using anything from the URL is that it can be changed, allowing people to see and/or potentially download files not assigned to them.

That’s true.

Profile
 
 
Posted: 13 July 2007 01:09 PM   [ Ignore ]   [ # 12 ]  
Research Assistant
RankRankRank
Total Posts:  529
Joined  10-24-2005

Thanks butcher.  Thanks PXLated.

Could you give me a high level explanation of what PHP on input is?  I’m no PHP guru, but I’m finding out very quickly that I need to learn it.  Is PHP on input something I could read about and implement not having the PHP knowledge that I should?

Any clarification would help.

Thanks.

 Signature 

Stephen Slater

Profile
 
 
Posted: 13 July 2007 01:31 PM   [ Ignore ]   [ # 13 ]  
Research Scientist
Avatar
RankRankRankRankRankRank
Total Posts:  6077
Joined  08-04-2002

On input or output really isn’t a PHP thing, it’s strictly how EE treats, or more appropriatly, parses the PHP. It’s in the template preferences. If you need to pass a variable from some PHP to EE so it can use it, you set the preference on “input”. If on the other hand, you need the opposite, EE to pass something to PHP, you use on “output”.

Make sense?

Profile
 
 
Posted: 13 July 2007 03:30 PM   [ Ignore ]   [ # 14 ]  
Research Assistant
RankRankRank
Total Posts:  529
Joined  10-24-2005

SWEET!

Butcher, this has been a clever solution.  It works!

PXLated, thanks for clarifying.

Awesome, I’m stoked.

 Signature 

Stephen Slater

Profile
 
 
Posted: 14 July 2007 08:49 AM   [ Ignore ]   [ # 15 ]  
Research Assistant
RankRankRank
Total Posts:  529
Joined  10-24-2005

I’ve got a follow-up question that is closely related to this topic.  Is it possible to display a group’s title?

There are these standard variables that are identical and I really don’t understand why.

group_id


member_group

Both of these contain the ID number of the group.  It seems like “member_group” would contain the ‘title’ of the group in which the member belongs.

Is there a way to extract and display the member’s group title?

 Signature 

Stephen Slater

Profile
 
 
Posted: 14 July 2007 11:40 AM   [ Ignore ]   [ # 16 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1097
Joined  03-22-2006

Hmm, not that i’m aware of. You could put an exp:query tag inside an {if count == 1} conditional?

 Signature 

(a.k.a the_butcher)

Profile
 
 
Posted: 14 July 2007 04:45 PM   [ Ignore ]   [ # 17 ]  
Lab Assistant
RankRank
Total Posts:  108
Joined  08-18-2006

Well with some trial and error I came up with this:

I used butcher’s idea about creating a member in a “client” member group, clicking the “Include user in PUBLISH page multi-author list?” for that particular member, creating a new entry and selecting the particular member in the author list. Then instead of using “{logged_in_member_id} variable inside the author_id=”” weblog entries parameter”, I just used “username=“CURRENT_USER”” parameter in the weblog entries tag in the “client_access” template group I set up to show the clients files. This template group can only be accessed by those in the “client” member group. Now when a user/client/member logs in they only see entries that are authored by the respective user/client/member. This seems to work for me pretty well. Hope this might help someone in this thread.

 Signature 

qrux :: design :: photography

Profile
 
 
Posted: 15 July 2007 05:03 AM   [ Ignore ]   [ # 18 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1097
Joined  03-22-2006

Now all you need to do is add a layer of abstraction onto the file names of the downloads, which Robin Sowells download lock module would do nicely smile

 Signature 

(a.k.a the_butcher)

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 09:33 AM
Total Registered Members: 64914 Total Logged-in Users: 23
Total Topics: 81866 Total Anonymous Users: 15
Total Replies: 440124 Total Guests: 177
Total Posts: 521990    
Members ( View Memberlist )
Newest Members:  smilepolitelyrvmcleodbjmohrAqua193Bios Elementmjpoteetguimogranwelshmrcfthenetmonkey