"Turn Editing On" button displays on user's Blog page

"Turn Editing On" button displays on user's Blog page

by Brian Warling -
Number of replies: 1
We're using 1.9.3. I just noticed that on a user's blog page, the TURN EDITING ON button appears. This gives the user the ability to add blocks to this page that we don't want just any user (e.g., students) adding. We definitely don't want to allow this, but I can't figure out how to prevent it.

I've seen previous postings about this, but they just appear to peter out. And there is a Tracker item, but it appears to have been closed, but without a resolution I understand:

http://tracker.moodle.org/browse/MDL-5687

Any help here is greatly appreciated.

Thanks.... Brian


Attachment Picture_4.png
Average of ratings: -
In reply to Brian Warling

Re: "Turn Editing On" button displays on user's Blog page

by Nadja Steffes -
Hi,

I had the same problem and solved it doing this:
Go to moodle/blog/blogpage.php
In line 74 there is a function called "function user_allowed_editing()".

function user_allowed_editing()
if (isloggedin() && !isguest()) {
return true;
}
return false;
}

The line in red allows everyone that is logged in and is not a guest to be able to edit.
I simply added isadmin() to that line and now only admins will be able to see it.

function user_allowed_editing() {
if (isloggedin() && !isguest() && isadmin()) {
return true;
}
return false;
}

You can play around with letting teacher see it or not. You could even comment the entire out and no one will be able to edit.
Hope that solves your prob.