コード例 #1
0
ファイル: AddRequest.cs プロジェクト: nlhepler/mono
		public AddRequest (string distinguishedName, string objectClass)
		{
			DistinguishedName = distinguishedName;
			Attributes = new DirectoryAttributeCollection (new DirectoryAttribute [0]);

			throw new NotImplementedException ();
		}
コード例 #2
0
        public AddRequest(string distinguishedName, string objectClass)
        {
            DistinguishedName = distinguishedName;
            Attributes        = new DirectoryAttributeCollection(new DirectoryAttribute [0]);

            throw new NotImplementedException();
        }
 public void AddRange(DirectoryAttributeCollection attributeCollection)
 {
     if (attributeCollection == null)
     {
         throw new ArgumentNullException("attributeCollection");
     }
     int count = attributeCollection.Count;
     for (int i = 0; i < count; i++)
     {
         this.Add(attributeCollection[i]);
     }
 }
コード例 #4
0
        public void AddRange(DirectoryAttributeCollection attributeCollection)
        {
            if (attributeCollection == null)
            {
                throw new ArgumentNullException("attributeCollection");
            }
            int currentCount = attributeCollection.Count;

            for (int i = 0; i < currentCount; i = ((i) + (1)))
            {
                this.Add(attributeCollection[i]);
            }
        }
コード例 #5
0
 public void AddRange(DirectoryAttributeCollection attributeCollection)
 {
     if (attributeCollection != null)
     {
         int count = attributeCollection.Count;
         for (int i = 0; i < count; i++)
         {
             this.Add(attributeCollection[i]);
         }
         return;
     }
     else
     {
         throw new ArgumentNullException("attributeCollection");
     }
 }
コード例 #6
0
        public string createUserLdap(User user)
        {
            ldapId = new LdapDirectoryIdentifier(HOST, PORT);
            network = new NetworkCredential(ADMIN, ADMIN_PASS);

            using (LdapConnection connection = new LdapConnection(ldapId, network, AuthType.Basic))
            {
                try
                {
                    string[] objectClass = new string[] { "top", "inetOrgPerson", "organizationalPerson", "person" };

                    connection.SessionOptions.SecureSocketLayer = false;
                    connection.SessionOptions.ProtocolVersion = 3;

                    String dn = DN_CREATE.Replace("{0}", user.email);

                    DirectoryAttributeCollection collection = new DirectoryAttributeCollection() {
                        new DirectoryAttribute("objectclass", objectClass),
                        new DirectoryAttribute("uid",user.email),
                        new DirectoryAttribute("sn", user.lastName),
                        new DirectoryAttribute("cn", user.userName),
                        new DirectoryAttribute("employeeNumber", user.userId),
                        new DirectoryAttribute("departmentNumber", user.userGroup),
                        new DirectoryAttribute("userPassword", user.password)
                    };

                    AddRequest addMe = new AddRequest(dn, "inetOrgPerson");
                    addMe.Attributes.AddRange(collection);

                    connection.Bind();
                    connection.SendRequest(addMe);

                    return "OK";

                }
                catch (LdapException ex)
                {
                    throw new BusinessException("Ldap error: " + ex.Message);
                }
                catch (Exception e)
                {
                    throw new PlatformException("Ldap error: " + e.Message);
                }
            }
        }
コード例 #7
0
 public void AddRange(DirectoryAttributeCollection attributeCollection)
 {
     list.Add(attributeCollection.list);
 }
コード例 #8
0
		public void AddRange (DirectoryAttributeCollection attributeCollection)
		{
			list.Add (attributeCollection.list);
		}
コード例 #9
0
ファイル: AddRequest.cs プロジェクト: nlhepler/mono
		public AddRequest (string distinguishedName, params DirectoryAttribute [] attributes)
		{
			DistinguishedName = distinguishedName;
			Attributes = new DirectoryAttributeCollection (attributes);
		}
コード例 #10
0
 public AddRequest()
 {
     this.attributeList = new DirectoryAttributeCollection();
 }
コード例 #11
0
 public AddRequest(string distinguishedName, params DirectoryAttribute [] attributes)
 {
     DistinguishedName = distinguishedName;
     Attributes        = new DirectoryAttributeCollection(attributes);
 }
コード例 #12
0
        //
        // Public
        //

        public AddRequest()
        {
            _attributeList = new DirectoryAttributeCollection();
        }