public UserState IsValidUser(string username, string password) { var refServerUri = ServerUri; var userState = PanoramaUtil.ValidateServerAndUser(ref refServerUri, username, password); if (userState == UserState.valid) { ServerUri = refServerUri; } return(userState); }
public void EnsureLogin(Server server) { var refServerUri = server.URI; UserState userState = PanoramaUtil.ValidateServerAndUser(ref refServerUri, server.Username, server.Password); if (userState == UserState.valid) { server.URI = refServerUri; return; } switch (userState) { case UserState.nonvalid: throw new PanoramaServerException(Resources.EditServerDlg_OkDialog_The_username_and_password_could_not_be_authenticated_with_the_panorama_server); case UserState.unknown: throw new PanoramaServerException(string.Format(Resources.EditServerDlg_OkDialog_Unknown_error_connecting_to_the_server__0__, refServerUri.AbsoluteUri)); } }