Skip to content

Commit

Permalink
Do not show the 'Post New Topics via Email' block if not a member.
Browse files Browse the repository at this point in the history
Previously, if a user was logged in and was viewing a group they were not a member of, that user could still view the 'Post New Topics via Email' block.  This has been corrected in this commit.

Also, this blocks super admins who are not a member of the group from viewing this block as well as it doesn't make much sense to me.

Fixes #17.
  • Loading branch information
r-a-y committed Aug 24, 2012
1 parent 72a969f commit c1afed1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion includes/bp-rbe-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -881,8 +881,9 @@ function bp_rbe_alter_forum_post_timestamp( $timestamp ) {
* @since 1.0-beta
*/
function bp_rbe_new_topic_info_css() {
$current_group = groups_get_current_group();

if ( bp_is_group_forum() && ! bp_action_variables() && bp_loggedin_user_id() ) :
if ( bp_is_group_forum() && ! bp_action_variables() && bp_loggedin_user_id() && ! empty( $current_group->is_member ) ) :
?>
<style type="text/css">
#rbe-toggle { display:none; }
Expand All @@ -902,6 +903,12 @@ function bp_rbe_new_topic_info_css() {
*/
function bp_rbe_new_topic_info() {
global $bp;

$group = groups_get_current_group();

// if current user is not a member of the group, stop now!
if ( empty( $group->is_member ) )
return;
?>
<h4><?php _e( 'Post New Topics via Email', 'bp-rbe' ) ?></h4>

Expand Down

0 comments on commit c1afed1

Please sign in to comment.