Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Reformatting some spaces to coding guidelines
  • Loading branch information
moodler committed Feb 13, 2005
1 parent 0d2c0cf commit b56ccdd
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions lib/moodlelib.php
Expand Up @@ -1024,19 +1024,19 @@ function require_login($courseid=0, $autologinguest=true) {
//as a guest, and course setting allow unlimited guest access
//Code cribbed from course/loginas.php
if (strstr($FULLME,"username=guest") && ($course->guest==1)) {
$realuser = $USER->id;
$realname = fullname($USER, true);
$USER = guest_user();
$USER->loggedin = true;
$USER->site = $CFG->wwwroot;
$USER->realuser = $realuser;
if (isset($SESSION->currentgroup[$course->id])) { // Remember current setting for later
$SESSION->oldcurrentgroup = $SESSION->currentgroup[$course->id];
unset($SESSION->currentgroup[$course->id]);
}
$guest_name = fullname($USER, true);
add_to_log($course->id, "course", "loginas", "../user/view.php?id=$course->id&$USER->id$", "$realname -> $guest_name");
return;
$realuser = $USER->id;
$realname = fullname($USER, true);
$USER = guest_user();
$USER->loggedin = true;
$USER->site = $CFG->wwwroot;
$USER->realuser = $realuser;
if (isset($SESSION->currentgroup[$course->id])) { // Remember current setting for later
$SESSION->oldcurrentgroup = $SESSION->currentgroup[$course->id];
unset($SESSION->currentgroup[$course->id]);
}
$guest_name = fullname($USER, true);
add_to_log($course->id, "course", "loginas", "../user/view.php?id=$course->id&$USER->id$", "$realname -> $guest_name");
return;
}

// Currently not enrolled in the course, so see if they want to enrol
Expand All @@ -1053,16 +1053,15 @@ function require_login($courseid=0, $autologinguest=true) {
*
* @uses $CFG
* @param int $courseid The course in question
* @param boolean $autologinguest ?
* @todo Finish documenting this function
* @param boolean $autologinguest Allow autologin guests if that is wanted
*/
function require_course_login($course, $autologinguest=true) {
global $CFG;
if ($CFG->forcelogin) {
require_login();
require_login();
}
if ($course->category) {
require_login($course->id, $autologinguest);
require_login($course->id, $autologinguest);
}
}

Expand Down

0 comments on commit b56ccdd

Please sign in to comment.