public bool UserPreferencesRequest(ref UserPreferences pref, ref string result) { if (!ProfilesData.GetUserPreferences(ref pref, ref result)) { return(false); } 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; UserPreferencesUpdate(ref pref, ref result); } } 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); } } if (string.IsNullOrEmpty(pref.EMail)) { pref.EMail = "No Email Address On Record"; } return(true); }
public bool UserPreferencesRequest(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.GetUserPreferences(ref pref, ref result)); }