]> git.mjollnir.org Git - moodle.git/commitdiff
fixed a bug where non admins can't add blocks to own blog page
authortoyomoyo <toyomoyo>
Wed, 12 Apr 2006 02:27:14 +0000 (02:27 +0000)
committertoyomoyo <toyomoyo>
Wed, 12 Apr 2006 02:27:14 +0000 (02:27 +0000)
blog/blogpage.php
blog/lib.php

index 66cf8cbfddc8f71d2783b279e85e2e0535f312b8..e2cddaeed2fb59eb13ce1aee74bb6579141f8688 100644 (file)
@@ -63,7 +63,9 @@ class page_blog extends page_base {
 
     // For this test page, only admins are going to be allowed editing (for simplicity).
     function user_allowed_editing() {
-        if (isadmin() || ((isset($this->bloginfo) && blog_user_has_rights($this->bloginfo))) || ($this->courseid != '' && isteacher($this->courseid)) ) {
+        if (isloggedin() && !isguest()) {
+
+        //if (isadmin() || ((isset($this->bloginfo) && blog_user_has_rights($this->bloginfo))) || ($this->courseid != '' && isteacher($this->courseid)) ) {
             return true;
         }
         return false;
@@ -72,7 +74,9 @@ class page_blog extends page_base {
     // Also, admins are considered to have "always on" editing (I wanted to avoid duplicating
     // the code that turns editing on/off here; you can roll your own or copy course/view.php).
     function user_is_editing() {
-        if (isadmin() || ((isset($this->bloginfo) && blog_user_has_rights($this->bloginfo))) || ($this->courseid != '' && isteacher($this->courseid)) ) {
+         if (isloggedin() && !isguest()) {
+
+        //if (isadmin() || ((isset($this->bloginfo) && blog_user_has_rights($this->bloginfo))) || ($this->courseid != '' && isteacher($this->courseid)) ) {
             global $SESSION;
             if (empty($SESSION->blog_editing_enabled)) {
                 $SESSION->blog_editing_enabled = false;
index 2843a6b1a678e43b55e353748cd1f6f942b1005f..0958167978558c4b1d3dd69c2241b6f0db6435dd 100755 (executable)
         if (user_can_change_publish_state($blogEntry) && blog_isediting() ) {
             $menu .= '<div class="publishto">'. get_string('publishto', 'blog').': ';
             $options = blog_applicable_publish_states();
-            $menu .= choose_from_menu($options, $this->entryuserid .'-'. $this->entryId, $this->entryPublishState, '', '', '0', true);
+            $menu .= choose_from_menu($options, $blogEntry->userid .'-'. $blogEntry->id, $blogEntry->publishstate, '', '', '0', true);
             $menu .= "\n".'</div>'."\n";
             /// batch publish might not be needed
             if ($includehelp) {