Esempio n. 1
0
 public ServerNode(VMDirServerDTO serverDTO, PropertiesControl control)
     : base(serverDTO, control)
 {
     ImageIndex = SelectedImageIndex = (int)VMDirIconIndex.Server;
     this.Text  = serverDTO.Server;
     this.Tag   = "server";
 }
Esempio n. 2
0
 public DirectoryExpandableNode(string dn, List <string> oc, VMDirServerDTO serverDTO, PropertiesControl propCtl)
     : base(dn, oc, serverDTO, propCtl)
 {
     this.Text = Cn + " ...";
     AddDummyNode();
     InitPageSearch();
 }
Esempio n. 3
0
        private void Initialise()
        {
            var serverDTO = VMDirServerDTO.CreateInstance();

            serverNode           = new VMDirServerInfo(serverDTO);
            navigationController = new OutlineViewNavigationController();
        }
Esempio n. 4
0
 // Call to load from the XIB/NIB file
 public CreateObjectWindowController(string objectClass, VMDirServerDTO serverDTO) : base("CreateObjectWindow")
 {
     _objectClass = objectClass;
     _serverDTO   = serverDTO;
     Bind();
     Utilities.RemoveDontShowAttributes(_properties);
 }
Esempio n. 5
0
        public SuperLogBrowser(VMDirServerDTO dto)
        {
            _serverDTO = dto;
            InitializeComponent();

            InitUI();
        }
Esempio n. 6
0
        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");
                }
            }
        }
Esempio n. 7
0
        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);
            }
        }
Esempio n. 9
0
        public SchemaBrowser(VMDirServerDTO dto)
        {
            _serverDTO = dto;

            InitializeComponent();

            Bind();
        }
Esempio n. 10
0
 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> ();
 }
Esempio n. 11
0
 // 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();
 }
Esempio n. 12
0
 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();
 }
Esempio n. 14
0
 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";
 }
Esempio n. 15
0
 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();
 }
Esempio n. 16
0
        public CreateForm(string objectClass, VMDirServerDTO serverDTO)
        {
            _objectClass = objectClass;
            _serverDTO   = serverDTO;

            InitializeComponent();
            Bind();
            VMDir.Common.VMDirUtilities.Utilities.RemoveDontShowAttributes(_properties);
        }
Esempio n. 17
0
        void AddServerNode(VMDirServerDTO dto)

        {
            var node = new VMDirSchemaServerNode(dto);

            this.ServerNode = node;

            this.Children.Add(node);
        }
Esempio n. 18
0
        public void AddServer(VMDirServerDTO dto)
        {
            var overFlow = ServerList.Count - VMDirConstants.MAX_SERVER_PERSIST;

            if (overFlow > 0)
            {
                ServerList.RemoveRange(0, overFlow);
            }
            ServerList.Add(dto);
        }
Esempio n. 19
0
 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>();
 }
Esempio n. 20
0
        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));
        }
Esempio n. 21
0
        public DirectoryNode(string dn, VMDirServerDTO serverDTO)
        {
            ServerDTO   = serverDTO;
            _name       = dn;
            DisplayName = VMDirServerDTO.DN2CN(_name);
            ImageIndex  = SelectedImageIndex = (int)VMDirImageIndex.DirectoryObject;

            InitNode();

            AddViewDescription();
        }
Esempio n. 22
0
 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();
 }
Esempio n. 23
0
 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();
            }
        }
Esempio n. 26
0
        void AddAllServers()

        {
            foreach (var server in VMDirSchemaSnapInEnvironment.Instance.LocalData.GetServerArray())

            {
                VMDirServerDTO dto = VMDirServerDTO.CreateInstance();

                dto.Server = server;

                AddServerNode(dto);
            }
        }
Esempio n. 27
0
        public void RefreshMethod(VMDirServerDTO dto)

        {
            if (dto == null)
            {
                RefreshAll();
            }

            else
            {
                AddServerNode(dto);
            }
        }
Esempio n. 28
0
        public VMDirSchemaServerNode(VMDirServerDTO serverDTO)
        {
            this.ServerDTO = serverDTO;
            IsLoggedIn     = false;

            DisplayName = ServerDTO.Server;

            this.ImageIndex = this.SelectedImageIndex = (int)VMDirSchemaTreeImageIndex.Server;



            AddLoginActions();
        }
Esempio n. 29
0
        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();
             * } */
        }
Esempio n. 30
0
 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);
         }
     });
 }