public ServerNode(VMDirServerDTO serverDTO, PropertiesControl control) : base(serverDTO, control) { ImageIndex = SelectedImageIndex = (int)VMDirIconIndex.Server; this.Text = serverDTO.Server; this.Tag = "server"; }
public DirectoryExpandableNode(string dn, List <string> oc, VMDirServerDTO serverDTO, PropertiesControl propCtl) : base(dn, oc, serverDTO, propCtl) { this.Text = Cn + " ..."; AddDummyNode(); InitPageSearch(); }
private void Initialise() { var serverDTO = VMDirServerDTO.CreateInstance(); serverNode = new VMDirServerInfo(serverDTO); navigationController = new OutlineViewNavigationController(); }
// Call to load from the XIB/NIB file public CreateObjectWindowController(string objectClass, VMDirServerDTO serverDTO) : base("CreateObjectWindow") { _objectClass = objectClass; _serverDTO = serverDTO; Bind(); Utilities.RemoveDontShowAttributes(_properties); }
public SuperLogBrowser(VMDirServerDTO dto) { _serverDTO = dto; InitializeComponent(); InitUI(); }
void ShowVerifyUserPassword() { var upn = Utilities.GetAttrLastVal(_properties, VMDirConstants.ATTR_KRB_UPN); VerifyPasswordController cwc = new VerifyPasswordController(upn); nint result = NSApplication.SharedApplication.RunModalForWindow(cwc.Window); if (result == (nint)VMIdentityConstants.DIALOGOK) { try { VMDirServerDTO ser = new VMDirServerDTO(); ser.Server = ServerDTO.Server; ser.Password = cwc.Password; ser.BindDN = cwc.Upn; ser.Connection = new LdapConnectionService(ser.Server, ser.BindDN, ser.Password); if (ser.Connection.CheckCredentials()) { UIErrorHelper.ShowAlert(CommonConstants.CORRECT_PWD, "Success"); } } catch (Exception) { UIErrorHelper.ShowAlert(CommonConstants.INVALID_PWD, "Failure"); } } }
public static Dictionary <string, VMDirBagItem> GetProperties(VMDirServerDTO serverDTO, List <ILdapEntry> entries) { var _properties = new Dictionary <string, VMDirBagItem>(); foreach (LdapEntry entry in entries) { string[] names = entry.getAttributeNames().ToArray(); foreach (string name in names) { var key = name; var attribType = serverDTO.Connection.SchemaManager.GetAttributeType(key); bool readOnly = true; string desc = ""; if (attribType != null) { readOnly = attribType.ReadOnly; desc = attribType.Description; LdapValue[] vals = entry.getAttributeValues(name).ToArray(); _properties[key] = new VMDirBagItem { Value = vals, IsReadOnly = readOnly, Description = desc, IsRequired = true }; } } } return(_properties); }
private void btnOK_Click(object sender, EventArgs e) { try { if (!ValidateForm()) { this.DialogResult = DialogResult.None; return; } if (_dto == null) { _dto = VMDirServerDTO.CreateInstance(); } _dto.Server = (txtDirectoryServer.Text).Trim(); _dto.BaseDN = (txtBaseDN.Text).Trim(); _dto.BindDN = (txtBindUPN.Text).Trim(); _dto.Password = txtPassword.Text; _dto.Connection = new LdapConnectionService(_dto.Server, _dto.BindDN, _dto.Password); _dto.Connection.CreateConnection(); this.Close(); } catch (Exception exp) { MiscUtilsService.ShowError(exp); } }
public SchemaBrowser(VMDirServerDTO dto) { _serverDTO = dto; InitializeComponent(); Bind(); }
public DirectoryNode(string dn, VMDirServerDTO dto, ScopeNode parent) : base(dto) { Name = dn; DisplayName = VMDirServerDTO.DN2CN(Name); Parent = parent; IsBaseNode = false; _properties = new Dictionary <string, VMDirBagItem> (); }
// Call to load from the XIB/NIB file public CreateObjectWindowController(string objectClass, VMDirServerDTO serverDTO, string parentDn) : base("CreateObjectWindow") { _objectClass = objectClass; _serverDTO = serverDTO; _parentDn = parentDn; Bind(); }
public AddOrRemoveAttributes(string objectClass, IEnumerable <KeyValuePair <string, string> > existingAttributes, VMDirServerDTO serverDTO) { _objectClass = objectClass; _serverDTO = serverDTO; InitializeComponent(); Text = "Manage attributes for " + _objectClass; Bind(existingAttributes); }
public PropertiesTableViewDataSource(string dn, string oc, VMDirServerDTO serverDTO, Dictionary <string, VMDirAttributeDTO> classList) : this() { this.dn = dn; this.objectClass = oc; this.serverDTO = serverDTO; properties = classList; FillData(); }
public DirectoryBaseNode(string dn, List <string> oc, VMDirServerDTO serverDTO, PropertiesControl propCtl) : base(serverDTO, propCtl) { this.Dn = dn; this.ObjectClass = oc; Cn = VMDirServerDTO.DN2CN(dn); ImageIndex = SelectedImageIndex = MiscUtilsService.GetImgIndx(ObjectClass); this.Tag = "directory"; }
public DirectoryNode(string dn, List <string> ocSet, VMDirServerDTO dto, ScopeNode parent) : base(dto) { Dn = dn; ObjectClass = ocSet; DisplayName = VMDirServerDTO.DN2CN(Dn); Parent = parent; IsBaseNode = false; InitPageSearch(); }
public CreateForm(string objectClass, VMDirServerDTO serverDTO) { _objectClass = objectClass; _serverDTO = serverDTO; InitializeComponent(); Bind(); VMDir.Common.VMDirUtilities.Utilities.RemoveDontShowAttributes(_properties); }
void AddServerNode(VMDirServerDTO dto) { var node = new VMDirSchemaServerNode(dto); this.ServerNode = node; this.Children.Add(node); }
public void AddServer(VMDirServerDTO dto) { var overFlow = ServerList.Count - VMDirConstants.MAX_SERVER_PERSIST; if (overFlow > 0) { ServerList.RemoveRange(0, overFlow); } ServerList.Add(dto); }
public SearchWindowController(string dn, VMDirServerDTO serverDTO) : base("SearchWindow") { this._dn = dn; this._serverDTO = serverDTO; _pageSize = 100; _currPage = 0; _totalPage = 0; _resultList = new List <DirectoryNonExpandableNode>(); _returnedAttrList = new List <string>(); }
public ServerNode(VMDirServerDTO dto) { _serverDTO = dto; DisplayName = dto.Server; ImageIndex = SelectedImageIndex = (int)VMDirImageIndex.Server; this.EnabledStandardVerbs = StandardVerbs.Delete; this.ActionsPaneItems.Add(new Microsoft.ManagementConsole.Action("Login", "Login", -1, ACTION_LOGIN)); }
public DirectoryNode(string dn, VMDirServerDTO serverDTO) { ServerDTO = serverDTO; _name = dn; DisplayName = VMDirServerDTO.DN2CN(_name); ImageIndex = SelectedImageIndex = (int)VMDirImageIndex.DirectoryObject; InitNode(); AddViewDescription(); }
public AttributeEditorPropertyPage(string dn, VMDirServerDTO serverDTO) { ServerDTO = serverDTO; _dn = dn; InitializeComponent(); MMCInit(); _properties = new Dictionary <string, VMDirBagItem>(); _kvData = new List <KeyValuePair <string, string> >(); _pendingMods = new HashSet <string>(); Bind(); }
public SearchForm(string searchBase, VMDirServerDTO serverDTO) { InitializeComponent(); _searchBase = searchBase; _serverDTO = serverDTO; _pageSize = VMDirConstants.DEFAULT_PAGE_SIZE; _result = new List <DirectoryNonExpandableNode>(); resultStatusLabel.Text = ""; tableLayoutPanel2.Visible = false; _returnedAttr = new List <string>(); }
public LdapPropertiesWindowController(String itemName, VMDirServerDTO dto) : base("LdapPropertiesWindow") { this.itemName = itemName; this.serverDTO = dto; _properties = new Dictionary <string, VMDirBagItem> (); try { Utilities.GetItemProperties(itemName, dto, _properties); Utilities.RemoveDontShowAttributes(_properties); } catch (Exception e) { UIErrorHelper.ShowAlert("", e.Message); } }
public async void ConnectToServer(string server) { var serverDTO = VMDirServerDTO.CreateInstance(); if (!string.IsNullOrWhiteSpace(server)) { serverDTO.Server = server; } serverNode = new VMDirSchemaServerNode(serverDTO); ProgressWindowController pwc = new ProgressWindowController(); IntPtr session = new IntPtr(0); string[] servers = VMDirSchemaSnapInEnvironment.Instance.LocalData.GetServerArray(); LoginWindowController lwc = new LoginWindowController(servers); NSApplication.SharedApplication.BeginSheet(lwc.Window, this.Window, () => { }); nint result = NSApplication.SharedApplication.RunModalForWindow(lwc.Window); try { if (result == VMIdentityConstants.DIALOGOK) { serverNode.ServerDTO.Server = lwc.Server; serverNode.ServerDTO.BindDN = lwc.UserName + "@" + lwc.DomainName; serverNode.ServerDTO.Password = lwc.Password; NSApplication.SharedApplication.BeginSheet(pwc.Window, this.Window as NSWindow, () => { }); session = NSApplication.SharedApplication.BeginModalSession(pwc.Window); await serverNode.DoLogin(); InitialiseViews(); } } catch (Exception e) { UIErrorHelper.ShowAlert(VMIdentityConstants.CONNECTION_NOT_SUCCESSFUL + e.Message, string.Empty); } finally { if (pwc.ProgressBar != null) { pwc.ProgressBar.StopAnimation(pwc.Window); pwc.Window.Close(); NSApplication.SharedApplication.EndModalSession(session); } Window.EndSheet(lwc.Window); lwc.Dispose(); } }
void AddAllServers() { foreach (var server in VMDirSchemaSnapInEnvironment.Instance.LocalData.GetServerArray()) { VMDirServerDTO dto = VMDirServerDTO.CreateInstance(); dto.Server = server; AddServerNode(dto); } }
public void RefreshMethod(VMDirServerDTO dto) { if (dto == null) { RefreshAll(); } else { AddServerNode(dto); } }
public VMDirSchemaServerNode(VMDirServerDTO serverDTO) { this.ServerDTO = serverDTO; IsLoggedIn = false; DisplayName = ServerDTO.Server; this.ImageIndex = this.SelectedImageIndex = (int)VMDirSchemaTreeImageIndex.Server; AddLoginActions(); }
public ServerNode(VMDirServerDTO serverDTO, PropertiesControl control) : base(serverDTO, control) { ImageIndex = SelectedImageIndex = (int)VMDirIconIndex.Server; this.Text = serverDTO.Server; this.Tag = "server"; /*if (serverDTO.IsLoggedIn) * { * Expand(); * DoSelect(); * DoRefresh(); * } */ }
public void AddNewServer() { MiscUtilsService.CheckedExec(delegate { var serverDTO = VMDirServerDTO.CreateInstance(); serverDTO.Server = ""; var node = new ServerNode(serverDTO, PropertiesCtl); node.Login(); if (node.ServerDTO.IsLoggedIn) { VMDirEnvironment.Instance.LocalData.AddServer(serverDTO); this.Nodes.Add(node); } }); }