コード例 #1
0
    public NewGroupDlg(IPlugInContainer container, StandardPage parentPage,Hostinfo hn, IPlugIn plugin)
    : base(container, parentPage)
    {
        InitializeComponent();
        
        // Create an instance of a ListView column sorter and assign it
        // to the ListView control.
        lvwColumnSorter = new ListViewColumnSorter();
        this.lvMembers.ListViewItemSorter = lvwColumnSorter;
        
        this.ButtonCancel.Text = "Cancel";
        
        this.ButtonOK.Text = "Create";
        
        this.SetAllValueChangedHandlers(this);
        
        localParent = (LUGPage)parentPage;
        
        if (localParent == null)
        {
            throw new ArgumentException("NewGroupDlg constructor: (LUGPage) parentPage == null");
        }

        this._hn = hn;
        this._plugin = (LUGPlugIn)plugin;

        ((EditDialog)this).btnApply.Visible = false;
        users = new Hashtable();
        
        this.tbGroupName.Select();
        
    }
コード例 #2
0
        protected override bool Apply(EditDialogAction actionCause)
        {
            bool b = base.Apply(actionCause);

            if (b)
            {
                try
                {
                    if (userMemberOf.Visible)
                    {
                        editUserPage.Description = userMemberOf.Description;
                    }
                    else
                    {
                        userMemberOf.Description = editUserPage.Description;
                    }

                    LUGPage lup = (LUGPage)this.ParentPage;
                    lup.EditLUG(this);

                    userMemberOf.ApplyMembers();
                }
                catch (Exception e)
                {
                    b = false;
                    Logger.LogException("UserPropertiesDlg.Apply", e);
                }
            }


            return(b);
        }
コード例 #3
0
ファイル: NewGroupDlg.cs プロジェクト: vmware/likewise-open
        public NewGroupDlg(IPlugInContainer container, StandardPage parentPage, Hostinfo hn, IPlugIn plugin)
            : base(container, parentPage)
        {
            InitializeComponent();

            // Create an instance of a ListView column sorter and assign it
            // to the ListView control.
            lvwColumnSorter = new ListViewColumnSorter();
            this.lvMembers.ListViewItemSorter = lvwColumnSorter;

            this.ButtonCancel.Text = "Cancel";

            this.ButtonOK.Text = "Create";

            this.SetAllValueChangedHandlers(this);

            localParent = (LUGPage)parentPage;

            if (localParent == null)
            {
                throw new ArgumentException("NewGroupDlg constructor: (LUGPage) parentPage == null");
            }

            this._hn     = hn;
            this._plugin = (LUGPlugIn)plugin;

            ((EditDialog)this).btnApply.Visible = false;
            users = new Hashtable();

            this.tbGroupName.Select();
        }
コード例 #4
0
        private void cm_OnCreateGroup(object sender, EventArgs e)
        {
            MenuItem    m_item    = sender as MenuItem;
            LACTreeNode groupNode = m_item.Tag as LACTreeNode;

            if (groupNode != null)
            {
                LUGPage page = null;

                if (groupNode.PluginPage == null)
                {
                    Type type = groupNode.NodeType;

                    object o = Activator.CreateInstance(type);
                    if (o is IPlugInPage)
                    {
                        ((IPlugInPage)o).SetPlugInInfo(_container, groupNode.Plugin, groupNode, (LWTreeView)groupNode.TreeView, groupNode.sc);
                        page = (LUGPage)groupNode.PluginPage;
                    }
                }
                else
                {
                    page = (LUGPage)gNode.PluginPage;
                }
                if (page != null)
                {
                    page.CreateDlg();
                }
            }
        }
コード例 #5
0
ファイル: NewUserDlg.cs プロジェクト: vmware/likewise-open
        protected override bool Apply(EditDialogAction actionCause)
        {
            uint   result       = (uint)LUGAPI.WinError.ERROR_SUCCESS;
            string errorMessage = null;

            try
            {
                if (!Hostinfo.ValidatePassword(tbConfirmPassword.Text, tbPassword.Text, out errorMessage))
                {
                    if (!(tbConfirmPassword.Text.Trim().Equals(tbPassword.Text)))
                    {
                        errorMessage = "The password was not correctly confirmed. Please ensure that the password and confirmation match exactly";
                    }
                    container.ShowError(errorMessage, MessageBoxButtons.OK);
                    return(false);
                }

                Password     = tbPassword.Text;
                User         = tbUserName.Text;
                FullName     = tbFullName.Text;
                Description  = tbDescription.Text;
                CannotChange = cbCannotChange.Checked;
                MustChange   = cbMustChange.Checked;
                NeverExpires = cbNeverExpires.Checked;
                IsDisabled   = cbIsDisabled.Checked;

                LUGPage lugPg = localParent;

                if (lugPg == null)
                {
                    Logger.Log("NewUserDlg.Apply  localParent == null", Logger.LogLevel.Error);
                    return(false);
                }

                result = lugPg.AddLUG(this);

                if (result != (uint)LUGAPI.WinError.ERROR_SUCCESS)
                {
                    container.ShowError(
                        "Likewise Administrative Console encountered an error when trying to add a new user.  " + ErrorCodes.WIN32String((int)result),
                        MessageBoxButtons.OK);
                    return(false);
                }
            }
            catch (Exception e)
            {
                Logger.LogException("NewUserDlg.Apply", e);
            }

            return(true);
        }
コード例 #6
0
ファイル: NewUserDlg.cs プロジェクト: vmware/likewise-open
        public NewUserDlg(IPlugInContainer container, StandardPage parentPage)
            : base(container, parentPage)
        {
            InitializeComponent();

            ButtonCancel.Text = "Cancel";
            ButtonOK.Text     = "Create";
            SetAllValueChangedHandlers(this);
            tbFullName.MaxLength = 256;

            localParent = (LUGPage)parentPage;

            this.tbUserName.Select();
        }
コード例 #7
0
 public NewUserDlg(IPlugInContainer container, StandardPage parentPage)
 : base(container, parentPage)
 {
     InitializeComponent();
     
     ButtonCancel.Text = "Cancel";
     ButtonOK.Text = "Create";
     SetAllValueChangedHandlers(this);
     tbFullName.MaxLength = 256;
     
     localParent = (LUGPage) parentPage;
     
     this.tbUserName.Select();
     
 }
コード例 #8
0
        protected override bool Apply(EditDialogAction actionCause)
        {
            bool b = base.Apply(actionCause);

            if (b)
            {
                try
                {
                    LUGPage lup = (LUGPage)this.ParentPage;
                    lup.EditLUG(this);

                    groupPropertiesPage.ApplyMembers();
                }
                catch (Exception e)
                {
                    b = false;
                    Logger.LogException("GroupPropertiesDlg.Apply", e);
                }
            }


            return(b);
        }