Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
10b3bb9d
Commit
10b3bb9d
authored
Aug 21, 2008
by
Nigel McNie
Browse files
Wrap adding a user to a group up in a transaction. Remove a redundant line of code.
parent
9107b66c
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/group.php
View file @
10b3bb9d
...
...
@@ -299,9 +299,11 @@ function group_add_user($groupid, $userid, $role=null) {
$role
=
get_field_sql
(
'SELECT gt.defaultrole FROM {grouptype} gt, {group} g WHERE g.id = ? AND g.grouptype = gt.name'
,
array
(
$groupid
));
}
$cm
->
role
=
$role
;
db_begin
();
insert_record
(
'group_member'
,
$cm
);
delete_records
(
'group_member_request'
,
'group'
,
$groupid
,
'member'
,
$userid
);
$user
=
optional_userobj
(
$userid
);
db_commit
(
);
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment