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

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

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


附件 Picture_4.png
評比平均分數: -
In reply to Brian Warling

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

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.