• Resolved rleguede

    (@rleguede)


    Hi,

    I’ve got an issue with “Users Roles Settings”.
    I can’t define two roles to a user.

    Context : my website is a community website. So, I use bbPress plugin
    This plugin define a second role to a WordPress user (example, user can be an Author (wordpress) and a Subscriber (bbpress) )

    I need these two roles to define a user.

    But, when I did that, your plugin apply only the second rules and not the first one.

    Example of my rules :
    – administrator|(CAS{cas_user_id} -EQ “Romane”)
    – bbp_keymaster|(CAS{cas_user_id} -EQ “Romane”)

    So when I try to reconnect myself, I’m not Administrator of my site anymore, only Administrator on forum plugin.

    When I remove all rules, I reconnect myself and then … I’m not Administrator anymore too ! Only a subscriber…

    Can you help me with this ?

    https://www.ads-software.com/plugins/wp-cassify/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi,

    Please update to version 1.8.0. Keep me informed if it works.
    You can display user roles in front page with this :

    <?php
    						$current_user = wp_get_current_user();
    						print_r( $current_user->roles );
    					?>

    I’ve replace this code :

    // Suscriber role is pushed by default to successfully authenticated user
    					if ( count( $roles_to_push ) == 0 ) {
    						array_push( $roles_to_push, 'subscriber' );
    					}
    
    					foreach ( $roles_to_push as $role ) {
    						WP_Cassify_Utils::wp_cassify_set_role_to_wordpress_user( $cas_user_datas[ 'cas_user_id' ], $role );
    					}

    By this :

    // Suscriber role is pushed by default if wordpress user account has been created.
    					if ( $wordpress_user_account_created ) {
    						array_push( $roles_to_push, 'subscriber' );
    					}
    
    					foreach ( $roles_to_push as $role ) {
    						WP_Cassify_Utils::wp_cassify_add_role_to_wordpress_user( $cas_user_datas[ 'cas_user_id' ], $role );
    					}
    Thread Starter rleguede

    (@rleguede)

    Hi,

    I update to version 1.8, everything seems all right !

    Thank you very much !

    Ok,

    So I close ticket.

    Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Users Roles Settings’ is closed to new replies.