<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Life of Lew Ayotte &#187; open source</title>
	<atom:link href="http://lewayotte.com/tag/open-source/feed/" rel="self" type="application/rss+xml" />
	<link>http://lewayotte.com</link>
	<description>Pursue righteousness, godliness, faith, love, perseverance and gentleness. Fight the good fight of faith; take hold of the eternal life to which you were called... - 1 Timothy 6:11-12</description>
	<lastBuildDate>Wed, 09 May 2012 16:30:56 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Active Directory (LDAP) Authentication in WordPress Multi-Site</title>
		<link>http://lewayotte.com/2010/09/09/active-directory-ldap-authentication-in-wordpress-multi-site/</link>
		<comments>http://lewayotte.com/2010/09/09/active-directory-ldap-authentication-in-wordpress-multi-site/#comments</comments>
		<pubDate>Thu, 09 Sep 2010 16:30:00 +0000</pubDate>
		<dc:creator>Lew</dc:creator>
				<category><![CDATA[Mind]]></category>
		<category><![CDATA[active directory]]></category>
		<category><![CDATA[ldap]]></category>
		<category><![CDATA[mu-plugins]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[wpms]]></category>

		<guid isPermaLink="false">http://lewayotte.com/?p=1881</guid>
		<description><![CDATA[As many of you know, I led the team that launched the College of Education at UGA&#8217;s new website (http://www.coe.uga.edu/) which is driven by WordPress Multi-Site. The first phase is complete, and the second phase has started up. Part of their second phase is to allow a custodian from each department to edit content on [...]<div class="addthis_toolbox addthis_default_style addthis_" addthis:url='http://lewayotte.com/2010/09/09/active-directory-ldap-authentication-in-wordpress-multi-site/' addthis:title='Active Directory (LDAP) Authentication in WordPress Multi-Site ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p>As many of you know, I led the team that launched the College of Education at UGA&#8217;s new website (http://www.coe.uga.edu/) which is driven by WordPress Multi-Site. The first phase is complete, and the second phase has started up. Part of their second phase is to allow a custodian from each department to edit content on their own departmental site. UGA uses Active Directory campus wide, so I thought it would be best to incorporate the WordPress authentication mechanism into UGA&#8217;s current AD implementation.</p>
<p>When I first researched this there weren&#8217;t many plugins for WordPress Multi-Site that handled AD/LDAP authentication. I was planning on writing one myself, but I found one yesterday by <a  href="http://clifgriffin.com/2009/05/13/simple-ldap-login-13-for-wordpress/">Clifton Griffin</a> called <a  href="http://wordpress.org/extend/plugins/simple-ldap-login/">Simple LDAP Login</a>. I installed in on a development website, put in the necessary information and BAM it worked&#8230; but it wasn&#8217;t really designed for WordPress Multi-Site. What I needed was every site to use the Active Directory authentication, without having to set each site up individually. So I paired down the code a bit (to just what I needed) and stuck the files in the mu-plugins dir.</p>
<p>Clifton used the opensource <a  href="http://adldap.sourceforge.net/">PHP LDAP Class</a> in his plugin, which works great. So, in my version, I stripped out everything I didn&#8217;t need/want like auto account creation, non-AD functionality, etc. Basically, I just needed to authenticate users via Active Directory.</p>
<p>So I stuck this code into a file in my mu-plugins folder. Now whenever anyone tries to authenticate it, uses Active Directory instead of WordPress&#8217; user table:</p>
<pre class="php">&lt;?php
require_once( WPMU_PLUGIN_DIR . '/simple-ldap-login/adLDAP.php' );

define( 'DOMAIN_CONTROLLERS', 	'active.directory.controller.domain' );
define( 'SECURITY_MODE', 		'high' );
define( 'ACCOUNT_SUFFIX', 		'@account.edu');
define( 'BASE_DN', 				'OU=OUOU,DC=DCDC,DC=EDU' );
define( 'USE_TLS',				false );
define( 'USE_SSL', 				true );

//Authenticate function
function sll_authenticate( $user, $username, $password ) {
	if ( is_a( $user, 'WP_User' ) ) { return $user; }

	//Failed, should we let it continue to lower priority authenticate methods?
	if( "high" === SECURITY_MODE ) {
		remove_filter('authenticate', 'wp_authenticate_username_password', 20, 3);
	}

	if ( empty( $username ) || empty( $password ) ) {
		$error = new WP_Error();

		if ( empty( $username ) )
			$error-&gt;add( 'empty_username', __( '<strong>ERROR</strong>: The username field is empty.' ) );

		if ( empty($password) )
			$error-&gt;add( 'empty_password', __( '<strong>ERROR</strong>: The password field is empty.' ) );

		return $error;
	}

	if( sll_can_authenticate( $username, $password ) ) {
			$user = get_userdatabylogin( $username );

			if ( !$user || ( strtolower( $user-&gt;user_login ) != strtolower( $username ) ) ) {
				do_action( 'wp_login_failed', $username );
				return new WP_Error( 'invalid_username', __( '<strong>Login Error</strong> An error occurred while attempting to log in. If this continues please contact coeweb@uga.edu for support.' ) );
			} else {
				//we're ready to return the user
				return new WP_User( $user-&gt;ID );
			}
	} else {
		return new WP_Error( 'invalid_username', __( '<strong>Login Error</strong> An error occurred while attempting to log in. If this continues please contact coeweb@uga.edu for support.' ) );
	}
}
add_filter( 'authenticate', 'sll_authenticate', 1, 3 );

function sll_can_authenticate( $username, $password ) {
	$sll_options = array(
		'account_suffix'		=&gt;	ACCOUNT_SUFFIX,
		'base_dn'				=&gt;	BASE_DN,
		'use_tls'				=&gt;	USE_TLS,
		'use_ssl'				=&gt;	USE_SSL,
		'domain_controllers'	=&gt;	explode( ';', DOMAIN_CONTROLLERS )
	);

	$adldap = new adLDAP( $sll_options );

	$result = false;
	$result = $adldap-&gt;authenticate( $username, $password );

	return $result;
}
</pre>
<div class="addthis_toolbox addthis_default_style addthis_" addthis:url='http://lewayotte.com/2010/09/09/active-directory-ldap-authentication-in-wordpress-multi-site/' addthis:title='Active Directory (LDAP) Authentication in WordPress Multi-Site ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://lewayotte.com/2010/09/09/active-directory-ldap-authentication-in-wordpress-multi-site/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Notable Tech Posts &#8211; 2009.11.15</title>
		<link>http://lewayotte.com/2009/11/15/notable-tech-posts-2009-11-15/</link>
		<comments>http://lewayotte.com/2009/11/15/notable-tech-posts-2009-11-15/#comments</comments>
		<pubDate>Sun, 15 Nov 2009 17:00:51 +0000</pubDate>
		<dc:creator>Lew</dc:creator>
				<category><![CDATA[Mind]]></category>
		<category><![CDATA[best practices]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[user interface]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://lewayotte.com/?p=1351</guid>
		<description><![CDATA[Best practices for 6 common user interface elements 7 ways to crash a database A collection of little known coding for unix 20 Javascript codes to make your web design look excellent Create a zoomable interactive maps with jQuery 16 WordPress sites to help you build a better blog Introducing catswhoblog com Awesome jQuery sliders [...]<div class="addthis_toolbox addthis_default_style addthis_" addthis:url='http://lewayotte.com/2009/11/15/notable-tech-posts-2009-11-15/' addthis:title='Notable Tech Posts &#8211; 2009.11.15 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p><a  href="http://www.webdesignerdepot.com/2009/11/best-practices-for-6-common-user-interface-elements/" target="_blank">Best practices for 6 common user interface elements</a></p>
<p><a  href="http://blog.tuvinh.com/7-ways-to-crash-a-database/" target="_blank">7 ways to crash a database</a></p>
<p><a  href="http://designreviver.com/tips/a-collection-of-little-known-coding-for-unix/" target="_blank">A collection of little known coding for unix</a></p>
<p><a  href="http://www.psdeluxe.com/articles/web-design/20-javascript-codes-to-make-your-web-design-look-excellent.html" target="_blank">20 Javascript codes to make your web design look excellent</a></p>
<p><a  href="http://www.webappers.com/2009/11/09/create-a-zoomable-interactive-maps-with-jquery/" target="_blank">Create a zoomable interactive maps with jQuery</a></p>
<p><a  href="http://sixrevisions.com/wordpress/16-wordpress-sites-to-help-you-build-a-better-blog/" target="_blank">16 WordPress sites to help you build a better blog</a></p>
<p><a  href="http://www.catswhocode.com/blog/introducing-catswhoblog-com" target="_blank">Introducing catswhoblog com</a></p>
<p><a  href="http://coderplus.com/2009/11/awesome-jquery-sliders/" target="_blank">Awesome jQuery sliders</a></p>
<p><a  href="http://www.webdesignerwall.com/tutorials/5-simple-but-useful-css-properties/" target="_blank">5 simple but useful CSS properties</a></p>
<p><a  href="http://habitually.blogmas.com/2009/11/10/design-and-promote-your-e-commerce-site/" target="_blank">Design and promote your e-Commerce site</a></p>
<p><a  href="http://hungred.com/useful-information/php-form-validation-snippets/" target="_blank">PHP form validation snippets</a></p>
<p><a  href="http://www.webdesignerwall.com/tutorials/5-simple-but-useful-css-properties/" target="_blank">5 simple but useful CSS properties</a></p>
<p><a  href="http://blog.tuvinh.com/10-tools-to-improve-your-site%E2%80%99s-usability-on-a-low-budget/" target="_blank">10 tools to improve your site&#8217;s usability on a low budget</a></p>
<p><a  href="http://css-tricks.com/what-beautiful-html-code-looks-like/" target="_blank">What beautiful HTML code looks like</a></p>
<p><a  href="http://www.fivefingercoding.com/xhtml-and-css/how-to-master-tableless-web-design" target="_blank">How to master tableless web design</a></p>
<p><a  href="http://designreviver.com/articles/13-really-useful-online-css-tools-to-streamline-development/" target="_blank">13 really useful online CSS tools to streamline development</a></p>
<p><a  href="http://www.noupe.com/design/ultimate-guide-to-grid-based-web-design.html" target="_blank">Ultimate guide to grid based web design</a></p>
<p><a  href="http://aext.net/2009/11/5-fresh-and-useful-jquery-plugins-you-should-try/" target="_blank">5 fresh and useful jQuery plugins you should try</a></p>
<p><a  href="http://www.splashnology.com/blog/jquery/246.html" target="_blank">jQuery AutoComplete</a></p>
<p><a  href="http://technosailor.com/2009/11/11/10-things-you-need-to-know-about-wordpress-2-9/" target="_blank">10 things you need to know about WordPress 2.9</a></p>
<p><a  href="http://net.tutsplus.com/tutorials/html-css-techniques/20-html-forms-best-practices-for-beginners/" target="_blank">20 HTML forms best practices for beginners</a></p>
<p><a  href="http://webdesignledger.com/tips/10-tips-for-writing-better-css" target="_blank">10 tips for writing better CSS</a></p>
<p><a  href="http://www.vanseodesign.com/css/css-background-property/" target="_blank">CSS background property</a></p>
<p><a  href="http://net.tutsplus.com/tutorials/html-css-techniques/20-html-forms-best-practices-for-beginners/" target="_blank">20 HTML forms best practices for beginners</a></p>
<p><a  href="http://www.sitepoint.com/blogs/2009/11/12/google-closure-how-not-to-write-javascript/" target="_blank">Google closure how not to write Javascript</a></p>
<p><a  href="http://www.sitepoint.com/blogs/2009/11/12/google-open-source-javascript-closure-library/" target="_blank">Google open source Javascript closure library</a></p>
<p><a  href="http://www.bestdesigntuts.com/30-free-online-tools-to-test-your-website/" target="_blank">30 free online tools to test your website</a></p>
<p><a  href="http://screenr.com/IdB" target="_blank">Learn how to Select Anything and Everything with jQuery in 4 Minutes</a></p>
<p><a  href="http://www.dzinepress.com/2009/11/55-decisive-useful-jquery-tutorials/" target="_blank">55 decisive useful jQuery tutorials</a></p>
<div class="addthis_toolbox addthis_default_style addthis_" addthis:url='http://lewayotte.com/2009/11/15/notable-tech-posts-2009-11-15/' addthis:title='Notable Tech Posts &#8211; 2009.11.15 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://lewayotte.com/2009/11/15/notable-tech-posts-2009-11-15/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Notable Tech Posts &#8211; 2009.10.18</title>
		<link>http://lewayotte.com/2009/10/18/notable-tech-posts-2009-10-18/</link>
		<comments>http://lewayotte.com/2009/10/18/notable-tech-posts-2009-10-18/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 03:00:35 +0000</pubDate>
		<dc:creator>Lew</dc:creator>
				<category><![CDATA[Mind]]></category>
		<category><![CDATA[buttons]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[open source]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://lewayotte.com/?p=1278</guid>
		<description><![CDATA[13 excellent open source tools for web designers call to action buttons examples and best practices adding custom google maps to your website 8 ways to make wordpress easier to use for your clients 10 fresh jquery tutorials to enhance navigation menus jquery for absolute beginners video series<div class="addthis_toolbox addthis_default_style addthis_" addthis:url='http://lewayotte.com/2009/10/18/notable-tech-posts-2009-10-18/' addthis:title='Notable Tech Posts &#8211; 2009.10.18 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></description>
			<content:encoded><![CDATA[<p><a  href="http://webdesignledger.com/tools/13-excellent-open-source-tools-for-web-designers" target="_blank">13 excellent open source tools for web designers</a></p>
<p><a  href="http://www.smashingmagazine.com/2009/10/13/call-to-action-buttons-examples-and-best-practices/" target="_blank">call to action buttons examples and best practices</a></p>
<p><a  href="http://stiern.com/tutorials/adding-custom-google-maps-to-your-website" target="_blank">adding custom google maps to your website</a></p>
<p><a  href="http://www.designer-daily.com/8-ways-to-make-wordpress-easier-to-use-for-your-clients-4580" target="_blank">8 ways to make wordpress easier to use for your clients</a></p>
<p><a  href="http://webdesignledger.com/tutorials/10-fresh-jquery-tutorials-to-enhance-navigation-menus" target="_blank">10 fresh jquery tutorials to enhance navigation menus</a></p>
<p><a  href="http://blog.themeforest.net/screencasts/jquery-for-absolute-beginners-video-series/" target="_blank">jquery for absolute beginners video series</a></p>
<div class="addthis_toolbox addthis_default_style addthis_" addthis:url='http://lewayotte.com/2009/10/18/notable-tech-posts-2009-10-18/' addthis:title='Notable Tech Posts &#8211; 2009.10.18 ' ><a class="addthis_button_preferred_1"></a><a class="addthis_button_preferred_2"></a><a class="addthis_button_preferred_3"></a><a class="addthis_button_preferred_4"></a><a class="addthis_button_compact"></a></div>]]></content:encoded>
			<wfw:commentRss>http://lewayotte.com/2009/10/18/notable-tech-posts-2009-10-18/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

