Index: trunk/extensions/LdapAuthentication/LdapAuthentication.php |
— | — | @@ -860,10 +860,10 @@ |
861 | 861 | } |
862 | 862 | |
863 | 863 | $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; } |
868 | 868 | |
869 | 869 | if ( count( $values ) && LdapAuthenticationPlugin::ldap_modify( $this->ldapconn, $this->userdn, $values ) ) { |
870 | 870 | // We changed the user, we need to invalidate the memcache key |
— | — | @@ -980,8 +980,8 @@ |
981 | 981 | $values["uid"] = $username; |
982 | 982 | // sn is required for objectclass inetorgperson |
983 | 983 | $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; } |
986 | 986 | else { $values["cn"] = $username; } |
987 | 987 | $values["userpassword"] = $pass; |
988 | 988 | $values["objectclass"] = array( "inetorgperson" ); |
— | — | @@ -1058,19 +1058,19 @@ |
1059 | 1059 | |
1060 | 1060 | if ( $this->getConf( 'Preferences' ) ) { |
1061 | 1061 | $this->printDebug( "Setting user preferences.", NONSENSITIVE ); |
1062 | | - if ( $this->lang ) { |
| 1062 | + if ( is_string( $this->lang ) ) { |
1063 | 1063 | $this->printDebug( "Setting language.", NONSENSITIVE ); |
1064 | 1064 | $user->setOption( 'language', $this->lang ); |
1065 | 1065 | } |
1066 | | - if ( $this->nickname ) { |
| 1066 | + if ( is_string( $this->nickname ) ) { |
1067 | 1067 | $this->printDebug( "Setting nickname.", NONSENSITIVE ); |
1068 | 1068 | $user->setOption( 'nickname', $this->nickname ); |
1069 | 1069 | } |
1070 | | - if ( $this->realname ) { |
| 1070 | + if ( is_string( $this->realname ) ) { |
1071 | 1071 | $this->printDebug( "Setting realname.", NONSENSITIVE ); |
1072 | 1072 | $user->setRealName( $this->realname ); |
1073 | 1073 | } |
1074 | | - if ( $this->email ) { |
| 1074 | + if ( is_string( $this->email ) ) { |
1075 | 1075 | $this->printDebug( "Setting email.", NONSENSITIVE ); |
1076 | 1076 | $user->setEmail( $this->email ); |
1077 | 1077 | $user->confirmEmail(); |