Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update register.php #135

Merged
merged 4 commits into from
Sep 20, 2018
Merged

Update register.php #135

merged 4 commits into from
Sep 20, 2018

Conversation

mrhaw
Copy link

@mrhaw mrhaw commented Aug 20, 2018

Makes it possible to also set usergroup rank when register new user:

[[!Register?
    &usergroups=`Administrator:Member:0,anusergroup:Super User:1,someusergroup:Super User:2`

register2

Makes it possible to also set usergroup rank when register new user:
```
[[!Register?
    &usergroups=`Administrator:Member:0,anusergroup:Super User:1,someusergroup:Super User:2`
```
@mrhaw
Copy link
Author

mrhaw commented Aug 27, 2018

I missed adding a check. Not sure we need one...

                $rank = !empty($userGroupMeta[2]) ? $userGroupMeta[2] : 0;
                $member->set('rank',$rank);

mrhaw and others added 3 commits August 26, 2018 20:57
Makes it possible to also set usergroup rank when register new user:
```
[[!Register?
    &usergroups=`Administrator:Member:0,anusergroup:Super User:1,someusergroup:Super User:2`
```
![register2](https://user-images.githubusercontent.com/346269/44318337-3912ac80-a3ea-11e8-87d3-6b47c48b3a2f.png)
Make it possible to also set usergroup rank when register a new user
to avoid warnings
@@ -229,6 +229,8 @@ public function setUserGroups($userGroups) {
} else {
$member->set('role',1);
}
$rank = !empty($userGroupMeta[2]) ? $userGroupMeta[2] : 0;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better use isset here.

@Jako Jako merged commit d391aff into modxcms:master Sep 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants