Title: Adding Prefix parameter
Last modified: August 21, 2016

---

# Adding Prefix parameter

 *  [Jamie O](https://wordpress.org/support/users/idealien/)
 * (@idealien)
 * [13 years ago](https://wordpress.org/support/topic/adding-prefix-parameter/)
 * I’m not super familiar with AD / LDAP to know whether the scenario I encountered
   with getting connectivity to work is common or not. But wanted to list what I
   had to do in case it is worth adding to a future version of the plugin.
 * **Issue:** Could not get WPDIRAuth or any other LDAP plugin to work without customization.
   Core issue is that a prefix parameter (“company/”) is required during authentication/
   search but not username / pass validation.
 * **Resolution**
    - Anywhere that accountSuffix or similar variable is stored, include an accountPrefix
      variable.
    - Add data entry field to plugin above suffix field
    - In wpDirAuth_retrieveUserDetails before generating rscResult…
    -     ```
          $accountPrefix = get_site_option('dirAuthAccountPrefix');
          		if($accountPrefix) {
          			//echo "PRE: strFilterQuery = " . $strFilterQuery . " and prefix = " . $accountPrefix . "<br/>";
          			$strFilterQuery = str_replace( $accountPrefix , "", $strFilterQuery );
          			//echo "POST: strFilterQuery = " . $strFilterQuery . "<br/>";
          		}
          ```
      
 * Would be happy to share full version of edits if desired. Just let me know preferred
   method to share to plugin devs (email, pastebin, etc).
 * [http://wordpress.org/extend/plugins/wpdirauth/](http://wordpress.org/extend/plugins/wpdirauth/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [Jamie O](https://wordpress.org/support/users/idealien/)
 * (@idealien)
 * [13 years ago](https://wordpress.org/support/topic/adding-prefix-parameter/#post-3725436)
 * A little further into this and understanding it a little less.
    - If I leave Bind DN / Bind Password empty – accounts which are already created
      OR attempted to create during a user login work successfully. However, use
      of the Add New Directory Authentication User form gets an error: “Directory
      authentication initially succeeded, but no valid profile was found (search
      procedure). []”
    - If Bind DN / Bind Password is filled – Admin can create new users but nobody
      is able to login with an AD account. All attempted logins get “Directory Authentication
      Error: Could not authenticate user. Please check your credentials. [Domain\
      username]”
 * I know this particular AD is kind of messy, but the weirdest part is that using
   the same account credentials to attempt both scenarios does not work. For time-
   being manual workaround is to put site into maintenance mode while creating new
   accounts (using Bind).
 * Would love to see a prefix field be in a future version and willing to be an 
   excellent beta test scenario for it if that happens.
 *  Thread Starter [Jamie O](https://wordpress.org/support/users/idealien/)
 * (@idealien)
 * [12 years, 3 months ago](https://wordpress.org/support/topic/adding-prefix-parameter/#post-3725541)
 * Any chance this might be considered for an update?

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Adding Prefix parameter’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wpdirauth.svg)
 * [wpDirAuth](https://wordpress.org/plugins/wpdirauth/)
 * [Support Threads](https://wordpress.org/support/plugin/wpdirauth/)
 * [Active Topics](https://wordpress.org/support/plugin/wpdirauth/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpdirauth/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpdirauth/reviews/)

## Tags

 * [prefix](https://wordpress.org/support/topic-tag/prefix/)

 * 2 replies
 * 1 participant
 * Last reply from: [Jamie O](https://wordpress.org/support/users/idealien/)
 * Last activity: [12 years, 3 months ago](https://wordpress.org/support/topic/adding-prefix-parameter/#post-3725541)
 * Status: not resolved