]> git.mjollnir.org Git - moodle.git/commitdiff
blog access rights fix, forgot to check in last week
authortoyomoyo <toyomoyo>
Tue, 18 Apr 2006 01:30:00 +0000 (01:30 +0000)
committertoyomoyo <toyomoyo>
Tue, 18 Apr 2006 01:30:00 +0000 (01:30 +0000)
user/tabs.php

index 42e6f6f10de8c4682d2d7c7faa97a3f938d1d507..ae5c04423f4dae20413c8497608ff4d53af7678a 100644 (file)
             $toprow[] = new tabobject('blogs', $CFG->wwwroot.'/blog/index.php?filtertype=group&amp;filterselect='.$filterselect, get_string('blogs','blog'));
         }
 
-    /*********************************************************************
-     * if selection in progress, only print blogs tab, in blog interface *
-     *********************************************************************/
-    } else if ($filtertype == 'course' || $filtertype == 'group') {
-
-        print_heading('');
-        $toprow[] = new tabobject('blogs', $CFG->wwwroot.'/blog/index.php?filtertype=site&amp;',
-                get_string('blogs','blog'));
-
     /**************************************
      * User Level participation or Blogs  *
      **************************************/
@@ -87,8 +78,8 @@
             $user = get_record('user','id', $userid);
         }
         print_heading(fullname($user, isteacher($course->id)));
-        $toprow[] = new tabobject('profile', $CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$course->id,
-                    get_string('profile'));
+
+        $toprow[] = new tabobject('profile', $CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$course->id, get_string('profile'));
 
 
     /// Can only edit profile if it belongs to user or current user is admin and not editing primary admin
             } else {
                 $wwwroot = str_replace('http','https',$CFG->wwwroot);
             }
-            $toprow[] = new tabobject('editprofile', $wwwroot.'/user/edit.php?id='.$user->id.'&amp;course='.$course->id,
-                        get_string('editmyprofile'));
+
+            $toprow[] = new tabobject('editprofile', $wwwroot.'/user/edit.php?id='.$user->id.'&amp;course='.$course->id, get_string('editmyprofile'));
         }
 
 
 
 
     /// Blog entry, everyone can view
-        if ($CFG->bloglevel >= 1) {
+        if ($CFG->bloglevel > 1 or $USER->id == $user->id) {  // this is weird
             $toprow[] = new tabobject('blogs', $CFG->wwwroot.'/blog/index.php?userid='.$user->id.'&amp;courseid='.$course->id, get_string('blogs', 'blog'));
         }