• Resolved mlipenk

    (@mlipenk)


    First, I tried multiple auth plugins. This is the only one that works with the typical LDAP settings which I’m used to using for other web applications. So good job!

    For my WordPress implementation, I don’t want just anybody being able to log in (ie: Automatic user creation), because we have a large organization and I only want admin assistants to have access, but they don’t necessarily have a specific role in Active Directory either. Everyone is simply an Employee.

    So I have “Automatic user creation” de-selected in the plugin settings. And I’m assuming that I would add users in WordPress as an Admin normally would. And if the user id matches Active Directory for the WP editor, that is what would allow them access to WordPress via LDAP Authentication.

    However, Every time I try to add a WordPress editor I get the following error:

    Notice: Undefined property: stdClass::$ID in?/Applications/MAMP/htdocs/wp/wp-content/plugins/next-active-directory-integration/classes/Adi/User/Profile/Ui/PreventEmailChange.php?on line?87

    Warning: Cannot modify header information – headers already sent by (output started at /Applications/MAMP/htdocs/wp/wp-content/plugins/next-active-directory-integration/classes/Adi/User/Profile/Ui/PreventEmailChange.php:87) in?/Applications/MAMP/htdocs/wp/wp-includes/pluggable.php?on line?1223

    I found that it is getting hung up on the (required) e-mail field for the new WordPress user. Going back to the “Users” after the error, the user is actually created and authentication works thereafter. But getting the error everytime a WP user is created is annoying.

    I did figure out that the following setting has to be de-selected to avoid the error:

    Prevent email change: “Prevents users authenticated by Active Directory from changing their email address in WordPress.”

    But the user has NOT yet authenticated in WordPress. They are simply being added by an Admin. Is there another setting that will allow the creation of users in WordPress, without an error, that still allows the “Prevent email change” to be selected???

    Maybe I’m not understanding the intent of some features of the plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author schakko

    (@schakko)

    Regarding the warning: We are not able to reproduce this behavior with WordPress 4.9.x or 5.x, so my guess is that some of your other installed plug-ins interfer. Do you have any mail or user profile related plug-ins installed like BuddyPress?
    Can you change the PreventEmailChange.php file so that the line 87 looks like

    
    add_filter('send_email_change_email', '__return_false');
    
    /* ADD */
    if (!is_object($user) || !property_exists($user, 'ID')) {
      global $wp_actions;
      print_r($wp_actions['user_profile_update_errors']);
      debug_print_backtrace();
      exit;
    }
    /* end ADD */
    
    //
    $samAccountName = get_user_meta($user->ID, NEXT_AD_INT_PREFIX . 'samaccountname', true);
    

    When you try to reproduce the error you should get a stacktrace and all other registered actions for the specific part of code.

    Regarding the feature itself: Users who have been added manually in WordPress and have not been authenticated yet by NADI are still able to change their email address. We have adjusted the documentation accordingly.

    Hey @mlipenk
    we have added a fix for this issue and it will be released as part of the 2.1.8 update.
    Thank you very much for contributing to the plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘New User Creation Error’ is closed to new replies.