Skip to content

Commit

Permalink
MDL-23927 improved guest handling
Browse files Browse the repository at this point in the history
  • Loading branch information
skodak committed Aug 25, 2010
1 parent b3df176 commit 2396a41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion calendar/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ function calendar_edit_event_allowed($event) {
}

// can not be using guest account
if ($USER->username == "guest") {
if (isguestuser()) {
return false;
}

Expand Down
10 changes: 5 additions & 5 deletions mod/feedback/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
echo $OUTPUT->box_start('feedback_info');
echo '<span class="feedback_info">'.get_string('questions', 'feedback').': </span><span class="feedback_info_value">' .$itemscount. '</span>';
echo $OUTPUT->box_end();

if($feedback->timeopen) {
echo $OUTPUT->box_start('feedback_info');
echo '<span class="feedback_info">'.get_string('feedbackopen', 'feedback').': </span><span class="feedback_info_value">' .UserDate($feedback->timeopen). '</span>';
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -224,15 +224,15 @@
}
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 {
$completefile = 'complete.php';
$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);
Expand Down

0 comments on commit 2396a41

Please sign in to comment.