changeset 7455:0dbf10f4493a HEAD

Allow %variables in static LDAP fields.
author Timo Sirainen <tss@iki.fi>
date Thu, 24 Apr 2008 16:31:07 +0300
parents 053ec63146cb
children 8af71985e97b
files src/auth/db-ldap.c
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/auth/db-ldap.c	Thu Apr 24 16:08:25 2008 +0300
+++ b/src/auth/db-ldap.c	Thu Apr 24 16:31:07 2008 +0300
@@ -979,8 +979,15 @@
 	ctx->attr_map = attr_map;
 
 	static_data = hash_lookup(attr_map, "");
-	if (static_data != NULL)
-		ctx->static_attrs = t_strsplit(static_data, ",");
+	if (static_data != NULL) {
+		const struct var_expand_table *table;
+		string_t *str;
+
+		table = auth_request_get_var_expand_table(auth_request, NULL);
+		str = t_str_new(256);
+		var_expand(str, static_data, table);
+		ctx->static_attrs = t_strsplit(str_c(str), ",");
+	}
 
 	if (auth_request->auth->verbose_debug)
 		ctx->debug = t_str_new(256);