wpmuldap uses deprecated constant VHOST. Use SUBDIR_INSTALL instead. Fix could be
diff --git a/wp-content/plugins/wpmuldap/lib/wpmu_ldap.functions.php b/wp-content/plugins/wpmuldap/lib/wpmu_ldap.functions.php
index bb0cf133e..639518689 100644
--- a/wp-content/plugins/wpmuldap/lib/wpmu_ldap.functions.php
+++ b/wp-content/plugins/wpmuldap/lib/wpmu_ldap.functions.php
@@ -62,7 +62,7 @@ function wpmuLdapCreateWPUserFromLdap($opts) {
do_action('wpmu_activate_user', $user_id, $newUserPassword, false);
$domain = strtolower( wp_specialchars( $newUserName ) );
- if( constant( "VHOST" ) == 'yes' ) {
+ if( constant( "SUBDOMAIN_INSTALL" ) === True ) {^M
$newdomain = $domain . "." . $current_site->domain;
$path = $base;
}
]]>
Thank you for updating your plugin for PHP 8.
I saw a few more depreciated WordPress functions still in use:
Most of these (if not all?) are simple renaming of the original function.
First of all, thank you for updating the plugin and it’s good to see you back. 4.0.2 throws this notice and I don’t think it’s been addressed as of 5.0.1:
delete_usermeta is deprecated since version 3.0.0! Use delete_user_meta() instead. in /var/www/html/wp-includes/functions.php on line 4648
It needs to be replaced in two places and it’s a simple rename of the function call.
]]>Hello,
Hopefully this plugin hasn’t been squatted on by someone nefarious. I see the new updates. I posted three threads over 7 years ago for issues that are still present in this latest update:
https://www.ads-software.com/support/topic/fix-for-group-membership-on-windows/
https://www.ads-software.com/support/topic/captcha-plugin-compatibility-1/
https://www.ads-software.com/support/topic/why-forcing-subscription-to-dashboard-blog-blog-1/
Here are some screenshots of the edits and the ldap_core.php file that I modified. Note that these version diffs are based on the previously released version: https://drive.google.com/drive/folders/1HP-o9iFC1Xxe4FWf-ZOW6zGZAHZeYbi1?usp=sharing
]]>Hi
When new user logs in with whitespaces after her login name, new blow was created with whitespaces in slug. My quick fix is
--- wpmuldap/lib/wpmu_ldap.functions.php.orig 2021-11-25 10:55:49.741703173 +0200
+++ wpmuldap/lib/wpmu_ldap.functions.php 2021-11-25 10:58:04.074494339 +0200
@@ -19,6 +19,9 @@
if (!isset($ldapUserData)) $ldapUserData = false;
if (!isset($createBlog)) $createBlog = true;
+ // masse 25.11.2021 - sanitize $newUserName
+ $newUserName = trim($newUserName);
+
// Check to see if email is empty
if ( empty($ldapUserData[LDAP_INDEX_EMAIL]) )
return new WP_Error('ldapcreate_emailempty', sprintf(__('<strong>ERROR</strong>: <strong>%s</strong> does not have an email address associated with the ldap record. All wordpress accounts must have a unique email address.'),$newUserName));
]]>
Good morning.
We have been using the old WPMU Ldap Authentication plugin workhorse on our sites for years, but now, as we are updating our servers to the newest Ubuntu and PHP versions, we are having compatibility issues. We were hoping that there is a quick fix for this that either you have already added to the php, or that we can add to the plugin ourselves to get WPMU Ldap Authentication to continue to work with our site on PHP7.
Thank you in advance.
-Chris
]]>Our LDAP authentication suddenly stopped working. We had it working for years, I can’t recall making any LDAP changes lately. Every user, including admins, gets the same error: ERROR: Unknown error in LDAP Authentication. We would like to try to point WordPress to use a different LDAP server but we can’t make any changes since no one can sign in. Is there any way to make changes manually? What file holds LDAP server info? Thank you.
]]>Hi,
I use this plugin to add user with LDAP server.
When i add user to the child page, same user is added to the parent page at the same time and it’s automatic.
Is there any way to stop adding user to the parent page?
The recent changes to WP render parts of this plugin inoperable. Most notably the welcome messages are from the WP not from plugin and LDAP passwords revealed in plaintext.
There seems to be a lot of thing to fix to make this again fully compatible. Any information about development state ?
Here’s a patch that fixes makes custom welcome messages to work again.
And no, the subject is not implemented as it is impossible because user_id is not passed to “update_welcome_user_subject” blame WP team… hint, should pass same arguments as to “wpmu_welcome_user_notification” minus password.
------------------------------------------------------------------------------------------
--- ldap_auth.php 2012-09-28 16:43:16.000000000 +-0200
+++ ldap_auth.php 2016-02-16 14:22:01.000000000 +-0200
@@ -63,7 +63,9 @@
// disable default add user box
add_filter('show_adduser_fields', 'wpmuLdapDisableShowUser');
//override admin toolbar option for creating user accounts
add_action('wp_before_admin_bar_render', 'wpmuLdap_custom_admin_bar_render');
+ //MIG: Activate custom welcome messages
+ add_filter('update_welcome_user_email', 'wpmuLdapUpdateWelcomeUserEmail',10,4);
}
------------------------------------------------------------------------------------------
--- lib\wpmu_ldap_admin.functions.php 2012-09-28 16:43:16.000000000 +-0200
+++ lib\wpmu_ldap_admin.functions.php 2016-02-16 14:22:52.000000000 +-0200
@@ -726,12 +726,30 @@
* Disable the built in add user form on the users page.
*/
function wpmuLdapDisableShowUser() {
return false;
}
+/**
+ * MIG: Welcome Notification Message
+ */
+
+function wpmuLdapUpdateWelcomeUserEmail($welcome_email, $user_id, $password, $meta) {
+ if (get_user_meta($user_id, 'ldap_login',true)) {
+ $msg = get_site_option('ldapLDAPEmailMessage');
+ if (!empty($msg)) $welcome_email = $msg;
+
+ //Make sure the password is hidden for LDAP accounts
+ $welcome_email = str_replace("PASSWORD",'-',$welcome_email);
+ } else {
+ $msg = get_site_option('ldapLocalEmailMessage');
+ if (!empty($msg)) $welcome_email = $msg;
+ }
+ return $welcome_email;
+}
+
if ( !function_exists('wp_new_user_notification') ) :
/**
* Overriding of the new user notification, so that users are not confused by
* email messages with passwords.
*
*/
------------------------------------------------------------------------------------------
]]>
Does anyone know if its possible for this plugin to notice if the e-mail address for an AD user has changed and to update the WordPress user profile accordingly?
Still using plugin v3.1.1 here.
Thanks!
]]>Has anyone gotten LDAP over SSL to work with WPMU LDAP?
I’m using IIS (not Apache). I couldn’t get SSL to work with the Active Directory Integration plugin either, so I suspect this may have something to do with php or IIS.
I found many articles on the ADI plugin but nothing fixed the problem for me.
So I’m giving WPMU LDAP a try.
]]>This plugin bypasses the captcha plugin. I assume it’s a filer/action priority issue.
]]>Why are you forcing subscription to dashboard blog / blog #1? I’ve commented it out in the 3 locations I’ve found (lines 87, 198, and 202) of wpmu_ldap.functions.php and haven’t seen any negative side effects.
Thanks
]]>When utilizing the option for allowing only users to sign in that are a member of a certain group I was getting the following warning:
Warning: ldap_get_entries() expects parameter 2 to be resource, boolean given in D:\inetpub\wp\wp-content\plugins\wpmuldap\lib\ldap_core.php on line 219
followed by an error on the login screen saying the user wasn’t a member of the specified security groups.
I did some digging and found 2 problems. Number one according to this document backslashes in search queries need to be escaped with “\5c”.
So the first modification is to add “$userDN = str_replace(‘\\,’,’\\5c,’, $userDN);” to line 214 of ldap_core.php.
if (get_site_option('ldapLinuxWindows')) {
$search_filter = "(".get_site_option('ldapAttributeMemberNix',LDAP_DEFAULT_ATTRIBUTE_MEMBERNIX)."=$userDN)";
$search_filter .= "(objectclass=".get_site_option('ldapAttributeGroupObjectclassNix',LDAP_DEFAULT_ATTRIBUTE_GROUP_OBJECTCLASSNIX).")";
} else {
$userDN = str_replace('\\,','\\5c,', $userDN);
$search_filter = "(".get_site_option('ldapAttributeMember',LDAP_DEFAULT_ATTRIBUTE_MEMBER)."=$userDN)";
$search_filter .= "(objectclass=".get_site_option('ldapAttributeGroupObjectclass',LDAP_DEFAULT_ATTRIBUTE_GROUP_OBJECTCLASS).")";
}
After getting passed that issue I was presented with another warning:
Warning: strtolower() expects parameter 1 to be string, array given in D:\inetpub\wp\wp-content\plugins\wpmuldap\lib\ldap_core.php on line 227 Warning: strtolower() expects parameter 1 to be string
Which was repeated for each group returned. Looks like it was returning an array instead of just a string. So the second modification was adding the following code at line 226 (would have been 225 before previous mod):
if (is_array($results[$i][get_site_option('ldapAttributeDN',LDAP_DEFAULT_ATTRIBUTE_DN)])) {
$userGroups[$i] = strtolower($results[$i][get_site_option('ldapAttributeDN',LDAP_DEFAULT_ATTRIBUTE_DN)][0]);
} else {
$userGroups[$i] = strtolower($results[$i][get_site_option('ldapAttributeDN',LDAP_DEFAULT_ATTRIBUTE_DN)]);
}
]]>
In the option tree there is an option for “Create local users?” and even with it set to no still seems to let me create local users. What is this supposed to do?
Also, I wasn’t 100% sure what “Allow blog admins to add users?” does. Does that allow them to add LDAP users only, or both? Does it relate to the “Create local users?” setting?
Lastly, under the add user menu and then in the “Add bulk user” section the sub-heading says “Local user creation is not available in bulk.” I don’t understand what else it would be doing if not creating local users.
Thanks
]]>Users are presented with a blank page after logging in with WPMU LDAP Plugin. In ldap_auth.php I set LDAP_DEBUG_MODE to TRUE. After that, when a user logged in the blank screen displayed “DEBUG: Attempting to authenticate user: ” plus their username. Simply pressing the back space and refreshing the browser showed the user had in fact successfully logged into the system using LDAP so I added those instructions to the end of the debug message in wpmu_ldap.functions.php file.
I had WPMU LDAP Plugin 3.1 installed. Checked and found 4.0.2 was available so I’ve upgraded to that and get the same issue.
]]>Hi,
Maybe I’m missing something, but before I pull the switch on using this, I was hoping to find out a little information on what would happen with existing local accounts.
Specifically, I have a situation where the WPMU server has been running for some time. I have a hundred or so local accounts, all with usernames that exactly match their AD usernames. I’d like to convert to using LDAP authentication now. I have successfully tested a connection and seem to be good to go. If I now enable this plugin, will existing accounts start to authenticate against the LDAP server, or will they still use the old, local WP passwords?
Thanks for any input,
v
Hi Aaron,
i have a question for the LDAP Authentication / resp. the User add feature.
The user add only works, if in the groups configuration tab no LDAP Group is configured. If i add an ldap group there, i could not add users via network -> Users -> user add!
Would you like to help me please, how we could figure out the root cause for this ?
In summary your ldap plugin is working fine, but there are some main issues (i opened a thread for each of this) which makes the life not too easy.
Kind regards,
Axel
]]>Hi Aaron,
it is possible to improve the ldap group authentication?
Thank you very much
Kind regards
Axel
Please don’t close the issue, without leaving a message. Thank you!
Hi @aaron,
since yesterday i’am using your plugin on my multisite installation and i’am very impressed. It works fine.
But some messages making me wondering:
Notice: Undefined index: ldapTestConnection in /$DOCROOT/www/wp-content/plugins/wpmuldap/lib/wpmu_ldap_admin.functions.php on line 73
SingleSignOn:
Notice: Undefined variable: tSSOChecked in /nnnnn/www/wp-content/plugins/wpmuldap/lib/wpmu_ldap_admin.functions.php on line 239
Allow Blog Admins to create users:
Notice: Undefined variable: fAddUser in /nnnnn/www/wp-content/plugins/wpmuldap/lib/wpmu_ldap_admin.functions.php on line 287
/>
and so on..
Do you need a full list of this messages ?
Do you plan to official support the wordpress 3.9.1 und forward releases ?
Thank you very much,
Axel
Hi @aaron,
since yesterday i’am using your plugin on my multisite installation and i’am very impressed. It works fine.
But some messages making me wondering:
Notice: Undefined index: ldapTestConnection in /$DOCROOT/www/wp-content/plugins/wpmuldap/lib/wpmu_ldap_admin.functions.php on line 73
SingleSignOn:
Notice: Undefined variable: tSSOChecked in /nnnnn/www/wp-content/plugins/wpmuldap/lib/wpmu_ldap_admin.functions.php on line 239Allow Blog Admins to create users:
Notice: Undefined variable: fAddUser in /nnnnn/www/wp-content/plugins/wpmuldap/lib/wpmu_ldap_admin.functions.php on line 287
/>
and so on..
Do you need a full list of this messages ?
Do you plan to official support the wordpress 3.9.1 und forward releases ?
]]>We have a CentOS 6 server using nginx for our WP multisite network. We’re trying to use WPMU Ldap Authentication plugin v.4.0.2. I have triple checked all the credentials but whenever we try to “save options” with the “test connection” radio button checked yes, we end up with a dashboard page with top and left side menus but blank results area. We are able to telnet from the server to the ldap server and manually access via CLI command but cannot get a connection through the plugin for our WordPress network.
The ldap server is displaying this message:
conn=1740755 op=-1 msgId=-1 - fd=141 slot=141 LDAP connection from {wordpress IP} to {ldap IP}
conn=1740755 op=0 msgId=0 - RESULT err=80 tag=120 nentries=0 etime=0
conn=1740755 op=-1 msgId=-1 - closing from {wordpress IP} - B1 - Client request contains an ASN.1 BER tag that is corrupt or connection aborted -
conn=1740755 op=-1 msgId=-1 - closed.
Any ideas?
]]>I’ve got the plugin working and connecting with the LDAP, but is there anyway to assign user roles based on an attribute held within the LDAP? We have department ID that I would like to use to give people access to particular parts of the site. Any tips would be appreciated!
]]>Hi !
I’m new to the LDAP thing and so I have a newbie question:
Is it possible to use the plugin, if the AD/LDAP-Server is behind a firewall inside the LAN and wordpress is hosted by an ISP ???
Do I need some kind of “connector” to make the connection through the firewall first, so that the server can be found inside the LAN by its name or IP?
I hope it’s not a too stupid question ??
Thanks in advance
Best regards
Tom
I’m using wpmuldap_4.0.2_FIXED.zip but I believe that this would almost certainly also apply to the wpmuldap_4.0.2.zip release. I was getting the sub-blog/site being created without the leading slash when using this plugin with WP 3.8.1 and 3.8.2 in a subdirectory network install.
I’d suggest the following modest tweak:
In wp-content/plugins/wpmuldap/lib/wpmu_ldap.functions.php edit as follows:
// tjo, 4-15-2014
// $path = $base . $domain . '/';
$path = $base . '/' . $domain . '/';
This allows the path, home, and site_url to be created correctly when using a sub-directory WP installation with this plugin.
]]>Hello,
I have the plugin installed and everything works perfectly except when I visit my blog’s homepage. For whatever reason, the admin bar disappears.
When I click on a blog post, for instance, it comes back.
The admin bar shows on all pages except the homepage.
Any ideas on how I can solve this?
Thank you.
]]>Hi Guys!
I will leave some tips for anyone who are trying to make this plugin work on AD (Active Directory):
1) At “Connection Settings” make sure you are setting the search user correctly (add the domain spec like: MY-DOMAIN\USER). And then check the option “Test Connection” before saving. You should see a “Connection Successful” message.
2) At “Attribute Mapping” pay attention on every AD attribute. The “Distinguished Name (DN)” attribute on AD is “distinguishedName” and not “dn“. The “Phone” is “telephoneNumber“. Clear the Home Directory and Mac Address if your not sure about them.
And the last one…
Download this application to test your connection settings and attribute lookup:
https://www.ldapadmin.org/download/latest.php
I hope this may be useful for someone.
Bye!
]]>Love the plugin. It recently stopped working when we updated our server from Mac OS X 10.8 to Mac OS X 10.9. I can still connect to the LDAP directory using the settings I have in Connection Settings using LDAPManager, but whenever I try to test the connection for the plugin it fails. Is there a way I can debug this to get more information, or are you aware of anything I can do to resolve this?
]]>I’d like the plugin to support user@domain style entries in the REMOTE_USER environment variable.
Please see the following link d=for details:
]]>Just a note that the installation instructions contain a minor error:
1. Unzip the plugin contents to the /wp-content/plugins/post-expirator/
directory