From: dhawes <dhawes>
Date: Sat, 29 Jan 2005 05:06:43 +0000 (+0000)
Subject: looks like I might have finally fixed the darned bug where guest users were able... 
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=7501d8a52775d85a9d6348a491775093b1fb175a;p=moodle.git

looks like I might have finally fixed the darned bug where guest users were able to see the add/edit feeds link
---

diff --git a/blocks/rss_client/block_rss_client.php b/blocks/rss_client/block_rss_client.php
index d34b7377e4..7a19f80368 100644
--- a/blocks/rss_client/block_rss_client.php
+++ b/blocks/rss_client/block_rss_client.php
@@ -77,7 +77,13 @@ class block_rss_client extends block_base {
 
         //if the user is an admin, course teacher, or all users are allowed
         // then allow the user to add rss feeds
-        if ( !isguest() && (isadmin() ||  $submitters == SUBMITTERS_ALL_ACCOUNT_HOLDERS || ($submitters == SUBMITTERS_ADMIN_AND_TEACHER && $isteacher)) ) {
+        global $USER;
+        $userisloggedin = false;
+        if (isset($USER) && isset($USER->id) && $USER->id && !isguest()) {
+            $userisloggedin = true;
+        }
+        if ( $userisloggedin && (isadmin() ||  $submitters == SUBMITTERS_ALL_ACCOUNT_HOLDERS || ($submitters == SUBMITTERS_ADMIN_AND_TEACHER && $isteacher)) ) {
+            echo 'ADDING TO OUTPUT';
             $output .= '<div align="center"><a href="'. $CFG->wwwroot .'/blocks/rss_client/block_rss_client_action.php?courseid='. $courseid .'">'. get_string('block_rss_feeds_add_edit', 'block_rss_client') .'</a></div><br />';
         }