Advertisement
sanjaynakate

check

Sep 16th, 2015
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.85 KB | None | 0 0
  1. <?php
  2.  
  3. function i4w_authenticated_remote_login_action($user, $contact) {
  4.   global $SESSION;
  5.   IF ($arrTAGS = explode(',', $SESSION['i4wuser']['Groups'])) :
  6.     IF (in_array(38181, $arrTAGS) || in_array(38185, $arrTAGS) || in_array(38193, $arrTAGS)) :
  7.       echo $user_id = get_current_user_id();      
  8.       $new_role_forum_role="bbp_participant";
  9.       echo bbp_set_user_role( $user_id, $new_role_forum_role );
  10.       exit();
  11.     ELSEIF (in_array(38177, $arrTAGS) || in_array(38195, $arrTAGS) || in_array(38183, $arrTAGS) || in_array(38187, $arrTAGS) || in_array(38189, $arrTAGS)) :
  12.       $user_id = get_current_user_id();      
  13.       $new_role_forum_role=”bbp_spectator”;
  14.       bbp_set_user_role( $user_id, $new_role_forum_role );
  15.     ENDIF;
  16.   ENDIF;
  17. }
  18. add_filter('i4w_authenticated_remote_login', 'i4w_authenticated_remote_login_action', 1, 2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement