public bool UserPreferencesUpdate(ref UserPreferences pref, ref string result) { if (string.IsNullOrEmpty(pref.EMail)) { UserAccount account = new UserAccount(); if (userAccounts is UserAccountService.UserAccountService) { try { account = userAccounts.GetUserAccount(UUID.Zero, pref.UserId); if (string.IsNullOrEmpty(account.Email)) { pref.EMail = string.Empty; } else { pref.EMail = account.Email; } } catch { m_log.Error("[PROFILES SERVICE]: UserAccountService Exception: Could not get user account"); result = "UserAccountService settings error in UserProfileService!"; return(false); } } else { m_log.Error("[PROFILES SERVICE]: UserAccountService: Could not get user account"); result = "UserAccountService settings error in UserProfileService!"; return(false); } } return(ProfilesData.UpdateUserPreferences(ref pref, ref result)); }
public bool UserPreferencesUpdate(ref UserPreferences pref, ref string result) { if (string.IsNullOrEmpty(pref.EMail)) { UserAccount account = new UserAccount(); if (userAccounts is UserAccountService.UserAccountService) { try { account = userAccounts.GetUserAccount(UUID.Zero, pref.UserId); if (string.IsNullOrEmpty(account.Email)) { result = "No Email address on record!"; return(false); } else { pref.EMail = account.Email; } } catch { m_log.Info("[PROFILES]: UserAccountService Exception: Could not get user account"); result = "Missing Email address!"; return(false); } } else { m_log.Info("[PROFILES]: UserAccountService: Could not get user account"); result = "Missing Email address!"; return(false); } } return(ProfilesData.UpdateUserPreferences(ref pref, ref result)); }