The mxc-ldap plugin has a simplified layout because it does not have any graphic interface to input the LDAP server information. To enter the information, open the mxc-ldap.php file andfill in LDAP_HOST, LDAP_PORT (389), LDAP_VERSION, BASE_DN, ADMIN_DN, ADMIN_PW. The plugin seems to work without the ADMIN_DN and the ADMIN_PW. The plugin as default will create a Wordpress user upon signing in with their LDAP id’s.
To create a blog for the ldap user that signs in for the first time, we have to add several lines after creating the user (line 60).
$userID = wp_insert_user($userData); //gets the userID from the userData that was just inserted and puts it into $userID $user = get_userdatabylogin($username); //gets the username $sitename = 'vfolio.educ.ubc.ca'; //the site where the blog is held, 'efolio.educ.ubc.ca' for production server $blogdir = "/".$ldapuser[0][LOGIN][0]; // the directory of where the blog will be; the url that comes after the sitename $blogtitle = $ldapuser[0][LOGIN][0]; // title of the blog (can be changed) $meta = ""; wpmu_create_blog($sitename,$blogdir,$blogtitle,$userID,$meta,'1'); //creates the blog with above information</code>
The plugin webpage doesn’t exist anymore and the author webpage is in French, so help for this plugin is very limited. Feel free to leave me comments if you get stuck with this plugin and I will try to help you best to my ability. However, make sure you read Clifton’s post on his plugin first, which is what the mxc-ldap plugin is based on (but you already know that).
This article was written for the Faculty of Education at the University of British Columbia and cannot be copied, modified, or published without the consent of the University.