Exemplo n.º 1
0
        public void Execute()
        {
            var syncPortal2AD = new SyncPortal2AD();

            switch (_actionType)
            {
            case ActionType.CreateNewADUser:
                syncPortal2AD.CreateNewADUser((User)Node, NewPath, PassWd);
                break;

            case ActionType.UpdateADUser:
                syncPortal2AD.UpdateADUser((User)Node, NewPath, PassWd);
                break;

            case ActionType.CreateNewADContainer:
                syncPortal2AD.CreateNewADContainer(Node, NewPath);
                break;

            case ActionType.UpdateADContainer:
                syncPortal2AD.UpdateADContainer(Node, NewPath);
                break;

            case ActionType.DeleteADObject:
                syncPortal2AD.DeleteADObject(NodePath, Guid);
                break;
            }
        }
Exemplo n.º 2
0
        /*=========================================================================== Async pattern */
        private static void ProcessAction(ActionType actionType, Node node, string newPath, string passWd)
        {
            var adAction = new ADAction(actionType, node, newPath, passWd);

            // no immediate background async action executed
            // -> user of app pool cannot have elevated AD rights
            var      syncPortal2AD = new SyncPortal2AD();
            SyncTree syncTree;

            if (syncPortal2AD.IsSyncedObject(node.Path, out syncTree))
            {
                if (node.NodeType.IsInstaceOfOrDerivedFrom("Group") && !syncTree.SyncGroups)
                {
                    return;
                }

                SaveAction(adAction, null);
            }
        }
Exemplo n.º 3
0
        public override bool AllowMoveADObject(Node node, string newPath)
        {
            var directoryServices = new SyncPortal2AD();

            return(directoryServices.AllowMoveADObject(node, newPath));
        }