private void updateLinkedClient ( Account account , MultivaluedMap < String , String > data ) { logger . debug ( "checking linked client" ) ; String email = account . getEmailAddress ( ) ; if ( email != null && ! email . equals ( "" ) ) { logger . debug ( "account email is valid" ) ; String username = email . split ( "@" ) [ 0 ] ; Client client = clientDao . getClient ( username , account . getOrganizationSid ( ) ) ; if ( client != null ) { logger . debug ( "client found" ) ; // TODO: need to encrypt this password because it's // same with Account password. // Don't implement now. Opened another issue for it. if ( data . containsKey ( "Password" ) ) { // Md5Hash(data.getFirst("Password")).toString(); logger . debug ( "password changed" ) ; String password = data . getFirst ( "Password" ) ; client = client . setPassword ( client . getLogin ( ) , password , organizationsDao . getOrganization ( account . getOrganizationSid ( ) ) . getDomainName ( ) ) ; } if ( data . containsKey ( "FriendlyName" ) ) { logger . debug ( "friendlyname changed" ) ; client = client . setFriendlyName ( data . getFirst ( "FriendlyName" ) ) ; } logger . debug ( "updating linked client" ) ; clientDao . updateClient ( client ) ; } } }
update SIP client of the corresponding Account . Password and FriendlyName fields are synched .