Blog http://www.monarchdigital.com/blog Monarch Digital Blogs en Customized LDAP Integration http://www.monarchdigital.com/blog/2012-01-18/customized-ldap-integration <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>LDAP is hard to get working with your Drupal site. Luckily there is a module that helps with that (as there usually is). Unfortunately the module currently only provides the ability to log in through LDAP. You can not check to see if the user exists in LDAP, and if not, use the Drupal database. Many sites may want this functionality and it is quite easy to add.</p> <p>Please note that all of the code below are HACKS to the ldap_integration module. If you do not feel comfortable hacking modules, do not attempt to write any of this! All of this code was placed in ldapauth.module and inside of the ldapauth_authenticate() function. Also, much of the code below has been slightly modified to remove any information that may cause security implications.</p> <p>The first thing we want to do is ping LDAP for a user. If the user does not exist in active directory, the module will check to see if they are active in the Drupal user database. If the user is active, it will assure that the user does not have any of the roles that LDAP assigns, specifically the employee and the various departmental roles. To start, scroll down the ldapauth_authenticate() function and find the following conditional statement.</p> <p><div class="codeblock geshifilter"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(!(</span><span style="color: #0000BB">$dn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">_ldapauth_auth</span><span style="color: #007700">(</span><span style="color: #0000BB">$name</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$pass</span><span style="color: #007700">)))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;If&nbsp;LDAP&nbsp;authentication&nbsp;fails,&nbsp;use&nbsp;Drupal&nbsp;authentication!<br />&nbsp;&nbsp;</span><span style="color: #007700">}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div></p> <p>This condition runs if LDAP sends back a negative request on the user, meaning it could not find the user in its system. The code placed inside of this conditional statement is quite simple. Grab the information the user submitted through the login form and test it against the Drupal database. The code below will just load the users information if LDAP authentication fails. Comments are place throughout to help understand what is going on.</p> <p><div class="codeblock geshifilter"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;&nbsp;&nbsp;$result&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">db_query</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT&nbsp;name,&nbsp;data&nbsp;FROM&nbsp;{users_table}&nbsp;WHERE&nbsp;name='%s'"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$name</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">$row&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">db_fetch_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$result</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">unserialize</span><span style="color: #007700">(</span><span style="color: #0000BB">$row</span><span style="color: #007700">[</span><span style="color: #DD0000">'data'</span><span style="color: #007700">]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(isset(</span><span style="color: #0000BB">$data</span><span style="color: #007700">[</span><span style="color: #DD0000">'ldap_authentified'</span><span style="color: #007700">])&nbsp;&amp;&amp;&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">[</span><span style="color: #DD0000">'ldap_authentified'</span><span style="color: #007700">]&nbsp;!=&nbsp;</span><span style="color: #0000BB">0</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">drupal_set_message</span><span style="color: #007700">(</span><span style="color: #DD0000">'The&nbsp;LDAP&nbsp;server&nbsp;could&nbsp;not&nbsp;find&nbsp;your&nbsp;user.&nbsp;The&nbsp;LDAP&nbsp;server&nbsp;may&nbsp;be&nbsp;down&nbsp;or&nbsp;the&nbsp;password&nbsp;you&nbsp;entered&nbsp;is&nbsp;incorrect.&nbsp;If&nbsp;the&nbsp;problem&nbsp;persists,&nbsp;please&nbsp;contact&nbsp;the&nbsp;webmaster.'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'error'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;core&nbsp;user_login_name_validate<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(isset(</span><span style="color: #0000BB">$form_values</span><span style="color: #007700">[</span><span style="color: #DD0000">'name'</span><span style="color: #007700">]))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">user_is_blocked</span><span style="color: #007700">(</span><span style="color: #0000BB">$form_values</span><span style="color: #007700">[</span><span style="color: #DD0000">'name'</span><span style="color: #007700">]))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;blocked&nbsp;in&nbsp;user&nbsp;administration<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">form_set_error</span><span style="color: #007700">(</span><span style="color: #DD0000">'name'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'The&nbsp;username&nbsp;%name&nbsp;has&nbsp;not&nbsp;been&nbsp;activated&nbsp;or&nbsp;is&nbsp;blocked.'</span><span style="color: #007700">,&nbsp;array(</span><span style="color: #DD0000">'%name'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$form_values</span><span style="color: #007700">[</span><span style="color: #DD0000">'name'</span><span style="color: #007700">])));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if&nbsp;(</span><span style="color: #0000BB">drupal_is_denied</span><span style="color: #007700">(</span><span style="color: #DD0000">'user'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$form_values</span><span style="color: #007700">[</span><span style="color: #DD0000">'name'</span><span style="color: #007700">]))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;denied&nbsp;by&nbsp;access&nbsp;controls<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">form_set_error</span><span style="color: #007700">(</span><span style="color: #DD0000">'name'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'The&nbsp;name&nbsp;%name&nbsp;is&nbsp;a&nbsp;reserved&nbsp;username.'</span><span style="color: #007700">,&nbsp;array(</span><span style="color: #DD0000">'%name'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$form_values</span><span style="color: #007700">[</span><span style="color: #DD0000">'name'</span><span style="color: #007700">])));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;core&nbsp;user_authenticate<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$account&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">user_load</span><span style="color: #007700">(array(</span><span style="color: #DD0000">'name'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$form_values</span><span style="color: #007700">[</span><span style="color: #DD0000">'name'</span><span style="color: #007700">],&nbsp;</span><span style="color: #DD0000">'status'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span style="color: #0000BB">$account&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;</span><span style="color: #0000BB">drupal_is_denied</span><span style="color: #007700">(</span><span style="color: #DD0000">'mail'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$account</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">mail</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">form_set_error</span><span style="color: #007700">(</span><span style="color: #DD0000">'name'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'The&nbsp;name&nbsp;%name&nbsp;is&nbsp;registered&nbsp;using&nbsp;a&nbsp;reserved&nbsp;e-mail&nbsp;address&nbsp;and&nbsp;therefore&nbsp;could&nbsp;not&nbsp;be&nbsp;logged&nbsp;in.'</span><span style="color: #007700">,&nbsp;array(</span><span style="color: #DD0000">'%name'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$account</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">name</span><span style="color: #007700">)));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Name&nbsp;and&nbsp;pass&nbsp;keys&nbsp;are&nbsp;required.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;The&nbsp;user&nbsp;is&nbsp;about&nbsp;to&nbsp;be&nbsp;logged&nbsp;in,&nbsp;so&nbsp;make&nbsp;sure&nbsp;no&nbsp;error&nbsp;was&nbsp;previously<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;encountered&nbsp;in&nbsp;the&nbsp;validation&nbsp;process.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(!</span><span style="color: #0000BB">form_get_errors</span><span style="color: #007700">()&nbsp;&amp;&amp;&nbsp;!empty(</span><span style="color: #0000BB">$form_values</span><span style="color: #007700">[</span><span style="color: #DD0000">'name'</span><span style="color: #007700">])&nbsp;&amp;&amp;&nbsp;!empty(</span><span style="color: #0000BB">$form_values</span><span style="color: #007700">[</span><span style="color: #DD0000">'pass'</span><span style="color: #007700">])&nbsp;&amp;&amp;&nbsp;</span><span style="color: #0000BB">$account</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$user&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$account</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">user_authenticate_finalize</span><span style="color: #007700">(</span><span style="color: #0000BB">$form_values</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;If&nbsp;a&nbsp;user&nbsp;was&nbsp;logged&nbsp;in&nbsp;this&nbsp;way&nbsp;and&nbsp;not&nbsp;through&nbsp;LDAP,&nbsp;they&nbsp;should&nbsp;only&nbsp;have&nbsp;basic&nbsp;roles.&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Roles&nbsp;are&nbsp;changed&nbsp;in&nbsp;case&nbsp;employees&nbsp;are&nbsp;dropped&nbsp;on&nbsp;the&nbsp;LDAP&nbsp;side,&nbsp;we&nbsp;don't&nbsp;want&nbsp;them&nbsp;to&nbsp;retain&nbsp;the<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;roles&nbsp;on&nbsp;the&nbsp;Drupal&nbsp;side.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if((</span><span style="color: #0000BB">in_array</span><span style="color: #007700">(</span><span style="color: #DD0000">'City&nbsp;Employee'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$user</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">roles</span><span style="color: #007700">)&nbsp;||&nbsp;</span><span style="color: #0000BB">in_array</span><span style="color: #007700">(</span><span style="color: #DD0000">'County&nbsp;Employee'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$user</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">roles</span><span style="color: #007700">))&nbsp;&amp;&amp;&nbsp;!</span><span style="color: #0000BB">in_array</span><span style="color: #007700">(</span><span style="color: #DD0000">'Super&nbsp;User'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$user</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">roles</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$user</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">roles&nbsp;</span><span style="color: #007700">=&nbsp;array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'101'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'authenticated&nbsp;user'</span><span style="color: #007700">,&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;'role_id'&nbsp;=&gt;&nbsp;'role&nbsp;name'<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'102'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'Citizen'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$edit&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">'roles'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$user</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">roles</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$user&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">user_save</span><span style="color: #007700">(</span><span style="color: #0000BB">$user</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$edit</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">watchdog</span><span style="color: #007700">(</span><span style="color: #DD0000">'user'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'User&nbsp;%user&nbsp;was&nbsp;not&nbsp;found&nbsp;through&nbsp;LDAP&nbsp;and&nbsp;their&nbsp;employee&nbsp;roles&nbsp;were&nbsp;revoked.'</span><span style="color: #007700">,&nbsp;array(</span><span style="color: #DD0000">'%user'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$form_values</span><span style="color: #007700">[</span><span style="color: #DD0000">'name'</span><span style="color: #007700">]));&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">$user</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">watchdog</span><span style="color: #007700">(</span><span style="color: #DD0000">'user'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'Login&nbsp;attempt&nbsp;failed&nbsp;for&nbsp;%user.'</span><span style="color: #007700">,&nbsp;array(</span><span style="color: #DD0000">'%user'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$form_values</span><span style="color: #007700">[</span><span style="color: #DD0000">'name'</span><span style="color: #007700">]));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;core&nbsp;user_login_final_validate<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(!</span><span style="color: #0000BB">$user</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">uid</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">form_set_error</span><span style="color: #007700">(</span><span style="color: #DD0000">'name'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Sorry,&nbsp;unrecognized&nbsp;username&nbsp;or&nbsp;password.&nbsp;&lt;a&nbsp;href="@password"&gt;Have&nbsp;you&nbsp;forgotten&nbsp;your&nbsp;password?&lt;/a&gt;'</span><span style="color: #007700">,&nbsp;array(</span><span style="color: #DD0000">'@password'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">url</span><span style="color: #007700">(</span><span style="color: #DD0000">'user/password'</span><span style="color: #007700">))));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;return;<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div></p> <p>Should an employee no longer work at the office, this system will automatically remove the Drupal employee and departmental roles from the website, assuring that the user cannot continue to update website content. In the future, this user id will exclusively be logged in as either a visitor or as an employee through the traditional Drupal authentication system. But what if LDAP authentication doesn't fail? If LDAP auth passes, we still need to make sure they have a Drupal profile. The code below runs if they are in LDAP, but not Drupal</p> <p><div class="codeblock geshifilter"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(!(</span><span style="color: #0000BB">$dn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">_ldapauth_auth</span><span style="color: #007700">(</span><span style="color: #0000BB">$name</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$pass</span><span style="color: #007700">)))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;The&nbsp;code&nbsp;above...<br />&nbsp;&nbsp;</span><span style="color: #007700">}<br />&nbsp;&nbsp;if&nbsp;(!</span><span style="color: #0000BB">$account</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Register&nbsp;this&nbsp;new&nbsp;user.<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">$ldap_user&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">_ldapauth_user_lookup</span><span style="color: #007700">(</span><span style="color: #0000BB">$name</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$ldap_roles&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">unserialize</span><span style="color: #007700">(</span><span style="color: #0000BB">$_ldapauth_ldap</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">roles</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;If&nbsp;mail&nbsp;attribute&nbsp;is&nbsp;missing,&nbsp;set&nbsp;the&nbsp;name&nbsp;as&nbsp;mail.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$init&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$mail&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">key_exists</span><span style="color: #007700">((</span><span style="color: #0000BB">$_ldapauth_ldap</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getOption</span><span style="color: #007700">(</span><span style="color: #DD0000">'mail_attr'</span><span style="color: #007700">)&nbsp;?&nbsp;</span><span style="color: #0000BB">$_ldapauth_ldap</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getOption</span><span style="color: #007700">(</span><span style="color: #DD0000">'mail_attr'</span><span style="color: #007700">)&nbsp;:&nbsp;</span><span style="color: #0000BB">LDAPAUTH_DEFAULT_MAIL_ATTR</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">$ldap_user</span><span style="color: #007700">)&nbsp;?&nbsp;</span><span style="color: #0000BB">$ldap_user</span><span style="color: #007700">[</span><span style="color: #0000BB">$_ldapauth_ldap</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getOption</span><span style="color: #007700">(</span><span style="color: #DD0000">'mail_attr'</span><span style="color: #007700">)][</span><span style="color: #0000BB">0</span><span style="color: #007700">]&nbsp;:&nbsp;</span><span style="color: #0000BB">$name&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #DD0000">'@example.com'</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Check&nbsp;if&nbsp;the&nbsp;e-mail&nbsp;is&nbsp;not&nbsp;denied.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">drupal_is_denied</span><span style="color: #007700">(</span><span style="color: #DD0000">'mail'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$mail</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">form_set_error</span><span style="color: #007700">(</span><span style="color: #DD0000">'name'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'The&nbsp;name&nbsp;%name&nbsp;is&nbsp;registered&nbsp;using&nbsp;a&nbsp;reserved&nbsp;e-mail&nbsp;address&nbsp;and&nbsp;therefore&nbsp;could&nbsp;not&nbsp;be&nbsp;logged&nbsp;in.'</span><span style="color: #007700">,&nbsp;array(</span><span style="color: #DD0000">'%name'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$name</span><span style="color: #007700">)));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Generate&nbsp;a&nbsp;random&nbsp;drupal&nbsp;password.&nbsp;LDAP&nbsp;password&nbsp;will&nbsp;be&nbsp;used&nbsp;anyways.&nbsp;If&nbsp;the&nbsp;Drupal&nbsp;password&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;is&nbsp;guessed&nbsp;somehow&nbsp;it&nbsp;will&nbsp;not&nbsp;matter&nbsp;because&nbsp;it&nbsp;never&nbsp;looks&nbsp;at&nbsp;it.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$pass_new&nbsp;</span><span style="color: #007700">=&nbsp;(</span><span style="color: #0000BB">LDAPAUTH_LOGIN_PROCESS&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">LDAPAUTH_AUTH_EXCLUSIVED&nbsp;</span><span style="color: #007700">||&nbsp;!</span><span style="color: #0000BB">LDAPAUTH_SYNC_PASSWORDS</span><span style="color: #007700">)&nbsp;?&nbsp;</span><span style="color: #0000BB">user_password</span><span style="color: #007700">(</span><span style="color: #0000BB">20</span><span style="color: #007700">)&nbsp;:&nbsp;</span><span style="color: #0000BB">$pass</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Get&nbsp;the&nbsp;rid&nbsp;of&nbsp;the&nbsp;imported&nbsp;role,&nbsp;if&nbsp;any.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$new_dn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">preg_replace</span><span style="color: #007700">(</span><span style="color: #DD0000">'/^[CN=](.*?),/'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">''</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$ldap_user</span><span style="color: #007700">[</span><span style="color: #DD0000">'dn'</span><span style="color: #007700">]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$role_id&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">db_result</span><span style="color: #007700">(</span><span style="color: #0000BB">db_query</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT&nbsp;rid&nbsp;FROM&nbsp;{roles_table}&nbsp;WHERE&nbsp;name&nbsp;=&nbsp;'%s'&nbsp;LIMIT&nbsp;1"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$ldap_roles</span><span style="color: #007700">[</span><span style="color: #0000BB">$new_dn</span><span style="color: #007700">]));<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$userinfo&nbsp;</span><span style="color: #007700">=&nbsp;array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'name'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$name</span><span style="color: #007700">,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'pass'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$pass_new</span><span style="color: #007700">,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'mail'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$mail</span><span style="color: #007700">,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'init'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$init</span><span style="color: #007700">,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'status'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">1</span><span style="color: #007700">,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'authname_ldapauth'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$name</span><span style="color: #007700">,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'ldap_authentified'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">TRUE</span><span style="color: #007700">,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'ldap_dn'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$ldap_user</span><span style="color: #007700">[</span><span style="color: #DD0000">'dn'</span><span style="color: #007700">],&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'ldap_config'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$_ldapauth_ldap</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getOption</span><span style="color: #007700">(</span><span style="color: #DD0000">'sid'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$userinfo</span><span style="color: #007700">[</span><span style="color: #DD0000">'roles'</span><span style="color: #007700">]&nbsp;=&nbsp;array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">DRUPAL_AUTHENTICATED_RID&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'authenticated&nbsp;user'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$role_id&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$ldap_roles</span><span style="color: #007700">[</span><span style="color: #0000BB">$new_dn</span><span style="color: #007700">],<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'102'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'County&nbsp;Employee'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$user&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">user_save</span><span style="color: #007700">(</span><span style="color: #0000BB">null</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$userinfo</span><span style="color: #007700">,&nbsp;array(</span><span style="color: #DD0000">'roles'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$new_roles</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">watchdog</span><span style="color: #007700">(</span><span style="color: #DD0000">'ldapauth'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'New&nbsp;external&nbsp;user&nbsp;%name&nbsp;created&nbsp;from&nbsp;the&nbsp;LDAP&nbsp;server&nbsp;%server.'</span><span style="color: #007700">,&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(</span><span style="color: #DD0000">'%name'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$name</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'%server'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$_ldapauth_ldap</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getOption</span><span style="color: #007700">(</span><span style="color: #DD0000">'name'</span><span style="color: #007700">)),&nbsp;</span><span style="color: #0000BB">WATCHDOG_NOTICE</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">l</span><span style="color: #007700">(</span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'edit'</span><span style="color: #007700">),&nbsp;</span><span style="color: #DD0000">'user/'</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$user</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">uid&nbsp;</span><span style="color: #007700">.</span><span style="color: #DD0000">'/edit'</span><span style="color: #007700">));<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div></p> <p>Now if an LDAP user is authenticated through LDAP and already has a Drupal profile, all we have to do is make sure that the user roles are up to date. For example, if John Somebody leaves the accountant office and joins the IT office, he should no longer have accountant permissions and should be granted IT permissions.</p> <p><div class="codeblock geshifilter"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />&nbsp;&nbsp;</span><span style="color: #007700">else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Login&nbsp;existing&nbsp;user.<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data&nbsp;</span><span style="color: #007700">=&nbsp;array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'ldap_dn'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$dn</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'ldap_config'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$_ldapauth_ldap</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getOption</span><span style="color: #007700">(</span><span style="color: #DD0000">'sid'</span><span style="color: #007700">),<br />&nbsp;&nbsp;&nbsp;&nbsp;);<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$ldap_roles&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">unserialize</span><span style="color: #007700">(</span><span style="color: #0000BB">$_ldapauth_ldap</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">roles</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Gets&nbsp;the&nbsp;correct&nbsp;dn&nbsp;by&nbsp;slicing&nbsp;off&nbsp;the&nbsp;CN&nbsp;portion.&nbsp;Only&nbsp;need&nbsp;OU&nbsp;information<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$new_dn&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">preg_replace</span><span style="color: #007700">(</span><span style="color: #DD0000">'/^[CN=](.*?),/'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">''</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$dn</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;if(!</span><span style="color: #0000BB">in_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$ldap_roles</span><span style="color: #007700">[</span><span style="color: #0000BB">$new_dn</span><span style="color: #007700">],&nbsp;</span><span style="color: #0000BB">$account</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">roles</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;Get&nbsp;the&nbsp;rid&nbsp;of&nbsp;the&nbsp;imported&nbsp;role,&nbsp;if&nbsp;any.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$role_id&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">db_result</span><span style="color: #007700">(</span><span style="color: #0000BB">db_query</span><span style="color: #007700">(</span><span style="color: #DD0000">"SELECT&nbsp;rid&nbsp;FROM&nbsp;{roles_table}&nbsp;WHERE&nbsp;name&nbsp;=&nbsp;'%s'&nbsp;LIMIT&nbsp;1"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$ldap_roles</span><span style="color: #007700">[</span><span style="color: #0000BB">$new_dn</span><span style="color: #007700">]));<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(!empty(</span><span style="color: #0000BB">$role_id</span><span style="color: #007700">))&nbsp;{&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$account</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">roles&nbsp;</span><span style="color: #007700">=&nbsp;array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">DRUPAL_AUTHENTICATED_RID&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'authenticated&nbsp;user'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$role_id&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$ldap_roles</span><span style="color: #007700">[</span><span style="color: #0000BB">$new_dn</span><span style="color: #007700">],<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'102'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'County&nbsp;Employee'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$account</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">roles&nbsp;</span><span style="color: #007700">=&nbsp;array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">DRUPAL_AUTHENTICATED_RID&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'authenticated&nbsp;user'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'102'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #DD0000">'County&nbsp;Employee'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$edit&nbsp;</span><span style="color: #007700">=&nbsp;array(</span><span style="color: #DD0000">'roles'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$account</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">roles</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$account&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">user_save</span><span style="color: #007700">(</span><span style="color: #0000BB">$account</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$edit</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!isset(</span><span style="color: #0000BB">$account</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">ldap_authentified</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #FF8000">//&nbsp;LDAP&nbsp;and&nbsp;local&nbsp;user&nbsp;conflict.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #007700">if&nbsp;(</span><span style="color: #0000BB">LDAPAUTH_LOGIN_CONFLICT&nbsp;</span><span style="color: #007700">==&nbsp;</span><span style="color: #0000BB">LDAPAUTH_CONFLICT_LOG</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">watchdog</span><span style="color: #007700">(</span><span style="color: #DD0000">'ldapauth'</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'LDAP&nbsp;user&nbsp;with&nbsp;DN&nbsp;%dn&nbsp;has&nbsp;a&nbsp;naming&nbsp;conflict&nbsp;with&nbsp;a&nbsp;local&nbsp;drupal&nbsp;user&nbsp;%name'</span><span style="color: #007700">,&nbsp;array(</span><span style="color: #DD0000">'%dn'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$dn</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'%name'&nbsp;</span><span style="color: #007700">=&gt;&nbsp;</span><span style="color: #0000BB">$account</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">name</span><span style="color: #007700">),&nbsp;</span><span style="color: #0000BB">WATCHDOG_ERROR</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">drupal_set_message</span><span style="color: #007700">(</span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'Another&nbsp;user&nbsp;already&nbsp;exists&nbsp;in&nbsp;the&nbsp;system&nbsp;with&nbsp;the&nbsp;same&nbsp;login&nbsp;name.&nbsp;You&nbsp;should&nbsp;contact&nbsp;the&nbsp;system&nbsp;administrator&nbsp;in&nbsp;order&nbsp;to&nbsp;solve&nbsp;this&nbsp;conflict.'</span><span style="color: #007700">),&nbsp;</span><span style="color: #DD0000">'error'</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">[</span><span style="color: #DD0000">'ldap_authentified'</span><span style="color: #007700">]&nbsp;=&nbsp;</span><span style="color: #0000BB">TRUE</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">[</span><span style="color: #DD0000">'authname_ldapauth'</span><span style="color: #007700">]&nbsp;=&nbsp;</span><span style="color: #0000BB">$name</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div></p> <p>Now if LDAP fails, it will use Drupal's database to log the user in. It will act intelligently with roles, making sure they work in sync with the LDAP server. Any users that do not belong to LDAP but are Drupal users will get basic roles.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-3 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Blog Type:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/blog-type/technical" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Technical</a></div></div></div> Tue, 31 Jan 2012 20:28:10 +0000 Bryan Jones 426 at http://www.monarchdigital.com Site Building Track at DrupalCon Denver http://www.monarchdigital.com/blog/2012-01-25/site-building-track-drupalcon-denver <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>As I write this, we are that close to releasing our final schedule for DrupalCon Denver. Believe me, you just can't have enough attention to detail at this point.</p> <p>As I have written previously, DrupalCon Denver has something for everyone, but the flip side of that coin is that each track is targeted to a specific audience. If possible, I intend to highlight each track up until DrupalCon Denver itself.</p> <p><strong>Site Building track.</strong> The <a href="http://denver2012.drupal.org/program/sessions?field_experience_value=All&amp;field_track_value=1&amp;keys=">Site Building track</a> is all about folks who have put together Drupal sites, and can install modules, but aren't necessary comfortable with extensive module development. Frankly, without my staff of great developers, this is where I would spend a major portion of my time.</p> <p><strong>Track chairs.</strong> Each track has both a local and global track chair. Many thanks to our local track co-chairs Lindsay Odgen "<a href="http://drupal.org/user/240280">lindsayo</a>" &amp; Carl Weidemann "<a href="http://drupal.org/user/235047">c4rl</a>". Our global track chair is Allie Micka "<a href="http://drupal.org/user/15091">Allie Micka</a>". Without the hard work of each of these subject matter experts, we wouldn't have this great track. Thanks!</p> <p>The Site Building track is going to give you:</p> <ul><li> <strong>Hope, admiration or simple awe...</strong> The case studies from actual Drupal implementations at Martha Stewart and zagat.com will give real life examples of what you could bring back to your organization.</li> <li> <strong>Real world knowledge... </strong>Want to know how to incorporate media into your site? Want to make your site truly multilingual? Learn from people who have actually done it.</li> <li> <strong>Extend your Drupal implementation... </strong>You've used webform, but have you used it for surveys and data collection? If you grew up with nodes, blocks and context, learn about the power of Panels.</li> <li> <strong>Newest use of technology... </strong>Do you really understand fields and entities? Who doesn't want to build out reuseable site structure (using the Features module)?</li> <li> <strong>Solutions to your common problems...</strong> Love or hate it, website users want WYSIWYG's. Learn best practices for configuring your WYSIWYG.</li> <li> <strong>The ability to scale your site and keep it available...</strong> Learn practical tools and techniques to keep your site up and running smoothly.</li> <li> <strong>The knowledge to move to the latest version... </strong>You've got a Drupal 6 site... What's the best way to get it to D7? Tricks and tips in the Site Building track.</li> </ul><p> </p> <p><strong>What are you going to do now? </strong>Check out all of the details from these Site Building sessions <a href="http://denver2012.drupal.org/program/sessions?field_experience_value=All&amp;field_track_value=1&amp;keys=">here</a>. Then, sign up for DrupalCon <a href="http://denver2012.drupal.org/register">now</a>. Don't forget the <a href="http://denver2012.drupal.org/party">party</a>! If you see me there, please say hello.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-3 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Blog Type:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/blog-type/business" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Business</a></div></div></div> Tue, 24 Jan 2012 22:19:16 +0000 Rick Nashleanas 434 at http://www.monarchdigital.com CSS3Pie http://www.monarchdigital.com/blog/2012-01-24/css3pie <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>CSS3 has become popular with the latest web browser releases and is increasingly being incorporated into web site designs, however, these features do not work in the older versions of Internet Explorer (IE). While we all would love for everyone to upgrade to at least IE9, many people are stuck with IE7 or 8 due to not being able to upgrade to Windows Vista or 7 at this time. CSS3Pie is a library created to help solve the issue of displaying CSS3 properties in IE6-8.</p> <p>CSS3Pie has become a popular library for the display of CSS3 properties. The properties available for use in IE are border-radius, box-shadow, border-image, css3 backgrounds, gradients, and several other properties specific to the CSS3Pie library. We have used several of these properties in creating a Drupal theme from a Photoshop comp.</p> <h3> Border Radius</h3> <p>Let&#39;s start by taking a look at the border-radius property.</p> <p>Examples:</p> <p><div class="geshifilter"><pre class="geshifilter-css">border-radius: 10px; border-radius: 0 10px 0 10px;</pre></div></p> <p>The first example will apply a 10px rounded corner to each corner of the element. The second example will apply only to the upper right and lower left corners. When including four parameters to the property, the ordering is defined as follows:</p> <p><span class="geshifilter"><code class="css geshifilter-css">border-radius: top-left top-right bottom-right bottom-left;</code></span></p> <p>The image below shows the border-radius property in action.</p> <p><img alt="" src="/sites/default/files/border-radius-example_0.png" style="width: 650px; height: 405px; " /></p> <h3> Box Shadow</h3> <p>Box-shadow is another useful property of CSS3.</p> <p>Example:</p> <p><div class="geshifilter"><pre class="geshifilter-css">-webkit-box-shadow:#555 5px 5px 20px; -moz-box-shadow:#555 5px 5px 20px; box-shadow:#555 5px 5px 20px;</pre></div></p> <p>The webkit and moz box-shadow properties are necessary for rendering on firefox, chrome, and safari. The first item is the color of the shadow, represented in hexadecimal notation, and the other three represent the size of the shadow.</p> <p><img alt="" src="/sites/default/files/box-shadow-example_0.png" style="width: 650px; height: 258px; " /></p> <p>The above image displays the use of the box-shadow property surrounding the slideshow element.</p> <h3> Gradients</h3> <p>Gradients are a very popular CSS3 property. An example is:</p> <p><div class="geshifilter"><pre class="geshifilter-css">background:#8b8b8d; background:-webkit-gradient(linear, 0 0, 0 bottom, from(#828183), to(#8b8b8d)); background:-webkit-linear-gradient(#828183, #8b8b8d); background:-moz-linear-gradient(#828183, #8b8b8d); background:-ms-linear-gradient(#828183, #8b8b8d); background:-o-linear-gradient(#828183, #8b8b8d); background:linear-gradient(#828183, #8b8b8d); filter:progid:DXImageTransform.Microsoft.Gradient(startColorStr=#828183, endColorstr=#8b8b8d); -ms-filter:'progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#828183,endColorStr=#8b8b8d)'; -pie-background:linear-gradient(#828183, #8b8b8d);</pre></div></p> <p>It can take quite a lot of CSS code to have gradients render properly across all browsers. Not all browsers support gradients via CSS and each browser implements it differently. Each background line of code above applies gradients to a different browser. The pie-background property is used to apply more complex gradients to IE, such as those including radial gradients or color stops.</p> <p><img alt="" src="/sites/default/files/gradient-example.png" style="width: 520px; height: 77px; " /></p> <p>In the image above, a small gradient is used at the top of the grey box.</p> <h3> Implementing CSS3 Properties Using CSS3 Pie</h3> <p>Up until now, we have shown you how to use a few of the CSS3 properties we have used in our projects. Now, we will take a look at how to apply CSS3Pie to these elements.</p> <p><div class="geshifilter"><pre class="geshifilter-css">#node-43 div.panel-col-top div.inside, div.nav-header { position:relative; behavior:url(&quot;sites/all/themes/ilyb/css/PIE.htc&quot;); }</pre></div></p> <p>The above code is an example implementation of how to include CSS3Pie into your projects. Each element with a CSS3 property is listed, then the additional properties are applied. The behavior property is used to load the CSS3Pie library. Make sure to set the path to the htc file from the web root. The position relative property is used to make sure the bahaviors are applied properly in IE7.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-3 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Blog Type:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/blog-type/technical" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Technical</a></div></div></div> Thu, 19 Jan 2012 20:49:41 +0000 jswainst 431 at http://www.monarchdigital.com Security Through Obscurity http://www.monarchdigital.com/blog/2012-01-13/security-through-obscurity <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>While security through obscurity is often looked down upon, it can really help your site against newbie hackers. By default, Drupal shows files such as CHANGELOG.txt, INSTALL.txt, and README.txt. These files contain information about your current Drupal distribution that could potentially be used to wreak havoc on your site.</p> <p>As a test, type your site name with CHANGELOG.txt as the path. For example <a href="http://www.site-name.com/CHANGELOG.txt">www.site-name.com/CHANGELOG.txt</a>. You will see that this brings up a text file with the current version of your site. A hacker can use this to see if you are on an older version. They can then look up security flaws for the version you are on and use this to start attacking your site.</p> <p>Preventing these files from being shown is quite easy. In your .htaccess file found at your document root, just add these lines:</p> <p> <div class="geshifilter"><pre class="geshifilter-apache">&lt;FilesMatch &quot;^(CHANGELOG|README|INSTALL|MAINTAINERS).*\.txt$&quot;&gt; Deny from All &lt;/FilesMatch&gt;</pre></div><br /> The code will look for any file in the format of the names presented in the regular expression above. This will catch files such as CHANGELOG.txt and also INSTALL.*.txt. While hiding this files will not guarantee site safety, it does give you a little boost against would be hackers.</p> <p></p> <hr /> <p>We would like to thank <a href="http://drupal.org/user/36762">Greggles</a> for contributing the following post: <a href="http://drupalscout.com/knowledge-base/hiding-fact-your-site-runs-drupal-or-fingerprinting-drupal-site">http://drupalscout.com/knowledge-base/hiding-fact-your-site-runs-drupal-or-fingerprinting-drupal-site</a> which gives a much broader aspect to this type of "security".</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-3 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Blog Type:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/blog-type/technical" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Technical</a></div></div></div> Wed, 18 Jan 2012 17:36:13 +0000 Bryan Jones 417 at http://www.monarchdigital.com Blog posts drive traffic http://www.monarchdigital.com/blog/2012-01-17/blog-posts-drive-traffic <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>It is difficult to write blog posts. Frankly, it can be difficult to write, period. Like a doctor suggesting that you should lose weight or exercise, I get the "Yea, I know" response from my general business customers when I suggest that they write regular blog posts.</p> <p>It is not any easier for the folks here at Monarch Digital to write valuable content for our web site. I just wanted to share our Google Analytics when we posted <a href="http://www.monarchdigital.com/blog/2012-01-13/something-everyone-drupalcon-denver">http://www.monarchdigital.com/blog/2012-01-13/something-everyone-drupalcon-denver</a> at about 3 pm on Friday afternoon, January 13. </p> <p class="rtecenter"><img alt="Monarch Digital Analytics" src="/sites/default/files/monarch-blog-post-650.png" style="border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; margin-left: 5px; margin-right: 5px; margin-top: 5px; margin-bottom: 5px; width: 650px; height: 157px; " /></p> <p>Now, most of your posts will not immediately generate huge amounts of traffic to your site. You must nurture or plug into an audience who is genuinely interested in your content and will help promote it for you.</p> <p>OK, enough preaching.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-3 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Blog Type:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/blog-type/business" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Business</a></div></div></div> Sun, 15 Jan 2012 16:48:06 +0000 Rick Nashleanas 421 at http://www.monarchdigital.com Something for Everyone at Drupalcon Denver http://www.monarchdigital.com/blog/2012-01-13/something-everyone-drupalcon-denver <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>To my friends and customers:</p> <p>Along with many people in the Colorado Drupal community, I have been working very hard to bring the very best, from nitty-gritty coding to enterprise web strategy, to <a href="http://denver2012.drupal.org/">Drupalcon Denver</a>. Here, I'm going to tell you why so many of the people I know could hook up with sessions and content that you will be able to immediately use when you return to work. </p> <p><strong>Are you a business person who has a Drupal site or wants perspective on website alternatives?</strong></p> <p class="rteindent1">Whether your background is financial, general business or technical, our Drupal Means Business "conference in a conference" can give you business perspective on best practices in website development and how Drupal fits in that picture. You'll have plenty of time to meet other business professionals to share experiences in website development using Drupal and other technologies.</p> <p class="rteindent1">DMB is a full day of sessions on Thursday, March 22, from 10:30 am to 4 pm at the Colorado Convention Center. Lunch and attendance at the closing session for all of Drupalcon Denver is included. Check it out and sign up <a href="http://denver2012.drupal.org/drupal-means-business">here</a>.</p> <p><strong>You put together a Drupal site, but you're not a heavy duty coder. Now what?</strong></p> <p class="rteindent1">Our Site Building track was constructed for non-coders who configure Drupal sites and manage content. See case studies from Martha Stewart and zagat.com. Learn about incorporating media into your website or using forms as a survey tool. Unlike other, more technical tracks, Site Building is designed to appeal to folks who can configure Drupal and install modules, but not necessarily code complex custom modules. Don't forget about the Business and Strategy track!</p> <p><strong>Do you work for a school, a nonprofit or a governmental organization?</strong></p> <p class="rteindent1">Drupal has become the preferred web technology for education, nonprofits and governmental organizations. (39% of .edu domains run Drupal.) Drupalcon Denver has a dedicated track exclusively for nonprofits, including sessions from CU Boulder, whitehouse.gov, the ACLU, energy.gov and more. You won't find a mor e relevant set of website development sessions directed to your organization anywhere.</p> <p><strong>Are you looking for ecommerce alternatives?</strong></p> <p class="rteindent1">And who isn't? Learn best practices from the leaders in Drupal Commerce, including recurring payments, PCI compliance and more. Again, don't forget about the Business and Strategy track.</p> <p><strong>Do you need to get your site into the mobile world?</strong></p> <p class="rteindent1">"Collaborative Publishing for Every Device" is the conference theme for Drupalcon Denver. If you're not addressing mobile platforms for your site, you're missing massive opportunities. This year's Drupalcon has an entire track on mobile development and strategies.</p> <p><strong>Do you run a Drupal development shop?</strong></p> <p class="rteindent1">The CXO sessions are specifically for you. Huddle with other folks in Drupal development and share problems and challenges.</p> <p><strong>Are you a website designer?</strong></p> <p class="rteindent1">In addition to the theming topics in the mobile track, we have a track focusing on Design and User Experience (UX). Learn about SASS, html 4 S, responsive design and so much more.</p> <p><strong>Are you a heavy-duty sysadmin or php coder?</strong></p> <p class="rteindent1">Then, the coder track is for you. Learn the lastest tips and tricks from the best in the business. Seeing is believing. Check out the coder track <a href="http://denver2012.drupal.org/program/sessions?field_experience_value=All&amp;field_track_value=2&amp;keys=">here</a>.</p> <p><strong>Do you contribute back to the Drupal code base? Would you like to?</strong></p> <p class="rteindent1">Drupal's strongest asset is its passionate community and the contributions it gets back from people like you. Learn how to plug into the wider Drupal community with our <a href="http://denver2012.drupal.org/program/sessions?field_experience_value=All&amp;field_track_value=4&amp;keys=">Community track</a>. If you are already contributing to core Drupal, you probably already know about the Core Conversations track. Also, don't miss the code sprints, where Drupalers work together to improve Drupal right on site.</p> <p>Besides all of this, you will be able to huddle with other folks in Drupal development and share problems, challengs and solutions in BoF (Birds of a Feather) sessions. Someone identifies a topic and folks gather to explore that topic in depth.</p> <p>Looking for training? <a href="http://denver2012.drupal.org/training">Pre-conference training</a> is available Monday, March 19.</p> <p>All work and no play is... well, it's just not good for you. Check out <a href="http://denver2012.drupal.org/party">Tuesday night's party</a>.</p> <p>Here are all the tracks at Drupalcon:</p> <ul><li> <a href="http://denver2012.drupal.org/program/sessions?field_experience_value=All&amp;field_track_value=0&amp;keys=">Commerce</a></li> <li> <a href="http://denver2012.drupal.org/program/sessions?field_experience_value=All&amp;field_track_value=1&amp;keys=">Site Building</a></li> <li> <a href="http://denver2012.drupal.org/program/sessions?field_experience_value=All&amp;field_track_value=2&amp;keys=">Coding and Development</a></li> <li> <a href="http://denver2012.drupal.org/program/sessions?field_experience_value=All&amp;field_track_value=3&amp;keys=">Design and User Experience</a></li> <li> <a href="http://denver2012.drupal.org/program/sessions?field_experience_value=All&amp;field_track_value=4&amp;keys=">Drupal Community</a></li> <li> <a href="http://denver2012.drupal.org/program/sessions?field_experience_value=All&amp;field_track_value=5&amp;keys=">Business and Strategy</a></li> <li> <a href="http://denver2012.drupal.org/program/sessions?field_experience_value=All&amp;field_track_value=6&amp;keys=">Mobile</a></li> <li> <a href="http://denver2012.drupal.org/program/sessions?field_experience_value=All&amp;field_track_value=7&amp;keys=">Nonprofit, Government and Education</a></li> </ul><p>Next step? Sign up <a href="http://denver2012.drupal.org/register">right now</a>. At a minimum, sign up for the <a href="http://denver2012.drupal.org/">Drupalcon Denver newsletter</a>.</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-3 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Blog Type:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/blog-type/business" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Business</a></div></div></div> Fri, 13 Jan 2012 18:14:37 +0000 Rick Nashleanas 418 at http://www.monarchdigital.com Catching up with DrupalCon Denver http://www.monarchdigital.com/blog/2011-12-28/catching-drupalcon-denver <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>I can't believe that I haven't blogged about Drupalcon Denver since November 13. Let me catch you up and tell you what I had <em><strong>meant</strong></em> to blog about.</p> <p>November 17 was the culmination of months of preparation, work, organization and negotiation as we published the first wave of selected Drupalcon Denver sessions. The flurry of activity was crazy. Our chat room conversations were stepping all over one another. Invariably, the folks who were selected to speak thought the track chairs were brilliant and those who were not selected thought we had our head up our.... sleeves.</p> <p><strong>Potential blog post title</strong>: Adding bacon makes everything better, even Drupalcon Denver session selection.</p> <p>I could not ask for a more conscientious group of volunteer track chairs. They were making extremely difficult decisions with the best interests of the community in mind. In some meetings, some people asked for a reason that their session wasn't selected. Thankfully, Jacob Redding explained that the track chairs were just volunteers and to pile on the burden of responding to every track submission would simply make any future track chair volunteers scarce.</p> <p><strong>Potential blog post title</strong>: Volunteer to be a DrupalCon track chair; it won't hurt that badly.</p> <p>There was a natural let-down, more like a deep breath, after the sessions were selected. Things got quiet as all these volunteers tried to catch up on their day jobs after being yanked away in IRC discussions, pm's, Skype calls and emails. At the same time, we all knew that our jobs are not yet complete. Some tracks still have open session slots to be selected by January 11.</p> <p><strong>Potential blog post title</strong>: On second thought, you <em><strong>do</strong></em> want to be a Drupalcon track chair.</p> <p>Part of the reason that I volunteered to be the content manager of Drupalcon Denver and that I excessively document our meeting agendas and minutes is to let future DrupalCon volunteers to know what worked and what didn't work for us. All of this documentation is in an Open Atrium site. I had the pleasure of giving the team lead of Drupalcon Munich, Florian Loretan, and his content manager, Jos Doekbrijder, an introduction to our process in a Skype call along with access to our Open Atrium site.</p> <p><strong>Potential blog post title</strong>: DrupalCon Denver -&gt; an even better DrupalCon Munich.</p> <p>I've had long discussions with Rick Manelius, who is leading the Drupal Means Business event for general business types and CXO's on the Thursday of DrupalCon Denver. "Rick M" (versus "Rick N", i.e. me) have discussed how there are more and more opportunities to plug in volunteers who have a general business background. These opportunities are often not as easy to find and can be rather intimidating to volunteer for. If you are an English major (er, I mean project manager) and Drupal has been good to you, take a deep breath and give back using your unique set of skills.</p> <p><strong>Potential blog post title</strong>: DrupalCon and Drupal itself continues to grow up.</p> <p>Previous: <a href="http://www.monarchdigital.com/blog/2011-11-15/sudo-make-me-drupalcon">Sudo Make me a DrupalCon</a></p> <p> </p> </div></div></div><div class="field field-name-taxonomy-vocabulary-3 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Blog Type:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/blog-type/business" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Business</a></div></div></div> Wed, 28 Dec 2011 21:01:00 +0000 Rick Nashleanas 405 at http://www.monarchdigital.com Sudo Make me a DrupalCon http://www.monarchdigital.com/blog/2011-11-15/sudo-make-me-drupalcon <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>"Sudo make me a DrupalCon." If it were only that simple.</p> <p>Around our house, <a href="http://xkcd.com/149/" target="_blank">"Sudo, make me a sandwich"</a> will always evoke a smile. Unless you know Linux, you don't get it. As Noam Cohen <a href="http://www.nytimes.com/2008/05/26/business/media/26link.html" target="_blank">wrote</a> "Analyzing this joke is like dissecting a frog, it can be done, but the frog dies."</p> <p>"Sudo" is a 'nix command that gives you godlike powers to do anything on the machine you're on. So, around our house, "Sudo do the dishes" commands the respect and demands the attention of the recipient to, hopefully, do the dishes immediately. (Personally, I prefer it when my wife says "Sudo give me a kiss.")</p> <p>In my last DrupalCon Denver post, I was honest about the problems and disagreements among the team and community about the large, strategic decisions in putting on DrupalCon. Of course, this is to be expected among a diverse group of Drupalistas, especially among a group that is as passionate as the Denver team is to put on the best Drupalcon ever. Yet, I'm afraid that my last post might have been, well, depressing.</p> <p>Now that we're looking in our rear view mirror at those controversies, the DrupalCon Denver track chairs are deep into evaluating and selecting sessions. We are having substantive discussions in IRC and on Skype about the current and future state of technologies, businesses, and Drupal. This is the fun stuff!</p> <p>But it is also difficult. We received between 500 and 600 session proposals for 91 slots (not including the 13 slots for core conversations). The importance, relevance and significance of the presentation proposals were amazing, making the track chairs' jobs even more difficult. If I remember correctly, Drupalcon Denver has more session slots than any previous DrupalCon.</p> <p>As the person who is overseeing content, the process of putting on DrupalCon Denver is going well. Not easy, but well. Not as easy as "Sudo make me a DrupalCon", but through the dedicated work of the DrupalCon Team, it looks like DrupalCon Denver will be absolutely awesome.</p> <p>Previous: <a href="http://www.monarchdigital.com/blog/2011-11-04/drupalcon-denver-blood-sweat-and-fears">DrupalCon: Blood, Sweat and Fears</a></p> <p>Next: <a href="http://www.monarchdigital.com/blog/2011-12-28/catching-drupalcon-denver">Catching up with Drupalcon Denver</a></p> </div></div></div><div class="field field-name-taxonomy-vocabulary-3 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Blog Type:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/blog-type/business" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Business</a></div></div></div> Sun, 13 Nov 2011 14:09:30 +0000 Rick Nashleanas 385 at http://www.monarchdigital.com Drupalcon Denver: Blood, Sweat and Fears http://www.monarchdigital.com/blog/2011-11-04/drupalcon-denver-blood-sweat-and-fears <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Here, I've informally taken on the role of documenting the organizational and people-oriented side of putting on a Drupalcon, specifically Drupalcon Denver. I didn't write last week as, well, things were up in the air.</p> <p>From what I understand, every Drupalcon has at least one point in the process where there is a divergence of opinion (I'm trying to be as nice as I can here) and the process is thrown into disarray. I will not air any of our dirty laundry here, but the genesis of most of our problems is that the entire Drupalcon Denver team is extremely passionate about putting on the best event possible. Sometimes, the concept of what is "best" is not shared by everyone. Frankly, I could be talking about contributing code to an open source project.</p> <p>Although online tools serve us all very well, there are just times that nothing will substitute for getting together face to face. Many thanks to Neil Kent from the Drupal Association on flying out from Atlanta to talk this out at a dinner in Denver. However, Neil, next time, could you please pick a time that would not require that we drive back late at night during an early season snowstorm?</p> <p>So, what did we learn?</p> <p><strong>Communications is hard. </strong>Even though the Colorado Drupal community has worked together to put on Drupalcamp Colorado, we've pulled in more volunteers, the Drupal Association is involved and we all prefer different ways of communicating. Without going into details, everyone is now going out of their way to communicate issues and reach out more than ever before. As this is so difficult with volunteers trying to make a living at their day job, I'm sure we will slip again in the near future.</p> <p><strong>No one has the silver bullet.</strong> Each Drupalcon is different. Yet, with our global track chairs and the Drupal Association personnel, we are trying to learn the best ways to put on a Drupalcon without falling into the same holes as the past. Some decisions translate perfectly from one Drupalcon to the next... From one group of volunteer organizers to the next... Some don't.</p> <p><strong>Work. </strong>In my other blog posts, I enthusiastically encouraged you to volunteer to help put on a Drupalcon if you have the opportunity. I still recommend it, but be aware that certain leadership roles can really consume your time. At Monarch, we use Harvest to track our time. I don't really break out my time between Drupalcon and organizing the Southern Colorado User Group, but I've spent 219 hours so far this year working on these two projects. I couldn't do this without my great staff at Monarch. (Thanks James and Bryan.) Things can obviously get tense when business appears to be suffering while Drupalcon tasks are demanding attention. Would I do it again? You bet!</p> <p>We learned much more than just this. But I feel that our group has grown and I hope that the next Drupalcon volunteers will not have the problems we encountered. They will have their own issues. We are all continuing to learn and grow. The <a href="http://www.peace.ca/kindergarten.htm">"All I Needed to Know, I Learned in Kindergarten" rules</a> apply here: Share, play fair, don't hit... We <strong>are</strong> the Drupal community.</p> <p>Previous: <a href="http://www.monarchdigital.com/blog/2011-10-13/submit-your-sessions-drupalcon-denver">Submit your sessions for Drupalcon Denver</a></p> <p>Next: <a href="http://www.monarchdigital.com/blog/2011-11-15/sudo-make-me-drupalcon">Sudo Make me a Drupalcon</a></p> </div></div></div><div class="field field-name-taxonomy-vocabulary-3 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Blog Type:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/blog-type/business" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Business</a></div></div></div> Mon, 31 Oct 2011 22:38:12 +0000 Rick Nashleanas 378 at http://www.monarchdigital.com Drupalcon Denver session submissions close on Wednesday, October 26 http://www.monarchdigital.com/blog/2011-10-20/drupalcon-denver-session-submissions-close-wednesday-october-26 <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Session proposals are still being accepted for the next DrupalCon, being held at the Colorado Convention Center in Denver, March 19 -23, 2012. The conference theme is "Collaborative Publishing for Every Device" and the deadline to submit sessions is October 26, 2011 23:59:59 UTC/GMT -7. <a class="freelinking external" href="http://denver2012.drupal.org/node/add/session" style="color: rgb(2, 122, 198); font-weight: bold; text-decoration: none; ">Submit your session</a> today!</p> <p>DrupalCon Denver will be focusing on 8 significant areas of expertise and of particular interest to Drupal users and developers alike. Preference will be given to session ideas that examine the following tracks and how they relate to the conference theme:</p> <ul style="display: inline-block; "><li style="padding-top: 0.4em; "> Site Building</li> <li style="padding-top: 0.4em; "> Coding and Development</li> <li style="padding-top: 0.4em; "> Design and User Experience</li> <li style="padding-top: 0.4em; "> Drupal Community</li> <li style="padding-top: 0.4em; "> Business Strategy</li> <li style="padding-top: 0.4em; "> Mobile</li> <li style="padding-top: 0.4em; "> Commerce</li> <li style="padding-top: 0.4em; "> Nonprofit, Government and Education</li> </ul><p>These <a class="freelinking external" href="http://denver2012.drupal.org/session-tracks" style="color: rgb(2, 122, 198); font-weight: bold; text-decoration: none; ">session tracks</a> descriptions are available online, so make sure to visit the official <a class="freelinking external" href="http://denver2012.drupal.org/" style="color: rgb(2, 122, 198); font-weight: bold; text-decoration: none; ">DrupalCon Denver website</a> to learn more.</p> <p>Session ideas are posted online as they are submitted - see the <a class="freelinking external" href="http://denver2012.drupal.org/program/sessions/proposed" style="color: rgb(2, 122, 198); font-weight: bold; text-decoration: none; ">list of sessions proposed</a> so far. The final selections picked from all session submissions will be announced on November 16, 2011 and the final DrupalCon Denver schedule will be live on December 7, 2011. Any and all proposals are welcome -- help keep DrupalCon 100% powered by You!</p> </div></div></div><div class="field field-name-taxonomy-vocabulary-3 field-type-taxonomy-term-reference field-label-inline clearfix"><div class="field-label">Blog Type:&nbsp;</div><div class="field-items"><div class="field-item even"><a href="/category/blog-type/business" typeof="skos:Concept" property="rdfs:label skos:prefLabel">Business</a></div></div></div> Thu, 20 Oct 2011 22:27:31 +0000 Rick Nashleanas 364 at http://www.monarchdigital.com