Esempio n. 1
0
 public void GetUserInfoDelegate(LUGAPI.LUGInfo userInfo)
 {
     this.tbDescription.Text = userInfo.description;
     this.tbFullName.Text = userInfo.fullname;
     
     this.cbAccountLockedOut.Checked = (userInfo.flags & LUGAPI.UF_LOCKOUT) == 0 ? false : true;
     if (cbAccountLockedOut.Checked == true)
     {
         cbAccountLockedOut.Enabled = true;
     }
     
     this.cbCannotChange.Checked = (userInfo.flags & LUGAPI.UF_PASSWD_CANT_CHANGE) == 0 ? false : true;
     this.cbIsDisabled.Checked = (userInfo.flags & LUGAPI.UF_ACCOUNTDISABLE) == 0 ? false : true;
     this.cbNeverExpires.Checked = (userInfo.flags & LUGAPI.UF_DONT_EXPIRE_PASSWD) == 0 ? false : true;
     this.cbMustChange.Checked = (userInfo.flags & LUGAPI.UF_PASSWORD_EXPIRED) == 0 ? false : true;
 }
Esempio n. 2
0
        private void PopulateListView(LUGAPI.LUGEnumStatus enumStatus)
        {
            if (enumStatus.entries != null && enumStatus.entries.Count > 0)
            {
                ListViewItem [] lvArr = new ListViewItem[Convert.ToInt32(enumStatus.entries.Count)];

                for (int i = 0; i < enumStatus.entries.Count; i++)
                {
                    if (enumStatus.type == LUGAPI.LUGType.User)
                    {
                        lvArr[i] = new ListViewItem(enumStatus.entries[i][2]);
                    }
                    else
                    {
                        lvArr[i] = new ListViewItem(enumStatus.entries[i][1]);
                    }
                }

                this.lvMembers.Items.AddRange(lvArr);

                if (enumStatus.moreEntries)
                {
                    try
                    {
                        if (enumStatus.type == LUGAPI.LUGType.User)
                        {
                            LUGAPI.NetEnumUsers(
                                _hostName,
                                enumStatus.resumeHandle,
                                out enumStatus);
                            PopulateListView(enumStatus);
                        }
                        else if (enumStatus.type == LUGAPI.LUGType.Group)
                        {
                            LUGAPI.NetEnumGroups(
                                _hostName,
                                enumStatus.resumeHandle,
                                out enumStatus);
                            PopulateListView(enumStatus);
                        }
                    }
                    catch (Exception)
                    {
                    }
                }
            }
        }