Small code change for consideration

Small code change for consideration

by Steve Hyndman -
Number of replies: 0

Here is a small code change we made to my Moodle site today to take care of a small problem I found when the login as guest feature is activated in on a site....the problem is explained in detail on my blog. This starts in line 2369 in lib/weblib.php file. Nothing real major, but clears-up some confusion for some of my registered students when they login as guest by clicking on a course with guest access without first loging in as themselves.

//code added by Shunnan
 if (strstr($message,"does not allow guests to enter"))
 {
  print_heading("<a href=\"$link\">".get_string("continue")."</a>&nbsp;Or&nbsp;"."<a href=\"".$link."login\">Login</a>");
 }
 else
 {
  //original code, disable if.. else.. to return the original state
   print_heading("<a href=\"$link\">".get_string("continue")."</a>");
 }
    print_footer(get_site());
    die;
}

Steve

Average of ratings: -