Example #1
0
        /// <summary>
        /// Adds all the "user"/"group" objects to the tree
        /// </summary>
        /// <param name="container"></param>
        /// <param name="parentPage"></param>
        /// <param name="plugin"></param>
        /// <param name="PageType"></param>
        public AddUsertoGroup(IPlugInContainer container, MPPage parentPage, ADUCPlugin plugin, int PageType)
            : this()
        {
            this.IPlugInContainer = container;
            _addplugin            = plugin;
            _aducRootnode         = _addplugin.GetPlugInNode();
            _PageType             = PageType;

            if (_aducRootnode.Nodes.Count > 0)
            {
                ADUCDirectoryNode rootNode =
                    ADUCDirectoryNode.GetDirectoryRoot(_addplugin.GetpluginContext(),
                                                       _addplugin.GetRootDN(),
                                                       Resources.ADUC, typeof(ADUCPage), _addplugin);

                if (rootNode != null)
                {
                    treeView1.Nodes.Add(rootNode);
                    rootNode.Refresh();
                    treeView1.ExpandAll();
                }
            }
            else
            {
                Logger.Log("The LWTreeView control does not have any nodes.");
            }
        }
Example #2
0
        /// <summary>
        /// Override constructor gets the Plugin node and all its childs
        /// Adds the all nodes to the treeview
        /// </summary>
        /// <param name="container"></param>
        /// <param name="parentPage"></param>
        /// <param name="plugin"></param>
        /// <param name="origTreeview"></param>
        public ADMoveObjectPage(IPlugInContainer container, StandardPage parentPage, ADUCPlugin plugin, LWTreeView origTreeview)
            : this()
        {
            this.IPlugInContainer = container;
            _addplugin            = plugin;

            _origLWTreeView = origTreeview;

            _aducRootnode = _addplugin.GetPlugInNode();

            if (_aducRootnode.Nodes.Count > 0)
            {
                /*TreeNode[] newTreeArray = new TreeNode[_aducRootnode.Nodes.Count];
                 * // Iterate through the root nodes in the Nodes property.
                 * _aducRootnode.Nodes.CopyTo(newTreeArray, 0);
                 * foreach (TreeNode node in newTreeArray)
                 * {
                 *  LACTreeNode lacnode = node as LACTreeNode;
                 *  //   treeView1.Nodes.Add(lacnode.DeepCopy() as TreeNode);
                 * }*/
                ADUCDirectoryNode rootNode =
                    ADUCDirectoryNode.GetDirectoryRoot(_addplugin.GetpluginContext(),
                                                       _addplugin.GetRootDN(),
                                                       Resources.ADUC, typeof(ADUCPage), _addplugin);

                if (rootNode != null)
                {
                    treeView1.Nodes.Add(rootNode);
                    ADUCDirectoryNode[] childNodes = rootNode.ListContainerChildren(rootNode);
                    if (childNodes != null)
                    {
                        rootNode.Nodes.AddRange(childNodes);
                    }
                    treeView1.ExpandAll();
                }
            }
            else
            {
                Logger.Log("The LWTreeView control does not have any nodes.");
            }
        }
Example #3
0
        private bool BuildSchemaCache(bool usingSimpleBind)
        {
            if (_adContext == null)
            {
                return(false);
            }

            _adContext.SchemaCache = LDAPSchemaCache.Build(_adContext);
            _schemaCache           = _adContext.SchemaCache;
            DirectoryEntry.exisitngDirContext.Add(_adContext);
            DirectoryEntry.existingSchemaCache.Add(_schemaCache);

            string sldapPath = string.Concat("LDAP://", _hn.domainName, "/", rootDN);

            ADUCDirectoryNode rootNode = ADUCDirectoryNode.GetDirectoryRoot(
                _adContext,
                _rootDN,
                Resources.ADUC,
                typeof(ADUCPage),
                _plugin);

            if (rootNode == null)
            {
                Logger.Log("The rootNode is null");
                return(false);
            }

            _rootNode = rootNode;

            _shortDomainName = UserGroupUtils.getnetBiosName(rootNode);

            Logger.Log(
                "the obtained NetbiosName is " + _shortDomainName,
                Logger.ldapLogLevel);

            return(true);
        }