Example #1
0
		private IPropertyCollection GetPropertiesFromDirectoryObject(DirectoryObject doUser) {
			var schema = this.GetDefaultContextSchema();
			var propertyList = new List<IProperty>();

			foreach(PropertyDefinition pd in schema) {
				string propertyValue = (doUser != null && doUser.Contains(pd.PropertyName)) ? doUser[pd.PropertyName] : null;
				string propertyName = pd.PropertyName;
				IProperty property = new Property<string>(propertyName, Context.DefaultContext, CultureInfo.InvariantCulture);
				property.Value = propertyValue;
				propertyList.Add(property);
			}
			return new PropertyCollection(propertyList, schema);
		}
Example #2
0
		public abstract void SaveDirectoryObject(DirectoryObject directoryObject);
Example #3
0
		private IUser GetUserFromDirectoryObject(DirectoryObject doUser) {
			// If ID is formated as a guid then convert to LDAP searchable octet string
			string userId = ConvertOctetString(doUser.Id);
			var user = new User(userId, doUser[this.PropertyNames.UserName] ?? doUser.Id, string.Empty, GetPropertiesFromDirectoryObject(doUser), this.PropertyNames);
			return user;
		}