A couple of permissions questions

Permalink 2 users found helpful
1. Is there a built in function for users to change their own passwords?

2. When a user registers, can they be automatically assigned to a group base on registration questions?

If not, is there a block available that can be added for this? I didn't see one available in the marketplace.

Thanks

 
Mnkras replied on at Permalink Reply
Mnkras
ok first of all for changing passwords i believe that you need to enable profiles, when they go to their profiles they can change email pass etc.

when they register they are assigned to the "registered users" group if you want to have it so that if they check a box and they join a group that you need to code

Mike
redhawk replied on at Permalink Reply
I've already got the public profiles enabled, but when I log in as a test user, I don't see where to go to change the password as that user.
ajselvig replied on at Permalink Reply
Just had a client request this, and I can't see how the user would get to their "profile" page.
osu replied on at Permalink Reply
osu
I believe you have to create a single_page in order to access your profile page:http://www.concrete5.org/help/building_with_concrete5/developers/mv...
frz replied on at Permalink Reply
frz
if you're using 5.3.3 we made this a lot more clear. login, look at the footer. your user name links to your profile page.

site.com/index.php/profile
redhawk replied on at Permalink Reply
Having some issues with upgrade or fresh install of 5.3.3 so I haven't moved there yet. Sounds like a lot of the enhancements will be terrific, but can't go there yet because I've not received or found enough info to get past that.

So I guess the single_page is the way to go and create a link to it?

Thanks in Advance
PurpleEdge replied on at Permalink Reply
PurpleEdge
Can someone tell me where I enable "Member Profile" ?

I am using C5.3.3 demo data on a local server and I can't find it anywhere?
wizardontherun replied on at Permalink Reply
wizardontherun
From the dashboard, "users and groups" then far right, login and restrictions
PurpleEdge replied on at Permalink Reply
PurpleEdge
Thanks, it didn't twig that "Public Profiles" is the same as "Member profile" - I thought that enabling public profiles meant that the public could view a member's profile.

[edit] Ok, so enabling "Public Profiles" displays a "Members" link for all members on the home page. How can I apply permissions so that the "Members" link is either never enabled, or only enabled for certain groups?

IOW - I just want to enable "Member Profile" - NOT "Public Profile"
danielwmoore replied on at Permalink Reply
danielwmoore
I'm having this same issue. I want the members to be able to visit their own profile page so that they can change their passwords. However, I do NOT want a "Members" link at the top of every page! How do I get rid of this? I have limited access to the members page to Administrators, however, it still shows the link, and if a Guest clicks on it, it goes to a login screen. This is NOT the behavior one would expect.

Bottom line, how do I make sure the Members link does not show at all in an auto-nav, or how can I make sure the auto-nav will only show links that a user has legitimate access to?
dstew99 replied on at Permalink Reply
dstew99
Same problems as PurpleEdge and DanielWMoore.

I want to limit public profiles to a specific group and not have a Members link posted in the nav, unless i want it to be there.

I have tried put an If statement in the members.php file to try filtering users by group and it produces a blank page with nothing showing.

This is in the members.php file:
...
      $g = Group::getByName('member');      
      foreach($users as $user) { 
      if $user->inGroup($g) {      
...
Mnkras replied on at Permalink Reply
Mnkras
you can remove the members single page, or go into the properties on it and make it so that it isn't show in the nav and that no one can see it.

Let me know if you need more help
osu replied on at Permalink Reply
osu
@Mike, hi, in your first post you said:

"when they register they are assigned to the "registered users" group if you want to have it so that if they check a box and they join a group that you need to code"

Could you point me in the right direction of how one would code this? Would one copy the login.php file from /concrete/single_pages/ into /single_pages/ and edit this somehow?

Would be great to modify it to include a drop-down list to let users choose their group or just create a new form that signs them up to a specific group.

Thanks
Mnkras replied on at Permalink Reply
Mnkras
im not sure if its the best way, but what you can do is use Events, you could make a custom user attribute and then check the value from the event on register and then put them in the group.
ryan replied on at Permalink Reply
ryan
So, there would be two ways to approach this adding a user to a group based on the options they select when registering.
1) Override the register page's controller by copying it from /concrete/controllers/register.php to /controllers/register.php

Then around line 140 while it's looping through the submitted attributes you could add your code that adds the current user to a specific group.

2) Another way to handle it would be to use the on_user_add event, or the on_user_update event.
http://www.concrete5.org/documentation/developers/system/events...
PhilYoung replied on at Permalink Reply
PhilYoung
Hi Ryan,

i need this function on a site and decided to try method 1. Can you tell me what code I should add to automatically add a user to a group with id 6

From looking at other posts its some variation of

Loader::model('groups');
     $u = $ui->getUserObject(); 
     // add new user to groups
$g1 = Group::getByName('unvalidated');
     if (is_object($g1)) { 
        $u->enterGroup($g1);


But as I am no coder the couple of variations I tried did not work. However, I can follow instructions. Thanks
phil
Mnkras replied on at Permalink Reply
Mnkras
Loader::model('groups');
$u = new User();
// add new user to groups
$g1 = Group::getByID('6');
if (is_object($g1)) { 
    $u->enterGroup($g1);
}

like that?
PhilYoung replied on at Permalink Reply
PhilYoung
Hi,
Well yes but where do I put it in the code as is. I tried a couple of places after line 140 but it killed form. No doubt I left out brackets or put one in the wrong place...
Mnkras replied on at Permalink Reply
Mnkras
I would use the on_user_add event,

a lot easier, and safer
PhilYoung replied on at Permalink Reply
PhilYoung
Perhaps so but I like I said I am no coder and I was unclear on how to make it work this from other posts
Mnkras replied on at Permalink Reply 1 Attachment
Mnkras
change the contents of the model, file to suit your needs (see attached, its a package)
PhilYoung replied on at Permalink Reply
PhilYoung
Sorry I did not reply sooner but living in Ireland there a big time zone difference. Just tried out the package this morning and it worked perfectly. What a gift, I do not know what to say other thank you SO SO much.
Phil