Permalink
Browse files

fix for MDL-9268

  • Loading branch information...
1 parent e97c7b2 commit c7da0d864e58cb8f37f8f567d889250b03c85235 toyomoyo committed Apr 10, 2007
Showing with 10 additions and 3 deletions.
  1. +2 −1 blog/index.php
  2. +8 −2 blog/lib.php
View
@@ -84,7 +84,8 @@
if ($CFG->bloglevel < BLOG_GROUP_LEVEL) {
error('Group blogs is not enabled');
}
- if (!$group = get_record('groups','id',$groupid)) {
+ // fix for MDL-9268
+ if (!$group = get_record('groups','id',$filterselect)) {
error('Incorrect group id specified');
}
if (!$course = get_record('course', 'id', $group->courseid)) {
View
@@ -496,14 +496,20 @@ function fetch_entries($postid='', $fetchlimit=10, $fetchstart='', $filtertype='
break;
case 'group':
-
$SQL = 'SELECT '.$requiredfields.' FROM '.$CFG->prefix.'post p, '.$tagtablesql
+ .$CFG->prefix.'groups_members m, '.$CFG->prefix.'user u
+ WHERE p.userid = m.userid '.$tagquerysql.'
+ AND u.id = p.userid
+ AND m.groupid = '.$filterselect.'
+ AND (p.publishstate = \'site\' OR p.publishstate = \'public\' OR p.userid = '.$USER->id.')';
+
+ /*$SQL = 'SELECT '.$requiredfields.' FROM '.$CFG->prefix.'post p, '.$tagtablesql
.groups_members_from_sql().', '.$CFG->prefix.'user u
WHERE '.groups_members_where_sql($filterselect, 'p.userid').'
AND u.id = p.userid
AND u.deleted = 0
'.$permissionsql.$typesql;
-
+ */
break;
case 'user':

0 comments on commit c7da0d8

Please sign in to comment.