Page 1 of 1

Members' Area Help - CustomContent & Frontend User Managment

Posted: Tue Jan 29, 2008 2:48 am
by LeeUmm
So it seems like this setup is the best for creating a members area. However, after looking at it for a little while, it seems it might not be exactly what I'm after.

I'm setting up a site for a client with no knowledge of web design. Client wants a members area for their clients.

I was thinking of a structure like so:

- Client Area Page
  - Client 1
  - Client 2
  - Client 3
  - Etc

Each client would only be allowed to access their page.

The thing is, I only see a way to hard code the user groups in. This won't work as the client will be consistently adding new clients under the Client Area Page, and won't have the ability/understanding on how to edit the template and smarty tags.

What I was hoping for was some sort of UI to streamline this process when creating a new page. So when a new page is created, it gives an option of who can access it. Is this at all possible?

Re: Members' Area Help - CustomContent & Frontend User Managment

Posted: Tue Jan 29, 2008 5:20 pm
by Pierre M.
Hello,
LeeUmm wrote: What I was hoping for was some sort of UI to streamline this process when creating a new page. So when a new page is created, it gives an option of who can access it. Is this at all possible?
May be the thread called "wget automation" ? It could automate the creation of a template with hard coded group filtering and the page incoporating the template. Tweaky. Ugly.

Pierre M.

Re: Members' Area Help - CustomContent & Frontend User Managment

Posted: Tue Jan 29, 2008 6:05 pm
by Vin
Can't you filter the pages with CustomContent tag by UDT? I mean, isn't there some parametre (like pagealias or something) on which you could rely?

What about default content in Site Admin > Page Defaults and some comments in {* *} brackets?

Re: Members' Area Help - CustomContent & Frontend User Managment

Posted: Tue Jan 29, 2008 6:11 pm
by calguy1000
so the admin would manually create a page for each user? and you want only that user to be able to view that page?

No problem:

{if $ccuser->loggedin() && $customcontent_loginname == $page_alias }
  {content}
{else}
  You are not authorized to view this page
{/if}

You just have to name the page alias for the customer page to match their username.

Re: Members' Area Help - CustomContent & Frontend User Managment

Posted: Tue Jan 29, 2008 6:25 pm
by Pierre M.
Smart. Thx.

Pierre

Re: Members' Area Help - CustomContent & Frontend User Managment

Posted: Tue Jan 29, 2008 6:39 pm
by LeeUmm
Great solution, but what if I want multiple clients to that page?

This is how it would be structured unless there is a better way:

Group name would be client company.

From there each group would have multiple users assigned to it. Each company will have more than one user who can login.

Only one page for each company will be created. I want to have a login page, that will take them to their page after login.

Before I dig to deep with this, I want to see if this is possible.

Keep in mind my client will be doing this for their business with limited web knowledge.

Re: Members' Area Help - CustomContent & Frontend User Managment

Posted: Tue Jan 29, 2008 6:52 pm
by calguy1000
that's simple....

instead of the above solution, you'd
a) name the company's page alias the same name as the company-group
b) use this type of expression in the page template:

{if $ccuser->memberof($page_alias)}
  {content}
{else}
  You are not authorized to view this content
{/if}

Re: Members' Area Help - CustomContent & Frontend User Managment

Posted: Tue Jan 29, 2008 7:17 pm
by LeeUmm
That looks very simple. Much appreciated.

One last thing I forgot to mention.

On each client page I'm looking at having file downloads. I'd like them secure to those clients only.

I've taken a look at Secure File Download but not sure that's good enough.

It seems to only allow general logged in protection, so that a logged in user can download the file. This might be good enough, except I'm dealing with very important business documents. I'd prefer to limit it to certain users per certain file.

If it's not possible, and I don't think it is, I may move forward with this anyway. Just thought I'd ask first.

Re: Members' Area Help - CustomContent & Frontend User Managment

Posted: Tue Jan 29, 2008 7:20 pm
by calguy1000
The Uploads module allows restricting file downloads to members of certain groups.... take a look at that.

Re: Members' Area Help - CustomContent & Frontend User Managment

Posted: Fri Feb 01, 2008 9:22 pm
by Alpdog14
i am trying to use the code provided to make different users see different screens. i was able to do it using:

{cms_module module=FrontEndUsers} {if $customcontent_loginname == 'cabplan'}Welcome Chris {elseif $customcontent_loginname == 'tonyvalle'}Welcome Tony {elseif $customcontent_loginname == 'Sharon'}Welcome Sharon {elseif $customcontent_loginname == 'Alpdog14'}Welcome Alpdog14 {else}Anonymous user {/if}

but i was wondering if there is way that when my client creates a new user and password it automatically creates a new page for that specific user and then my client can just put a unique link to an uploaded pdf in that users page so the users can just login and the link will show up with that users specific report.

An example of what i mean is in this CMS:

http://www.homeinspectionwebsites.com/admin/

after you login at the top there is Report upload section where the client can just put a username and password and upload a document and when the user is ready to view the report, the page will all ready be create with the link to that report. Can this be done in CMSMS? Please help.

Re: Members' Area Help - CustomContent & Frontend User Managment

Posted: Fri Feb 01, 2008 11:19 pm
by Vin
I think this can be done with the Uploads module.

[edit]But I think you'd need a UDT (User Defined Tag) for OnCreateUser event (in Events Manager, frontend users management).
Probably something like this:

Code: Select all

global $gCms;
  if( !isset( $gCms->modules['Uploads'] ) || !isset( $gCms->modules['Uploads']['object'] ) )
    {
       return;
    }
  $uploads = $gCms->modules['Uploads']['object'];
  //now parametres
  $parms['input_grouplist']       =
  $parms['input_categoryname']    =
  $parms['input_categorypath']    =& $params['name'];
  $parms['input_categorylistable']=1;
  $uploads->DoAction('do_addcategory', "", $parms);
Make sure the group in frontendusers has the same name as the username.

Re: Members' Area Help - CustomContent & Frontend User Managment

Posted: Sat Feb 02, 2008 1:54 am
by calguy1000
Alpdog14 wrote: i am trying to use the code provided to make different users see different screens. i was able to do it using:

{cms_module module=FrontEndUsers} {if $customcontent_loginname == 'cabplan'}Welcome Chris {elseif $customcontent_loginname == 'tonyvalle'}Welcome Tony {elseif $customcontent_loginname == 'Sharon'}Welcome Sharon {elseif $customcontent_loginname == 'Alpdog14'}Welcome Alpdog14 {else}Anonymous user {/if}

but i was wondering if there is way that when my client creates a new user and password it automatically creates a new page for that specific user and then my client can just put a unique link to an uploaded pdf in that users page so the users can just login and the link will show up with that users specific report.

An example of what i mean is in this CMS:

http://www.homeinspectionwebsites.com/admin/

after you login at the top there is Report upload section where the client can just put a username and password and upload a document and when the user is ready to view the report, the page will all ready be create with the link to that report. Can this be done in CMSMS? Please help.
Uhm nope... there's no automagic thing like this.... something could probably be written, but it'd take some writing.

Re: Members' Area Help - CustomContent & Frontend User Managment

Posted: Sat Feb 02, 2008 8:16 am
by Vin
calguy1000 wrote: Uhm nope... there's no automagic thing like this.... something could probably be written, but it'd take some writing.
True for auto-creating pages maybe, but as you (Alpdog14) have already written, you need to show files to a restricted user, and that should work in conjuction with Uploads module - shouldn't it, Calguy?

[edit] To ensure you've denied access to anyone but the right person to see the files, you should modify permissions on your server for your uploads folders (if creating a dummy index.html doesn't suffice for you)... I think it was already discussed in the forum.

[edit] Also, I don't like this:
  {if variable='value'}writethis{elseif varable='anothervalue'}writethat{elseif variable='yetanothervalue'}thenwritethisone ...{else}default content{/if}
template coding. Imagine you'd have a lot of users.
Then a UDT comes in handy again. Create a UDT like this (name for example loggedinuser):

Code: Select all

global $gCms;
  if( !isset( $gCms->modules['FrontEndUsers'] ) || !isset( $gCms->modules['FrontEndUsers']['object'] ) )
    {
       return;
    }
  $frontendusers = $gCms->modules['FrontEndUsers']['object'];

  $userid =& $frontendusers->GetUserID($params['username']);
  $properties =& $frontendusers->GetUserProperties($userid);
  $smarty->assign('feuproperties',$properties);
Then in template, place it like this:

Code: Select all

{if $customcontent_loginname != ''}
{loggedinuser username=$customcontent_loginname}
Welcome {$feuproperties.name} {$feuproperties.surname}
{else} Anonymous user
{/if}
provided that you've specified the properties like name and surname in frontend users management.

Or at least I think it should work, haven't tested it.

Re: Members' Area Help - CustomContent & Frontend User Managment

Posted: Sun Feb 03, 2008 8:17 pm
by LeeUmm
I've named my page alias and group the same thing as outlined in the first few posts.

I'd like to have the user directed to their page (same name as group name remember) after login. I know there is a 'returnto' option available, but not sure which variable gets just the group name that the user belongs to. I've tried a few things.

Re: Members' Area Help - CustomContent & Frontend User Managment

Posted: Mon Feb 04, 2008 10:32 am
by LeeUmm
After some more playing around with the code, I'm still stuck.

As mentioned above, I'd like to redirect the user to their specific pager after login. Their page alias and group name are the same name. I've tried setting the preferences in the FEU module to the macro {group} but after I test a login, it says cannot find groupid.

I'm basically looking at getting the group name the user belongs to and storing it in a variable so I can pass it to "returnto=group" in the module tag: {cms_module module=FrontEndUsers form='login' returnto='{$group}'}. Unless there is a better way.