diff --git a/calendar/lib.php b/calendar/lib.php
index d74c4fa743..33563236fa 100644
--- a/calendar/lib.php
+++ b/calendar/lib.php
@@ -1318,7 +1318,7 @@ function calendar_edit_event_allowed($event) {
}
// can not be using guest account
- if ($USER->username == "guest") {
+ if (isguestuser()) {
return false;
}
diff --git a/mod/feedback/view.php b/mod/feedback/view.php
index 19ba5a8d0e..c5a6e60ff3 100644
--- a/mod/feedback/view.php
+++ b/mod/feedback/view.php
@@ -141,7 +141,7 @@
echo $OUTPUT->box_start('feedback_info');
echo ''.get_string('questions', 'feedback').': ' .$itemscount. '';
echo $OUTPUT->box_end();
-
+
if($feedback->timeopen) {
echo $OUTPUT->box_start('feedback_info');
echo ''.get_string('feedbackopen', 'feedback').': ' .UserDate($feedback->timeopen). '';
@@ -170,8 +170,8 @@
echo $OUTPUT->box_end();
}
-if( (intval($feedback->publish_stats) == 1) AND
- ( has_capability('mod/feedback:viewanalysepage', $context)) AND
+if( (intval($feedback->publish_stats) == 1) AND
+ ( has_capability('mod/feedback:viewanalysepage', $context)) AND
!( has_capability('mod/feedback:viewreports', $context)) ) {
if($multiple_count = $DB->count_records('feedback_tracking', array('userid'=>$USER->id, 'feedback'=>$feedback->id))) {
$analysisurl = new moodle_url('/mod/feedback/analysis.php', array('id'=>$id, 'courseid'=>$courseid));
@@ -224,7 +224,7 @@
}
if($feedback_can_submit) {
//if the user is not known so we cannot save the values temporarly
- if(!isset($USER->username) OR $USER->username == 'guest') {
+ if(!isloggedin() or isguestuser()) {
$completefile = 'complete_guest.php';
$guestid = sesskey();
}else {
@@ -232,7 +232,7 @@
$guestid = false;
}
$completeurl = new moodle_url('/mod/feedback/'.$completefile, array('id'=>$id, 'courseid'=>$courseid, 'gopage'=>0));
-
+
if($feedbackcompletedtmp = feedback_get_current_completed($feedback->id, true, $courseid, $guestid)) {
if($startpage = feedback_get_page_to_continue($feedback->id, $courseid, $guestid)) {
$completeurl->param('gopage', $startpage);