1
0
mirror of https://github.com/moodle/moodle.git synced 2025-04-24 09:55:33 +02:00

MDL-23927 do not use = 'guest' because we have CFG->siteguest AND it matches any other username with accents and different case in MySQL

This commit is contained in:
Petr Skoda 2010-08-25 08:43:42 +00:00
parent 04aec3dacf
commit 629e12fd81
4 changed files with 6 additions and 12 deletions
auth/shibboleth
blocks/online_users
course

@ -6,7 +6,7 @@
$PAGE->set_url('/auth/shibboleth/index.php');
if (isloggedin() && $USER->username != 'guest') { // Nothing to do
if (isloggedin() && !isguestuser()) { // Nothing to do
if (isset($SESSION->wantsurl) and (strpos($SESSION->wantsurl, $CFG->wwwroot) === 0)) {
$urltogo = $SESSION->wantsurl; /// Because it's an address in this site
unset($SESSION->wantsurl);

@ -144,7 +144,7 @@ class block_online_users extends block_base {
$this->content->text .= '<li class="listentry">';
$timeago = format_time(time() - $user->lastaccess); //bruno to calculate correctly on frontpage
if ($user->username == 'guest') {
if (isguestuser($user)) {
$this->content->text .= '<div class="user">'.$OUTPUT->user_picture($user, array('size'=>16));
$this->content->text .= get_string('guestuser').'</div>';
@ -152,7 +152,7 @@ class block_online_users extends block_base {
$this->content->text .= '<div class="user">'.$OUTPUT->user_picture($user, array('size'=>16));
$this->content->text .= '<a href="'.$CFG->wwwroot.'/user/view.php?id='.$user->id.'&amp;course='.$this->page->course->id.'" title="'.$timeago.'">'.$user->fullname.'</a></div>';
}
if ($canshowicon and ($USER->id != $user->id) and $user->username != 'guest') { // Only when logged in and messaging active etc
if ($canshowicon and ($USER->id != $user->id) and !isguestuser($user)) { // Only when logged in and messaging active etc
$anchortagcontents = '<img class="iconsmall" src="'.$OUTPUT->pix_url('t/message') . '" alt="'. get_string('messageselectadd') .'" />';
$anchortag = '<a href="'.$CFG->wwwroot.'/message/index.php?id='.$user->id.'" title="'.get_string('messageselectadd').'">'.$anchortagcontents .'</a>';

@ -51,9 +51,7 @@ class recent_form extends moodleform {
if ($viewparticipants) {
$options = array();
$options[0] = get_string('allparticipants');
if ($guest = get_complete_user_data('username', 'guest')) {
$options[$guest->id] = fullname($guest);
}
$options[$CFG->siteguest] = get_string('guestuser');
if (groups_get_course_groupmode($COURSE) == SEPARATEGROUPS) {
$groups = groups_get_user_groups($COURSE->id);

@ -104,9 +104,7 @@ function print_mnet_log_selector_form($hostid, $course, $selecteduser=0, $select
$users[$courseuser->id] = fullname($courseuser, has_capability('moodle/site:viewfullnames', $context));
}
}
if ($guest = get_complete_user_data('username', 'guest')) {
$users[$guest->id] = fullname($guest);
}
$users[$CFG->siteguest] = get_string('guestuser');
}
// Get all the hosts that have log records
@ -368,9 +366,7 @@ function print_log_selector_form($course, $selecteduser=0, $selecteddate='today'
$users[$courseuser->id] = fullname($courseuser, has_capability('moodle/site:viewfullnames', $context));
}
}
if ($guest = get_complete_user_data('username', 'guest')) {
$users[$guest->id] = fullname($guest);
}
$users[$CFG->siteguest] = get_string('guestuser');
}
if (has_capability('coursereport/log:view', $sitecontext) && $showcourses) {