From c05ccf3fa7fb98d042a5ef2db3bec1cfa57c81af Mon Sep 17 00:00:00 2001 From: Andrew Davis Date: Fri, 19 Nov 2010 06:39:00 +0000 Subject: [PATCH] rss MDL-25319 removing unnecessary call to isguestuser() --- rss/file.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rss/file.php b/rss/file.php index 20ed87c6e58..7d2f9f5da26 100644 --- a/rss/file.php +++ b/rss/file.php @@ -95,8 +95,14 @@ if ($token==="$inttoken") { rss_error('rsserror'); } - //calling isguestuser() just to make sure that $CFG->siteguest is set - isguestuser($token); + //make sure that $CFG->siteguest is set + if (empty($CFG->siteguest)) { + if (!$guestid = $DB->get_field('user', 'id', array('username'=>'guest', 'mnethostid'=>$CFG->mnet_localhost_id))) { + // guest does not exist yet, weird + rss_error('rsserror'); + } + set_config('siteguest', $guestid); + } $guesttoken = rss_get_token($CFG->siteguest); //change forum to mod_forum (for example)