summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/ldap.ex4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/pleroma/ldap.ex b/lib/pleroma/ldap.ex
index 0723cd094..8e9c591b2 100644
--- a/lib/pleroma/ldap.ex
+++ b/lib/pleroma/ldap.ex
@@ -205,6 +205,8 @@ defmodule Pleroma.LDAP do
end
defp try_register(name, attributes) do
+ mail_attribute = Config.get([:ldap, :mail])
+
params = %{
name: name,
nickname: name,
@@ -212,7 +214,7 @@ defmodule Pleroma.LDAP do
}
params =
- case List.keyfind(attributes, ~c"mail", 0) do
+ case List.keyfind(attributes, to_charlist(mail_attribute), 0) do
{_, [mail]} -> Map.put_new(params, :email, :erlang.list_to_binary(mail))
_ -> params
end