r108775 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r108774‎ | r108775 | r108776 >
Date:23:02, 12 January 2012
Author:laner
Status:ok
Tags:
Comment:
Follow up to r108101.
Modified paths:
  • /trunk/extensions/LdapAuthentication/LdapAuthentication.php (modified) (history)

Diff [purge]

Index: trunk/extensions/LdapAuthentication/LdapAuthentication.php
@@ -860,10 +860,10 @@
861861 }
862862
863863 $values = array();
864 - if ( '' != $this->email ) { $values["mail"] = $this->email; }
865 - if ( '' != $this->nickname ) { $values["displayname"] = $this->nickname; }
866 - if ( '' != $this->realname ) { $values["cn"] = $this->realname; }
867 - if ( '' != $this->lang ) { $values["preferredlanguage"] = $this->lang; }
 864+ if ( is_string( $this->email ) ) { $values["mail"] = $this->email; }
 865+ if ( is_string( $this->nickname ) ) { $values["displayname"] = $this->nickname; }
 866+ if ( is_string( $this->realname ) ) { $values["cn"] = $this->realname; }
 867+ if ( is_string( $this->lang ) ) { $values["preferredlanguage"] = $this->lang; }
868868
869869 if ( count( $values ) && LdapAuthenticationPlugin::ldap_modify( $this->ldapconn, $this->userdn, $values ) ) {
870870 // We changed the user, we need to invalidate the memcache key
@@ -980,8 +980,8 @@
981981 $values["uid"] = $username;
982982 // sn is required for objectclass inetorgperson
983983 $values["sn"] = $username;
984 - if ( $this->email ) { $values["mail"] = $this->email; }
985 - if ( $this->realname ) { $values["cn"] = $this->realname; }
 984+ if ( is_string( $this->email ) ) { $values["mail"] = $this->email; }
 985+ if ( is_string( $this->realname ) ) { $values["cn"] = $this->realname; }
986986 else { $values["cn"] = $username; }
987987 $values["userpassword"] = $pass;
988988 $values["objectclass"] = array( "inetorgperson" );
@@ -1058,19 +1058,19 @@
10591059
10601060 if ( $this->getConf( 'Preferences' ) ) {
10611061 $this->printDebug( "Setting user preferences.", NONSENSITIVE );
1062 - if ( $this->lang ) {
 1062+ if ( is_string( $this->lang ) ) {
10631063 $this->printDebug( "Setting language.", NONSENSITIVE );
10641064 $user->setOption( 'language', $this->lang );
10651065 }
1066 - if ( $this->nickname ) {
 1066+ if ( is_string( $this->nickname ) ) {
10671067 $this->printDebug( "Setting nickname.", NONSENSITIVE );
10681068 $user->setOption( 'nickname', $this->nickname );
10691069 }
1070 - if ( $this->realname ) {
 1070+ if ( is_string( $this->realname ) ) {
10711071 $this->printDebug( "Setting realname.", NONSENSITIVE );
10721072 $user->setRealName( $this->realname );
10731073 }
1074 - if ( $this->email ) {
 1074+ if ( is_string( $this->email ) ) {
10751075 $this->printDebug( "Setting email.", NONSENSITIVE );
10761076 $user->setEmail( $this->email );
10771077 $user->confirmEmail();

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r108101More code refactoringlaner23:56, 4 January 2012

Status & tagging log