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
52204947
Commit
52204947
authored
Jan 19, 2007
by
Martyn Smith
Committed by
Martyn Smith
Jan 19, 2007
Browse files
Fix adding users to controlled communities
parent
1cca3989
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/community.php
View file @
52204947
...
...
@@ -173,7 +173,7 @@ function get_associated_communities($userid=0) {
/**
* gets communities the user is a tutor in
* gets communities the user is a tutor in
, or the user owns
*
* @param int $userid (optional, defaults to $USER id)
* @param string $jointype (optional, will filter by jointype
...
...
@@ -186,7 +186,7 @@ function get_tutor_communities($userid=0, $jointype=null) {
$sql
=
'SELECT DISTINCT c.*, cm.ctime
FROM '
.
$prefix
.
'community c
LEFT JOIN '
.
$prefix
.
'community_member cm ON cm.community = c.id
WHERE (
cm.member IS NULL AND
c.owner = ?
)
OR (cm.member = ? AND cm.tutor = ?)'
;
WHERE (c.owner = ? OR (cm.member = ? AND cm.tutor = ?)
)
'
;
$values
=
array
(
$userid
,
$userid
,
1
);
if
(
!
empty
(
$jointype
))
{
...
...
htdocs/user/view.php
View file @
52204947
...
...
@@ -162,8 +162,8 @@ if ($communities = get_tutor_communities($loggedinid, 'controlled')) {
$default
=
$default
[
0
];
$addform
=
pieform
(
array
(
'name'
=>
'addmember'
,
'
ajax
form'
=>
true
,
'
ajax
successcallback'
=>
'add_success'
,
'
js
form'
=>
true
,
'
js
successcallback'
=>
'add_success'
,
'elements'
=>
array
(
'community'
=>
array
(
'type'
=>
'select'
,
...
...
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