Hi,
I would like to disable thre display of a block if the user is not logged or if it's a guest.
How can I do that?
thanks
I am not sure if this is exactly what you are after.
A while back I modified the HTML block so that it would only appear if you are an admin user (http://moodle.org/mod/forum/discuss.php?d=26951). I have just modified this so that it only appears if you are logged in and not a guest.
The line of code below is the check that is being used
if (isloggedin() && !isguest())
Use something like this and it should work:
if (isloggedin() && !isguest()) {
$this->content->text = 'fgdfgdgdgdfgdfg';
} else {
$this->content->text = '';
}
If the content is blank Moodle won't show the block