From: Nyloth <ny...@ti...> - 2009-05-21 13:23:01
|
Hi sacra, Thank you for your proposal Please note that you first need to commit your changes on trunk and make sure it works there. (see http://dev.tikiwiki.org/Quality+Team) If commited already (or when it will be commited) on trunk, you need to add, in the commit message of your commit on branches/proposed, the revision of the related commit on trunk. So, please reply to this mail and give the trunk revision, needed for the approval process Cheers, Nyloth 2009/5/21 <sa...@us...> > Revision: 18972 > http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=18972&view=rev > Author: sacra > Date: 2009-05-21 13:12:49 +0000 (Thu, 21 May 2009) > > Log Message: > ----------- > [ENH] Adds two more fields to fetch from LDAP to Tiki: country and e-mail > > Modified Paths: > -------------- > branches/proposed/lib/setup/prefs.php > branches/proposed/lib/userslib.php > branches/proposed/templates/tiki-admin-include-login.tpl > branches/proposed/tiki-login.php > > Modified: branches/proposed/lib/setup/prefs.php > =================================================================== > --- branches/proposed/lib/setup/prefs.php 2009-05-21 12:48:17 UTC > (rev 18971) > +++ branches/proposed/lib/setup/prefs.php 2009-05-21 13:12:49 UTC > (rev 18972) > @@ -926,6 +926,8 @@ > 'auth_ldap_adminpass' => '', > 'auth_ldap_version' => 3, > 'auth_ldap_nameattr' => 'displayName', > + 'auth_ldap_countryattr' => '', > + 'auth_ldap_emailattr' => '', > 'https_login' => 'allowed', > 'feature_show_stay_in_ssl_mode' => 'y', > 'feature_switch_ssl_mode' => 'n', > > Modified: branches/proposed/lib/userslib.php > =================================================================== > --- branches/proposed/lib/userslib.php 2009-05-21 12:48:17 UTC (rev 18971) > +++ branches/proposed/lib/userslib.php 2009-05-21 13:12:49 UTC (rev 18972) > @@ -760,6 +760,8 @@ > // attributes to fetch > $options['attributes'] = array(); > if ( $nameattr = $prefs['auth_ldap_nameattr'] ) > $options['attributes'][] = $nameattr; > + if ( $countryattr = $prefs['auth_ldap_countryattr'] ) > $options['attributes'][] = $countryattr; > + if ( $emailattr = $prefs['auth_ldap_emailattr'] ) > $options['attributes'][] = $emailattr; > > // set the Auth options > //$a = new Auth('LDAP', $options, '', false, $user, $pass); > @@ -778,6 +780,9 @@ > case AUTH_LOGIN_OK: > // Retrieve LDAP information to update user data a > bit later (when he will be completely validated or auto-created) > if ( $nameattr != '' ) > $user_ldap_attributes['auth_ldap_nameattr'] = $a->getAuthData($nameattr); > + if ( $countryattr != '' ) > $user_ldap_attributes['auth_ldap_countryattr'] = > $a->getAuthData($countryattr); > + if ( $emailattr != '' ) > $user_ldap_attributes['auth_ldap_emailattr'] = $a->getAuthData($emailattr); > + > return USER_VALID; > > case AUTH_USER_NOT_FOUND: > > Modified: branches/proposed/templates/tiki-admin-include-login.tpl > =================================================================== > --- branches/proposed/templates/tiki-admin-include-login.tpl 2009-05-21 > 12:48:17 UTC (rev 18971) > +++ branches/proposed/templates/tiki-admin-include-login.tpl 2009-05-21 > 13:12:49 UTC (rev 18972) > @@ -400,6 +400,16 @@ > </div> > </div> > <div class="adminoptionbox"> > + <div class="adminoptionlabel"><label > for="auth_ldap_countryattr">{tr}Country attribute{/tr}:</label> > + <input type="text" id="auth_ldap_countryattr" > name="auth_ldap_countryattr" value="{$prefs.auth_ldap_countryattr|escape}" > /> > + </div> > +</div> > +<div class="adminoptionbox"> > + <div class="adminoptionlabel"><label > for="auth_ldap_emailattr">{tr}E-mail attribute{/tr}:</label> > + <input type="text" id="auth_ldap_emailattr" > name="auth_ldap_emailattr" value="{$prefs.auth_ldap_emailattr|escape}" /> > + </div> > +</div> > +<div class="adminoptionbox"> > <div class="adminoptionlabel"><label for="auth_ldap_basedn">{tr}Base > DN{/tr}:</label> > <input type="text" name="auth_ldap_basedn" id="auth_ldap_basedn" > value="{$prefs.auth_ldap_basedn|escape}" /> > </div> > > Modified: branches/proposed/tiki-login.php > =================================================================== > --- branches/proposed/tiki-login.php 2009-05-21 12:48:17 UTC (rev 18971) > +++ branches/proposed/tiki-login.php 2009-05-21 13:12:49 UTC (rev 18972) > @@ -191,10 +191,22 @@ > > // Update some user details from LDAP > if ( is_array($user_ldap_attributes) ) { > - if ( > $user_ldap_attributes['auth_ldap_nameattr'] != '' ) { > + if ( count($user_ldap_attributes) > 0 ) { > global $cachelib, $tikidomain; > > require_once('lib/cache/cachelib.php'); > - > $tikilib->set_user_preference($user, 'realName', > $user_ldap_attributes['auth_ldap_nameattr']); > + > + if( > $user_ldap_attributes['auth_ldap_nameattr'] != '' ) { > + > $tikilib->set_user_preference($user, 'realName', > $user_ldap_attributes['auth_ldap_nameattr']); > + } > + > + if( > $user_ldap_attributes['auth_ldap_countryattr'] != '' ) { > + > $tikilib->set_user_preference($user,'country',$user_ldap_attributes['auth_ldap_countryattr']); > + } > + > + if( > $user_ldap_attributes['auth_ldap_emailattr'] != '' ) { > + > $userlib->change_user_email($user,$user_ldap_attributes['auth_ldap_emailattr'],''); > + } > + > // Erase cache to update displayed > user info > // Do not just invalidate cache > for 'user_details_'.$user and 'userslist', > // since userlink smarty modifier > is also using cache with multiple possibilities of keys. > > > This was sent by the SourceForge.net collaborative development platform, > the world's largest Open Source development site. > > > ------------------------------------------------------------------------------ > Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT > is a gathering of tech-side developers & brand creativity professionals. > Meet > the minds behind Google Creative Lab, Visual Complexity, Processing, & > iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian > Group, R/GA, & Big Spaceship. http://www.creativitycat.com > _______________________________________________ > Tikiwiki-cvs mailing list > Tik...@li... > https://lists.sourceforge.net/lists/listinfo/tikiwiki-cvs > |