/// <summary> /// Event handler for Domain Login COmpleted /// </summary> private void OnDomainLoginCompleted(object o, DomainLoginCompletedArgs args) { if (WaitDialog != null) { WaitDialog.Hide(); WaitDialog.Destroy(); WaitDialog = null; } Status authStatus = args.AuthenticationStatus; if (authStatus != null) { switch (authStatus.statusCode) { case StatusCodes.Success: case StatusCodes.SuccessInGrace: if (LoginDialog != null) { LoginDialog.Hide(); LoginDialog.Destroy(); LoginDialog = null; } // Check if any recovery agent present; // if( domainController.GetRAList(args.DomainID) == null) // { // No recovery agent present; // return; // } ShowClientUpgradeMessageBox(); iFolderWebService ifws = DomainController.GetiFolderService(); int policy = ifws.GetSecurityPolicy(args.DomainID); if (policy % 2 == 0) { break; } bool passphraseStatus = simws.IsPassPhraseSet(args.DomainID); if (passphraseStatus == true) { bool rememberOption = simws.GetRememberOption(args.DomainID); if (rememberOption == false) { ShowVerifyDialog(args.DomainID, simws); } else { Debug.PrintLine(" remember Option true. Checking for passphrase existence"); string passphrasecheck = simws.GetPassPhrase(args.DomainID); if (passphrasecheck == null || passphrasecheck == "") { Debug.PrintLine("BugBug: Passphrase doesn't exist"); ShowVerifyDialog(args.DomainID, simws); } } } else { iFolderWindow.ShowEnterPassPhraseDialog(args.DomainID, simws); } // string[] array = domainController.GetRAList( args.DomainID); iFolderData ifdata = iFolderData.GetData(); ifdata.Refresh(); UpdateWidgetSensitivity(); break; case StatusCodes.InvalidCertificate: DomainInformation dom = domainController.GetDomain(args.DomainID); if (authStatus.UserName != null) { dom.Host = authStatus.UserName; } byte[] byteArray = simws.GetCertificate(dom.Host); System.Security.Cryptography.X509Certificates.X509Certificate cert = new System.Security.Cryptography.X509Certificates.X509Certificate(byteArray); iFolderMsgDialog dialog = new iFolderMsgDialog( null, iFolderMsgDialog.DialogType.Question, iFolderMsgDialog.ButtonSet.YesNo, "", Util.GS("Accept the certificate of this server?"), string.Format(Util.GS("iFolder is unable to verify \"{0}\" as a trusted server. You should examine this server's identity certificate carefully."), dom.Host), cert.ToString(true)); Gdk.Pixbuf certPixbuf = new Gdk.Pixbuf(Util.ImagesPath("ifolder-application-x-x509-ca-cert_48.png")); if (certPixbuf != null && dialog.Image != null) { dialog.Image.Pixbuf = certPixbuf; } int rc = dialog.Run(); dialog.Hide(); dialog.Destroy(); if (rc == -8) // User clicked the Yes button { simws.StoreCertificate(byteArray, dom.Host); LoginDialog.Respond(Gtk.ResponseType.Ok); } else { LoginDialog.Respond(Gtk.ResponseType.Cancel); } break; case StatusCodes.UserAlreadyMoved: LoginDialog.Respond(Gtk.ResponseType.Ok); break; default: Util.ShowLoginError(topLevelWindow, authStatus.statusCode); if (LoginDialog != null) { LoginDialog.Present(); } UpdateDomainStatus(args.DomainID); break; } //UpdateiFolderWindowOnLoginComplete(); } else { Util.ShowLoginError(topLevelWindow, StatusCodes.Unknown); if (LoginDialog != null) { LoginDialog.Present(); } UpdateDomainStatus(args.DomainID); } iFolderWindow ifwin = Util.GetiFolderWindow(); ifwin.UpdateServerInfoForSelectedDomain(); ifwin.UpdateListViewItems(); }