Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

looks like I might have finally fixed the darned bug where guest user…

…s were able to see the add/edit feeds link
  • Loading branch information...
commit 7501d8a52775d85a9d6348a491775093b1fb175a 1 parent 865a6f2
dhawes authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 blocks/rss_client/block_rss_client.php
View
8 blocks/rss_client/block_rss_client.php
@@ -77,7 +77,13 @@ function get_content() {
//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 />';
}
Please sign in to comment.
Something went wrong with that request. Please try again.