The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Role reset each time a user logs in (4 posts)

  1. Michael
    Posted 5 years ago #

    We are experimenting with using wpCAS-w-LDAP with our WP3 multisite blog network.

    I have the following options in my wpcasldap-conf.php file:
    'useradd' => 'yes',
    'useldap' => 'yes',
    'email_suffix' => 'princeton.edu',
    'userrole' => 'subscriber'

    We have the plugin working; however, each time a user logs in via CAS, the user's role is reset to whatever role is supplied by the 'userrole' variable. We want new users to become subscribers when they log in, but we want manually-promoted users to retain their designated role.

    With a test subdirectory blog, I had a colleague who had the site role of Administrator. As soon as he clicked the "Log In" link for that that subdirectory blog and authenticated though CAS, he became a 'Subscriber.' I manually changed him back to Administrator. Then I changed 'userrole' in the conf file to contributor and repeated the test. With the last test, I set 'userrole' to author. Each time, his administrator role became whatever was set as the 'userrole.'

    Any ideas? Do I have an incorrect setting somewhere?

  2. jonathanbird
    Posted 5 years ago #

    Same thing is happening here. Logins work, but user is reset to default userrole. Makes it kind of hard to be a network admin when you are given 'subscriber' role :)

    WP 3.2
    using CAS version 1.0 for compatibility

    We do not have a config file, but use the admin interface.

    Any ideas for this?

  3. Michael
    Posted 5 years ago #

    We did confirm that the wpCAS-w-LDAP plugin works as intended with the default, single-site setup of WordPress. However, as soon as WordPress 3.2 is configured to use Multisite, the designated user roles are reset upon login to whatever role is supplied by the 'userrole' variable.

  4. josy1024@gmail.com
    Posted 4 years ago #

    you can manage the role through ldap:
    code: "wpcas-w-ldap.php"
    function get_user_data() { }
    'role' => $wpcasldap_use_options['userrole'],
    change the role type to maybe use an ldap attribute ;-)
    'role' => $this->data[0]['customldapattribute'][0],
    'role' => $this->data[0]['department'][0],

    by the way: i'v have changed your source to work with authenticated binds on ldap servers:


    regards josy

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • wpCAS-w-LDAP
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic