ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

How do I create client/member access pages?

July 11, 2007 2:25am

Subscribe [9]
  • #1 / Jul 11, 2007 2:25am

    qruxart

    20 posts

    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?

  • #2 / Jul 11, 2007 8:45am

    Daniel Walton

    553 posts

    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.

  • #3 / Jul 12, 2007 2:39am

    qruxart

    20 posts

    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!

  • #4 / Jul 12, 2007 3:11am

    Stephen Slater

    366 posts

    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!

  • #5 / Jul 12, 2007 6:23am

    Daniel Walton

    553 posts

    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?

  • #6 / Jul 12, 2007 8:27pm

    Stephen Slater

    366 posts

    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?

  • #7 / Jul 12, 2007 10:32pm

    Stephen Slater

    366 posts

    I’ve come up with this…

    {exp:weblog:entries weblog="my_weblog" group_id="{logged_in_group_id}"}
    <a href="http://{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.

  • #8 / Jul 13, 2007 6:09am

    Daniel Walton

    553 posts

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

    😊

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

  • #9 / Jul 13, 2007 9:40am

    Stephen Slater

    366 posts

    {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!

  • #10 / Jul 13, 2007 10:28am

    PXLated

    1800 posts

    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.

  • #11 / Jul 13, 2007 10:44am

    Daniel Walton

    553 posts

    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.

  • #12 / Jul 13, 2007 11:14am

    PXLated

    1800 posts

    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.

  • #13 / Jul 13, 2007 4:09pm

    Stephen Slater

    366 posts

    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.

  • #14 / Jul 13, 2007 4:31pm

    PXLated

    1800 posts

    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?

  • #15 / Jul 13, 2007 6:30pm

    Stephen Slater

    366 posts

    SWEET!

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

    PXLated, thanks for clarifying.

    Awesome, I’m stoked.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases