/// <summary> /// Reverts the specified path back to a normal folder. Also remove iFolder / Membership. /// </summary> /// <param name="path">The path to revert back to a normal folder.</param> public void RevertToNormal([MarshalAs(UnmanagedType.LPWStr)] string path) { Cursor.Current = Cursors.WaitCursor; try { connectToWebService(); RevertiFolder revertiFolder = new RevertiFolder(); iFolderWeb ifolder = ifWebService.GetiFolderByLocalPath(path); bool IsMaster = (ifolder.CurrentUserID == ifolder.OwnerID); if (!IsMaster) { revertiFolder.removeFromServer.Text = resourceManager.GetString("AlsoRemoveMembership"); } revertiFolder.removeFromServer.Enabled = simws.GetDomainInformation(ifolder.DomainID).Authenticated; if (revertiFolder.ShowDialog() == DialogResult.Yes) { Cursor.Current = Cursors.WaitCursor; if (ifWebService != null && ifolder != null) { ifWebService.RevertiFolder(ifolder.ID); if (revertiFolder.RemoveFromServer) { if (IsMaster) { ifWebService.DeleteiFolder(ifolder.DomainID, ifolder.ID); } else { ifWebService.DeclineiFolderInvitation(ifolder.DomainID, ifolder.ID); } } } } revertiFolder.Dispose(); } catch (WebException e) { ifWebService = null; if (e.Status == WebExceptionStatus.ProtocolError) { LocalService.ClearCredentials(); } } catch (Exception e) { Cursor.Current = Cursors.Default; Novell.iFolderCom.MyMessageBox mmb = new MyMessageBox(resourceManager.GetString("iFolderRevertError"), resourceManager.GetString("revertErrorTitle"), e.Message, MyMessageBoxButtons.OK, MyMessageBoxIcon.Error); mmb.ShowDialog(); mmb.Dispose(); } Cursor.Current = Cursors.Default; }
/// <summary> /// Authenticate to a remote Simias server /// </summary> /// <returns>Simias.Client.Authentication.Status object</returns> public Status Authenticate(Uri webServiceUri, string simiasDataPath) { Status status = null; try { SimiasWebService simiasSvc = new SimiasWebService(); simiasSvc.Url = webServiceUri.ToString() + "/Simias.asmx"; LocalService.Start(simiasSvc, webServiceUri, simiasDataPath); DomainInformation cInfo = simiasSvc.GetDomainInformation(this.domainID); if (cInfo != null) { // Call Simias for a remote domain authentication status = simiasSvc.LoginToRemoteDomain(this.domainID, this.password); } else { //status = new Status( StatusCodes.UnknownDomain ); } } catch (Exception ex) { // DEBUG if (MyEnvironment.Mono) { Console.WriteLine("Authentication - caught exception: {0}", ex.Message); } //status = new Status( StatusCodes.InternalException ); //status.ExceptionMessage = ex.Message; } return(status); }
private static bool PassphraseHelper( EnterPassPhraseDialog epd, string DomainID, SimiasWebService simws) { bool status = false; int result; do { result = epd.Run(); if(result == (int)ResponseType.Cancel || result == (int) ResponseType.DeleteEvent) { epd.Hide(); return false; } if( epd.PassPhrase != epd.RetypedPassPhrase ) { iFolderMsgDialog dialog = new iFolderMsgDialog( null, iFolderMsgDialog.DialogType.Error, iFolderMsgDialog.ButtonSet.None, Util.GS("passphrase mismatch"), Util.GS("The passphrase and retyped passphrase are not same"), Util.GS("Please enter the passphrase again")); dialog.Run(); dialog.Hide(); dialog.Destroy(); dialog = null; } else { break; } }while( result != (int)ResponseType.Cancel ); if( result != (int)ResponseType.Cancel || result != (int) ResponseType.DeleteEvent) { string publicKey = null; if( epd.RecoveryAgent != null && epd.RecoveryAgent != "Server_Default") { byte [] RACertificateObj = DomainController.GetDomainController().GetRACertificate(DomainID, epd.RecoveryAgent); if( RACertificateObj != null && RACertificateObj.Length != 0) { System.Security.Cryptography.X509Certificates.X509Certificate Cert = new System.Security.Cryptography.X509Certificates.X509Certificate(RACertificateObj); CertificateDialog dlg = new CertificateDialog(Cert.ToString(true)); if (!Util.RegisterModalWindow(dlg)) { dlg.Destroy(); dlg = null; return false; } int res = dlg.Run(); dlg.Hide(); dlg.Destroy(); dlg = null; if( res == (int)ResponseType.Ok) { publicKey = Convert.ToBase64String(Cert.GetPublicKey()); } else { status = false; simws.StorePassPhrase(DomainID, "", CredentialType.None, false); return ShowEnterPassPhraseDialog(DomainID, simws); } } status = SetPassPhrase( epd, DomainID, publicKey, simws ); epd.Hide(); return status; } else { DomainInformation domainInfo = (DomainInformation)simws.GetDomainInformation(DomainID); string memberID = domainInfo.MemberUserID; iFolderWebService ifWebService = DomainController.GetiFolderService(); publicKey = ifWebService.GetDefaultServerPublicKey(DomainID,memberID); status = SetPassPhrase(epd,DomainID,publicKey,simws); epd.Hide(); return status; } } else { epd.Hide(); } return true; }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(EnterPassphraseDialog)); System.ComponentModel.ComponentResourceManager componentResources = new System.ComponentModel.ComponentResourceManager(typeof(EnterPassphraseDialog)); this.panel = new System.Windows.Forms.Panel(); this.pictureBox = new System.Windows.Forms.PictureBox(); this.waterMark = new System.Windows.Forms.PictureBox(); this.RecoveryAgentCombo = new System.Windows.Forms.ComboBox(); this.lblRecoveryAgent = new System.Windows.Forms.Label(); this.Passphrase = new System.Windows.Forms.TextBox(); this.RetypePassphrase = new System.Windows.Forms.TextBox(); this.lblPassphrase = new System.Windows.Forms.Label(); this.lblRetypePassphrase = new System.Windows.Forms.Label(); this.savePassphrase = new System.Windows.Forms.CheckBox(); this.btnCancel = new System.Windows.Forms.Button(); this.btnOk = new System.Windows.Forms.Button(); this.lblDomainName = new System.Windows.Forms.Label(); this.lblDomainValue = new System.Windows.Forms.Label(); this.panel.SuspendLayout(); this.strSize = new SizeF(); this.SuspendLayout(); Graphics graphics = CreateGraphics(); // // panel // this.panel.AccessibleDescription = resources.GetString("panel1.AccessibleDescription"); this.panel.AccessibleName = resources.GetString("panel1.AccessibleName"); this.panel.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("panel1.Anchor"))); this.panel.AutoScroll = ((bool)(resources.GetObject("panel1.AutoScroll"))); this.panel.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("panel1.AutoScrollMargin"))); this.panel.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("panel1.AutoScrollMinSize"))); this.panel.BackColor = System.Drawing.Color.Transparent; this.panel.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("panel1.BackgroundImage"))); this.panel.Controls.Add(this.pictureBox); this.panel.Controls.Add(this.waterMark); this.panel.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("panel1.Dock"))); this.panel.Enabled = ((bool)(resources.GetObject("panel1.Enabled"))); this.panel.Font = ((System.Drawing.Font)(resources.GetObject("panel1.Font"))); this.panel.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("panel1.ImeMode"))); this.panel.Location = ((System.Drawing.Point)(resources.GetObject("panel1.Location"))); this.panel.Name = "panel1"; this.panel.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("panel1.RightToLeft"))); this.panel.Size = ((System.Drawing.Size)(resources.GetObject("panel1.Size"))); this.panel.TabIndex = ((int)(resources.GetObject("panel1.TabIndex"))); this.panel.Text = resources.GetString("panel1.Text"); this.panel.Visible = ((bool)(resources.GetObject("panel1.Visible"))); // // pictureBox // this.pictureBox.AccessibleDescription = resources.GetString("pictureBox1.AccessibleDescription"); this.pictureBox.AccessibleName = resources.GetString("pictureBox1.AccessibleName"); this.pictureBox.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("pictureBox1.Anchor"))); this.pictureBox.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.BackgroundImage"))); this.pictureBox.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("pictureBox1.Dock"))); this.pictureBox.Enabled = ((bool)(resources.GetObject("pictureBox1.Enabled"))); this.pictureBox.Font = ((System.Drawing.Font)(resources.GetObject("pictureBox1.Font"))); this.pictureBox.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); this.pictureBox.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("pictureBox1.ImeMode"))); this.pictureBox.Location = ((System.Drawing.Point)(resources.GetObject("pictureBox1.Location"))); this.pictureBox.Name = "pictureBox1"; this.pictureBox.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("pictureBox1.RightToLeft"))); this.pictureBox.Size = ((System.Drawing.Size)(resources.GetObject("pictureBox1.Size"))); this.pictureBox.SizeMode = ((System.Windows.Forms.PictureBoxSizeMode)(resources.GetObject("pictureBox1.SizeMode"))); this.pictureBox.TabIndex = ((int)(resources.GetObject("pictureBox1.TabIndex"))); this.pictureBox.TabStop = false; this.pictureBox.Text = resources.GetString("pictureBox1.Text"); this.pictureBox.Visible = ((bool)(resources.GetObject("pictureBox1.Visible"))); // // waterMark // this.waterMark.AccessibleDescription = resources.GetString("waterMark.AccessibleDescription"); this.waterMark.AccessibleName = resources.GetString("waterMark.AccessibleName"); this.waterMark.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("waterMark.Anchor"))); this.waterMark.BackColor = System.Drawing.Color.Transparent; this.waterMark.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("waterMark.BackgroundImage"))); this.waterMark.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("waterMark.Dock"))); this.waterMark.Enabled = ((bool)(resources.GetObject("waterMark.Enabled"))); this.waterMark.Font = ((System.Drawing.Font)(resources.GetObject("waterMark.Font"))); this.waterMark.Image = ((System.Drawing.Image)(resources.GetObject("waterMark.Image"))); this.waterMark.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("waterMark.ImeMode"))); this.waterMark.Location = ((System.Drawing.Point)(resources.GetObject("waterMark.Location"))); this.waterMark.Name = "waterMark"; this.waterMark.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("waterMark.RightToLeft"))); this.waterMark.Size = ((System.Drawing.Size)(resources.GetObject("waterMark.Size"))); this.waterMark.SizeMode = ((System.Windows.Forms.PictureBoxSizeMode)(resources.GetObject("waterMark.SizeMode"))); this.waterMark.TabIndex = ((int)(resources.GetObject("waterMark.TabIndex"))); this.waterMark.TabStop = false; this.waterMark.Text = resources.GetString("waterMark.Text"); this.waterMark.Visible = ((bool)(resources.GetObject("waterMark.Visible"))); // // lblDomainName // componentResources.ApplyResources(this.lblDomainName, "lblDomainName"); this.lblDomainName.Name = "lblDomainName"; // // lblDomainValue // componentResources.ApplyResources(this.lblDomainValue, "lblDomainValue"); this.lblDomainValue.Name = "lblDomainValue"; DomainInformation info = simws.GetDomainInformation(DomainID); this.lblDomainValue.Text = info.Name + " (" + info.Host + ")"; this.strSize = graphics.MeasureString(this.lblDomainValue.Text, this.lblDomainValue.Font); this.lblDomainValue.Size = new System.Drawing.Size(this.maxTextWidth, ((int)this.strSize.Width / this.maxTextWidth + 1) * 16); // // lblRecoveryAgent // this.lblRecoveryAgent.AccessibleDescription = resources.GetString("lblRecoveryAgent.AccessibleDescription"); this.lblRecoveryAgent.AccessibleName = resources.GetString("lblRecoveryAgent.AccessibleName"); this.lblRecoveryAgent.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblRecoveryAgent.Anchor"))); this.lblRecoveryAgent.AutoSize = ((bool)(resources.GetObject("lblRecoveryAgent.AutoSize"))); this.lblRecoveryAgent.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblRecoveryAgent.Dock"))); this.lblRecoveryAgent.Enabled = ((bool)(resources.GetObject("lblRecoveryAgent.Enabled"))); this.lblRecoveryAgent.Font = ((System.Drawing.Font)(resources.GetObject("lblRecoveryAgent.Font"))); this.lblRecoveryAgent.Image = ((System.Drawing.Image)(resources.GetObject("lblRecoveryAgent.Image"))); this.lblRecoveryAgent.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblRecoveryAgent.ImageAlign"))); this.lblRecoveryAgent.ImageIndex = ((int)(resources.GetObject("lblRecoveryAgent.ImageIndex"))); this.lblRecoveryAgent.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblRecoveryAgent.ImeMode"))); this.lblRecoveryAgent.Name = "lblRecoveryAgent"; this.lblRecoveryAgent.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblRecoveryAgent.RightToLeft"))); this.lblRecoveryAgent.Size = ((System.Drawing.Size)(resources.GetObject("lblRecoveryAgent.Size"))); this.lblRecoveryAgent.TabIndex = ((int)(resources.GetObject("lblRecoveryAgent.TabIndex"))); this.lblRecoveryAgent.Text = resources.GetString("lblRecoveryAgent.Text"); this.lblRecoveryAgent.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblRecoveryAgent.TextAlign"))); this.lblRecoveryAgent.Visible = ((bool)(resources.GetObject("lblRecoveryAgent.Visible"))); this.lblRecoveryAgent.Location = new System.Drawing.Point(this.defaultNameXPos, this.lblDomainName.Location.Y + this.lblDomainValue.Size.Height + this.defaultSpacing); // // RecoveryAgentCombo // this.RecoveryAgentCombo.AccessibleDescription = resources.GetString("RecoveryAgentCombo.AccessibleDescription"); this.RecoveryAgentCombo.AccessibleName = resources.GetString("RecoveryAgentCombo.AccessibleName"); this.RecoveryAgentCombo.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("RecoveryAgentCombo.Anchor"))); this.RecoveryAgentCombo.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("RecoveryAgentCombo.BackgroundImage"))); this.RecoveryAgentCombo.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("RecoveryAgentCombo.Dock"))); this.RecoveryAgentCombo.Enabled = ((bool)(resources.GetObject("RecoveryAgentCombo.Enabled"))); this.RecoveryAgentCombo.Font = ((System.Drawing.Font)(resources.GetObject("RecoveryAgentCombo.Font"))); this.RecoveryAgentCombo.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("RecoveryAgentCombo.ImeMode"))); this.RecoveryAgentCombo.IntegralHeight = ((bool)(resources.GetObject("RecoveryAgentCombo.IntegralHeight"))); this.RecoveryAgentCombo.ItemHeight = ((int)(resources.GetObject("RecoveryAgentCombo.ItemHeight"))); this.RecoveryAgentCombo.MaxDropDownItems = ((int)(resources.GetObject("RecoveryAgentCombo.MaxDropDownItems"))); this.RecoveryAgentCombo.MaxLength = ((int)(resources.GetObject("RecoveryAgentCombo.MaxLength"))); this.RecoveryAgentCombo.Name = "RecoveryAgentCombo"; this.RecoveryAgentCombo.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("RecoveryAgentCombo.RightToLeft"))); this.RecoveryAgentCombo.Size = ((System.Drawing.Size)(resources.GetObject("RecoveryAgentCombo.Size"))); this.RecoveryAgentCombo.TabIndex = ((int)(resources.GetObject("RecoveryAgentCombo.TabIndex"))); this.RecoveryAgentCombo.Text = resources.GetString("RecoveryAgentCombo.Text"); this.RecoveryAgentCombo.Visible = ((bool)(resources.GetObject("RecoveryAgentCombo.Visible"))); this.RecoveryAgentCombo.Location = new System.Drawing.Point(this.defaultValueXPos, this.lblRecoveryAgent.Location.Y); // // lblPassphrase // this.lblPassphrase.AccessibleDescription = resources.GetString("lblPassphrase.AccessibleDescription"); this.lblPassphrase.AccessibleName = resources.GetString("lblPassphrase.AccessibleName"); this.lblPassphrase.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblPassphrase.Anchor"))); this.lblPassphrase.AutoSize = ((bool)(resources.GetObject("lblPassphrase.AutoSize"))); this.lblPassphrase.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblPassphrase.Dock"))); this.lblPassphrase.Enabled = ((bool)(resources.GetObject("lblPassphrase.Enabled"))); this.lblPassphrase.Font = ((System.Drawing.Font)(resources.GetObject("lblPassphrase.Font"))); this.lblPassphrase.Image = ((System.Drawing.Image)(resources.GetObject("lblPassphrase.Image"))); this.lblPassphrase.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblPassphrase.ImageAlign"))); this.lblPassphrase.ImageIndex = ((int)(resources.GetObject("lblPassphrase.ImageIndex"))); this.lblPassphrase.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblPassphrase.ImeMode"))); this.lblPassphrase.Name = "lblPassphrase"; this.lblPassphrase.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblPassphrase.RightToLeft"))); this.lblPassphrase.Size = ((System.Drawing.Size)(resources.GetObject("lblPassphrase.Size"))); this.lblPassphrase.TabIndex = ((int)(resources.GetObject("lblPassphrase.TabIndex"))); this.lblPassphrase.Text = resources.GetString("lblPassphrase.Text"); this.lblPassphrase.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblPassphrase.TextAlign"))); this.lblPassphrase.Visible = ((bool)(resources.GetObject("lblPassphrase.Visible"))); this.lblPassphrase.Location = new System.Drawing.Point(this.defaultNameXPos, this.lblRecoveryAgent.Location.Y + this.lblRecoveryAgent.Size.Height + this.defaultSpacing); // // Passphrase // this.Passphrase.AccessibleDescription = resources.GetString("Passphrase.AccessibleDescription"); this.Passphrase.AccessibleName = resources.GetString("Passphrase.AccessibleName"); this.Passphrase.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("Passphrase.Anchor"))); this.Passphrase.AutoSize = ((bool)(resources.GetObject("Passphrase.AutoSize"))); this.Passphrase.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("Passphrase.BackgroundImage"))); this.Passphrase.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("Passphrase.Dock"))); this.Passphrase.Enabled = ((bool)(resources.GetObject("Passphrase.Enabled"))); this.Passphrase.Font = ((System.Drawing.Font)(resources.GetObject("Passphrase.Font"))); this.Passphrase.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("Passphrase.ImeMode"))); this.Passphrase.MaxLength = ((int)(resources.GetObject("Passphrase.MaxLength"))); this.Passphrase.Multiline = ((bool)(resources.GetObject("Passphrase.Multiline"))); this.Passphrase.Name = "Passphrase"; this.Passphrase.PasswordChar = ((char)(resources.GetObject("Passphrase.PasswordChar"))); this.Passphrase.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("Passphrase.RightToLeft"))); this.Passphrase.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("Passphrase.ScrollBars"))); this.Passphrase.Size = ((System.Drawing.Size)(resources.GetObject("Passphrase.Size"))); this.Passphrase.TabIndex = ((int)(resources.GetObject("Passphrase.TabIndex"))); this.Passphrase.Text = resources.GetString("Passphrase.Text"); this.Passphrase.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("Passphrase.TextAlign"))); this.Passphrase.Visible = ((bool)(resources.GetObject("Passphrase.Visible"))); this.Passphrase.WordWrap = ((bool)(resources.GetObject("Passphrase.WordWrap"))); this.Passphrase.TextChanged += new System.EventHandler(this.Passphrase_TextChanged); this.Passphrase.Location = new System.Drawing.Point(this.defaultValueXPos, this.lblPassphrase.Location.Y); // // lblRetypePassphrase // this.lblRetypePassphrase.AccessibleDescription = resources.GetString("lblRetypePassphrase.AccessibleDescription"); this.lblRetypePassphrase.AccessibleName = resources.GetString("lblRetypePassphrase.AccessibleName"); this.lblRetypePassphrase.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("lblRetypePassphrase.Anchor"))); this.lblRetypePassphrase.AutoSize = ((bool)(resources.GetObject("lblRetypePassphrase.AutoSize"))); this.lblRetypePassphrase.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("lblRetypePassphrase.Dock"))); this.lblRetypePassphrase.Enabled = ((bool)(resources.GetObject("lblRetypePassphrase.Enabled"))); this.lblRetypePassphrase.Font = ((System.Drawing.Font)(resources.GetObject("lblRetypePassphrase.Font"))); this.lblRetypePassphrase.Image = ((System.Drawing.Image)(resources.GetObject("lblRetypePassphrase.Image"))); this.lblRetypePassphrase.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblRetypePassphrase.ImageAlign"))); this.lblRetypePassphrase.ImageIndex = ((int)(resources.GetObject("lblRetypePassphrase.ImageIndex"))); this.lblRetypePassphrase.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("lblRetypePassphrase.ImeMode"))); this.lblRetypePassphrase.Name = "lblRetypePassphrase"; this.lblRetypePassphrase.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("lblRetypePassphrase.RightToLeft"))); this.lblRetypePassphrase.Size = ((System.Drawing.Size)(resources.GetObject("lblRetypePassphrase.Size"))); this.lblRetypePassphrase.TabIndex = ((int)(resources.GetObject("lblRetypePassphrase.TabIndex"))); this.lblRetypePassphrase.Text = resources.GetString("lblRetypePassphrase.Text"); this.lblRetypePassphrase.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("lblRetypePassphrase.TextAlign"))); this.lblRetypePassphrase.Visible = ((bool)(resources.GetObject("lblRetypePassphrase.Visible"))); this.lblRetypePassphrase.Location = new System.Drawing.Point(this.defaultNameXPos, this.lblPassphrase.Location.Y + this.lblPassphrase.Size.Height + this.defaultSpacing); // // RetypePassphrase // this.RetypePassphrase.AccessibleDescription = resources.GetString("RetypePassphrase.AccessibleDescription"); this.RetypePassphrase.AccessibleName = resources.GetString("RetypePassphrase.AccessibleName"); this.RetypePassphrase.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("RetypePassphrase.Anchor"))); this.RetypePassphrase.AutoSize = ((bool)(resources.GetObject("RetypePassphrase.AutoSize"))); this.RetypePassphrase.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("RetypePassphrase.BackgroundImage"))); this.RetypePassphrase.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("RetypePassphrase.Dock"))); this.RetypePassphrase.Enabled = ((bool)(resources.GetObject("RetypePassphrase.Enabled"))); this.RetypePassphrase.Font = ((System.Drawing.Font)(resources.GetObject("RetypePassphrase.Font"))); this.RetypePassphrase.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("RetypePassphrase.ImeMode"))); this.RetypePassphrase.MaxLength = ((int)(resources.GetObject("RetypePassphrase.MaxLength"))); this.RetypePassphrase.Multiline = ((bool)(resources.GetObject("RetypePassphrase.Multiline"))); this.RetypePassphrase.Name = "RetypePassphrase"; this.RetypePassphrase.PasswordChar = ((char)(resources.GetObject("RetypePassphrase.PasswordChar"))); this.RetypePassphrase.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("RetypePassphrase.RightToLeft"))); this.RetypePassphrase.ScrollBars = ((System.Windows.Forms.ScrollBars)(resources.GetObject("RetypePassphrase.ScrollBars"))); this.RetypePassphrase.Size = ((System.Drawing.Size)(resources.GetObject("RetypePassphrase.Size"))); this.RetypePassphrase.TabIndex = ((int)(resources.GetObject("RetypePassphrase.TabIndex"))); this.RetypePassphrase.Text = resources.GetString("RetypePassphrase.Text"); this.RetypePassphrase.TextAlign = ((System.Windows.Forms.HorizontalAlignment)(resources.GetObject("RetypePassphrase.TextAlign"))); this.RetypePassphrase.Visible = ((bool)(resources.GetObject("RetypePassphrase.Visible"))); this.RetypePassphrase.WordWrap = ((bool)(resources.GetObject("RetypePassphrase.WordWrap"))); this.RetypePassphrase.TextChanged += new System.EventHandler(this.RetypePassphrase_TextChanged); this.RetypePassphrase.Location = new System.Drawing.Point(this.defaultValueXPos, this.lblRetypePassphrase.Location.Y); // // savePassphrase // this.savePassphrase.AccessibleDescription = resources.GetString("savePassphrase.AccessibleDescription"); this.savePassphrase.AccessibleName = resources.GetString("savePassphrase.AccessibleName"); this.savePassphrase.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("savePassphrase.Anchor"))); this.savePassphrase.Appearance = ((System.Windows.Forms.Appearance)(resources.GetObject("savePassphrase.Appearance"))); this.savePassphrase.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("savePassphrase.BackgroundImage"))); this.savePassphrase.CheckAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("savePassphrase.CheckAlign"))); this.savePassphrase.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("savePassphrase.Dock"))); this.savePassphrase.Enabled = ((bool)(resources.GetObject("savePassphrase.Enabled"))); this.savePassphrase.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("savePassphrase.FlatStyle"))); this.savePassphrase.Font = ((System.Drawing.Font)(resources.GetObject("savePassphrase.Font"))); this.savePassphrase.Image = ((System.Drawing.Image)(resources.GetObject("savePassphrase.Image"))); this.savePassphrase.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("savePassphrase.ImageAlign"))); this.savePassphrase.ImageIndex = ((int)(resources.GetObject("savePassphrase.ImageIndex"))); this.savePassphrase.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("savePassphrase.ImeMode"))); this.savePassphrase.Location = new System.Drawing.Point(this.defaultValueXPos, this.RetypePassphrase.Location.Y + this.RetypePassphrase.Size.Height + this.defaultSpacing); this.savePassphrase.Name = "savePassphrase"; this.savePassphrase.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("savePassphrase.RightToLeft"))); this.savePassphrase.Size = ((System.Drawing.Size)(resources.GetObject("savePassphrase.Size"))); this.savePassphrase.TabIndex = ((int)(resources.GetObject("savePassphrase.TabIndex"))); this.savePassphrase.Text = resources.GetString("savePassphrase.Text"); this.savePassphrase.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("savePassphrase.TextAlign"))); this.savePassphrase.Visible = ((bool)(resources.GetObject("savePassphrase.Visible"))); // // btnCancel // this.btnCancel.AccessibleDescription = resources.GetString("btnCancel.AccessibleDescription"); this.btnCancel.AccessibleName = resources.GetString("btnCancel.AccessibleName"); this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnCancel.Anchor"))); this.btnCancel.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnCancel.BackgroundImage"))); this.btnCancel.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnCancel.Dock"))); this.btnCancel.Enabled = ((bool)(resources.GetObject("btnCancel.Enabled"))); this.btnCancel.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnCancel.FlatStyle"))); this.btnCancel.Font = ((System.Drawing.Font)(resources.GetObject("btnCancel.Font"))); this.btnCancel.Image = ((System.Drawing.Image)(resources.GetObject("btnCancel.Image"))); this.btnCancel.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnCancel.ImageAlign"))); this.btnCancel.ImageIndex = ((int)(resources.GetObject("btnCancel.ImageIndex"))); this.btnCancel.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnCancel.ImeMode"))); this.btnCancel.Location = ((System.Drawing.Point)(resources.GetObject("btnCancel.Location"))); this.btnCancel.Location = new System.Drawing.Point(this.btnCancel.Location.X, this.savePassphrase.Location.Y + this.savePassphrase.Size.Height + this.defaultSpacing); this.btnCancel.Name = "btnCancel"; this.btnCancel.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnCancel.RightToLeft"))); this.btnCancel.Size = ((System.Drawing.Size)(resources.GetObject("btnCancel.Size"))); this.btnCancel.TabIndex = ((int)(resources.GetObject("btnCancel.TabIndex"))); this.btnCancel.Text = resources.GetString("btnCancel.Text"); this.btnCancel.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnCancel.TextAlign"))); this.btnCancel.Visible = ((bool)(resources.GetObject("btnCancel.Visible"))); this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); // // btnOk // this.btnOk.AccessibleDescription = resources.GetString("btnOk.AccessibleDescription"); this.btnOk.AccessibleName = resources.GetString("btnOk.AccessibleName"); this.btnOk.Anchor = ((System.Windows.Forms.AnchorStyles)(resources.GetObject("btnOk.Anchor"))); this.btnOk.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("btnOk.BackgroundImage"))); this.btnOk.Dock = ((System.Windows.Forms.DockStyle)(resources.GetObject("btnOk.Dock"))); this.btnOk.Enabled = ((bool)(resources.GetObject("btnOk.Enabled"))); this.btnOk.FlatStyle = ((System.Windows.Forms.FlatStyle)(resources.GetObject("btnOk.FlatStyle"))); this.btnOk.Font = ((System.Drawing.Font)(resources.GetObject("btnOk.Font"))); this.btnOk.Image = ((System.Drawing.Image)(resources.GetObject("btnOk.Image"))); this.btnOk.ImageAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnOk.ImageAlign"))); this.btnOk.ImageIndex = ((int)(resources.GetObject("btnOk.ImageIndex"))); this.btnOk.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("btnOk.ImeMode"))); this.btnOk.Location = ((System.Drawing.Point)(resources.GetObject("btnOk.Location"))); this.btnOk.Location = new System.Drawing.Point(this.btnOk.Location.X, this.savePassphrase.Location.Y + this.savePassphrase.Size.Height + this.defaultSpacing); this.btnOk.Name = "btnOk"; this.btnOk.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("btnOk.RightToLeft"))); this.btnOk.Size = ((System.Drawing.Size)(resources.GetObject("btnOk.Size"))); this.btnOk.TabIndex = ((int)(resources.GetObject("btnOk.TabIndex"))); this.btnOk.Text = resources.GetString("btnOk.Text"); this.btnOk.TextAlign = ((System.Drawing.ContentAlignment)(resources.GetObject("btnOk.TextAlign"))); this.btnOk.Visible = ((bool)(resources.GetObject("btnOk.Visible"))); this.btnOk.Click += new System.EventHandler(this.btnOk_Click); // // EnterPassphraseDialog // this.AccessibleDescription = resources.GetString("$this.AccessibleDescription"); this.AccessibleName = resources.GetString("$this.AccessibleName"); this.AutoScaleBaseSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScaleBaseSize"))); this.AutoScroll = ((bool)(resources.GetObject("$this.AutoScroll"))); this.AutoScrollMargin = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMargin"))); this.AutoScrollMinSize = ((System.Drawing.Size)(resources.GetObject("$this.AutoScrollMinSize"))); this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage"))); this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize"))); this.Controls.Add(this.btnOk); this.Controls.Add(this.lblDomainValue); this.Controls.Add(this.lblDomainName); this.Controls.Add(this.btnCancel); this.Controls.Add(this.savePassphrase); this.Controls.Add(this.lblRetypePassphrase); this.Controls.Add(this.lblPassphrase); this.Controls.Add(this.RetypePassphrase); this.Controls.Add(this.Passphrase); this.Controls.Add(this.lblRecoveryAgent); this.Controls.Add(this.RecoveryAgentCombo); this.Controls.Add(this.panel); this.AcceptButton = this.btnOk; this.Enabled = ((bool)(resources.GetObject("$this.Enabled"))); this.Font = ((System.Drawing.Font)(resources.GetObject("$this.Font"))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.ImeMode = ((System.Windows.Forms.ImeMode)(resources.GetObject("$this.ImeMode"))); this.Location = ((System.Drawing.Point)(resources.GetObject("$this.Location"))); this.MaximizeBox = false; this.MaximumSize = ((System.Drawing.Size)(resources.GetObject("$this.MaximumSize"))); this.MinimumSize = ((System.Drawing.Size)(resources.GetObject("$this.MinimumSize"))); this.ClientSize = ((System.Drawing.Size)(resources.GetObject("$this.ClientSize"))); this.ClientSize = new System.Drawing.Size(this.Size.Width, this.btnCancel.Location.Y + this.btnCancel.Size.Height + this.defaultSpacing); this.Name = "EnterPassphraseDialog"; this.RightToLeft = ((System.Windows.Forms.RightToLeft)(resources.GetObject("$this.RightToLeft"))); this.StartPosition = ((System.Windows.Forms.FormStartPosition)(resources.GetObject("$this.StartPosition"))); this.Text = resources.GetString("$this.Text"); this.Load += new System.EventHandler(this.EnterPassphraseDialog_Load); this.panel.ResumeLayout(false); this.ResumeLayout(false); }
/// <summary> /// Setup Dialog - Customize /// </summary> private void SetupDialog() { this.Title = Util.GS("iFolder passphrase"); this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png")); this.HasSeparator = false; // this.BorderWidth = 10; this.SetDefaultSize(450, 100); // this.Resizable = false; this.Modal = true; this.DestroyWithParent = true; this.DefaultResponse = ResponseType.Ok; //----------------------------- // Add iFolderGraphic //----------------------------- HBox imagebox = new HBox(); imagebox.Spacing = 0; iFolderBanner = new Image( new Gdk.Pixbuf(Util.ImagesPath("ifolder-banner.png"))); imagebox.PackStart(iFolderBanner, false, false, 0); ScaledPixbuf = new Gdk.Pixbuf(Util.ImagesPath("ifolder-banner-scaler.png")); iFolderScaledBanner = new Image(ScaledPixbuf); iFolderScaledBanner.ExposeEvent += new ExposeEventHandler(OnBannerExposed); imagebox.PackStart(iFolderScaledBanner, true, true, 0); this.VBox.PackStart(imagebox, false, true, 0); Table table = new Table(8, 3, false); this.VBox.PackStart(table, false, false, 0); table.ColumnSpacing = 6; table.RowSpacing = 6; table.BorderWidth = 12; // Row 1 Label l = new Label(Util.GS("Enter the passphrase") + ":"); table.Attach(l, 0, 3, 0, 1, AttachOptions.Fill | AttachOptions.Expand, 0, 0, 0); l.LineWrap = true; l.Xalign = 0.0F; // Row 2 table.Attach(new Label(""), 0, 1, 1, 2, AttachOptions.Fill, 0, 12, 0); // spacer l = new Label(Util.GS("Domain Name") + ":"); table.Attach(l, 1, 2, 1, 2, AttachOptions.Fill | AttachOptions.Expand, 0, 0, 0); l.LineWrap = true; l.Xalign = 0.0F; DomainInformation info = simws.GetDomainInformation(DomainID); l = new Label(info.Name + " (" + info.Host + ")"); table.Attach(l, 2, 3, 1, 2, AttachOptions.Fill | AttachOptions.Expand, 0, 0, 0); l.LineWrap = true; l.Xalign = 0.0F; // Row 3 table.Attach(new Label(""), 0, 1, 2, 3, AttachOptions.Fill, 0, 12, 0); // spacer l = new Label(Util.GS("_Passphrase:")); table.Attach(l, 1, 2, 2, 3, AttachOptions.Shrink | AttachOptions.Fill, 0, 0, 0); l.Xalign = 0.0F; PassPhraseEntry = new Entry(); PassPhraseEntry.Visibility = false; PassPhraseEntry.Changed += new EventHandler(OnFieldsChanged); table.Attach(PassPhraseEntry, 2, 3, 2, 3, AttachOptions.Fill | AttachOptions.Expand, 0, 0, 0); l.MnemonicWidget = PassPhraseEntry; // Row 4 l = new Label(Util.GS("_Re-type passphrase:")); table.Attach(l, 1, 2, 3, 4, AttachOptions.Shrink | AttachOptions.Fill, 0, 0, 0); l.Xalign = 0.0F; PassPhraseVerifyEntry = new Entry(); PassPhraseVerifyEntry.Visibility = false; PassPhraseVerifyEntry.Changed += new EventHandler(OnFieldsChanged); table.Attach(PassPhraseVerifyEntry, 2, 3, 3, 4, AttachOptions.Fill | AttachOptions.Expand, 0, 0, 0); l.MnemonicWidget = PassPhraseVerifyEntry; // Row 5 savePassPhraseButton = new CheckButton(Util.GS("Remember passphrase")); table.Attach(savePassPhraseButton, 2, 3, 4, 5, AttachOptions.Shrink | AttachOptions.Fill, 0, 0, 0); // Row 6 l = new Label(Util.GS("Select Passphrase Recovery Agent") + ":"); table.Attach(l, 0, 3, 5, 6, AttachOptions.Fill | AttachOptions.Expand, 0, 0, 0); l.LineWrap = true; l.Xalign = 0.0F; // Row 7 RATreeView = new iFolderTreeView(); ScrolledWindow sw = new ScrolledWindow(); sw.ShadowType = Gtk.ShadowType.EtchedIn; sw.HscrollbarPolicy = Gtk.PolicyType.Automatic; sw.VscrollbarPolicy = Gtk.PolicyType.Automatic; sw.Add(RATreeView); DomainController domainController = DomainController.GetDomainController(); RATreeStore = new ListStore(typeof(string)); RATreeView.Model = RATreeStore; RAList = domainController.GetRAList(DomainID); iFolderWebService ifws = DomainController.GetiFolderService(); TreeIter listiter = TreeIter.Zero; bool selected = false; try{ ifws.ChangePassword(DomainID, null, null); listiter = RATreeStore.AppendValues(Util.GS("Server_Default")); selected = true; } catch { } if (RAList == null) { Debug.PrintLine(" no recovery agent present:"); } else { Debug.PrintLine("Recovery agent present"); } foreach (string raagent in RAList) { Debug.PrintLine(String.Format("raagent:{0}", raagent)); RATreeStore.AppendValues(raagent); } // RA Name Column TreeViewColumn raNameColumn = new TreeViewColumn(); raNameColumn.Title = Util.GS("Recovery Agents"); CellRendererText cr = new CellRendererText(); cr.Xpad = 5; raNameColumn.PackStart(cr, false); raNameColumn.SetCellDataFunc(cr, new TreeCellDataFunc(RANameCellTextDataFunc)); raNameColumn.Resizable = true; raNameColumn.MinWidth = 250; RATreeView.AppendColumn(raNameColumn); RATreeView.Selection.Mode = SelectionMode.Single; table.Attach(sw, 0, 3, 6, 8, AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0); this.VBox.ShowAll(); if (selected) { RATreeView.Selection.SelectIter(listiter); } this.AddButton(Stock.Cancel, ResponseType.Cancel); this.AddButton(Stock.Ok, ResponseType.Ok); this.SetResponseSensitive(ResponseType.Ok, false); this.DefaultResponse = ResponseType.Ok; }
private static void RemoveSelectedFolderHandler(string path) { iFolderMsgDialog dialog = new iFolderMsgDialog( null, iFolderMsgDialog.DialogType.Question, iFolderMsgDialog.ButtonSet.YesNo, "", Util.GS("Revert this iFolder back to a normal folder?"), Util.GS("The folder will still be on your computer, but it will no longer synchronize with the iFolder Server.")); CheckButton deleteFromServerCB; iFolderWeb ifolder = ifws.GetiFolderByLocalPath(path); bool IsMaster = (ifolder.CurrentUserID == ifolder.OwnerID); if (IsMaster) { deleteFromServerCB = new CheckButton(Util.GS("Also _delete this iFolder from the server")); } else { deleteFromServerCB = new CheckButton(Util.GS("Also _remove my membership from this iFolder")); } deleteFromServerCB.Sensitive = simws.GetDomainInformation(ifolder.DomainID).Authenticated; dialog.ExtraWidget = deleteFromServerCB; int rc = dialog.Run(); dialog.Hide(); dialog.Destroy(); if (rc == -8) { try { if (ifolder != null) { ifws.RevertiFolder(ifolder.ID); if (deleteFromServerCB.Active) { if (IsMaster) { ifws.DeleteiFolder(ifolder.DomainID, ifolder.ID); } else { ifws.DeclineiFolderInvitation(ifolder.DomainID, ifolder.ID); } } } } catch (Exception e) { iFolderExceptionDialog ied = new iFolderExceptionDialog( null, e); ied.Run(); ied.Hide(); ied.Destroy(); } } }