summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2024-09-17 13:36:46 -0400
committerMark Felder <feld@feld.me>2024-09-17 13:40:15 -0400
commit363b462c54c454e847072869db09f8f4d5da4426 (patch)
treed947371c4a27c20c84a8c0987298c47edec64828 /lib
parent14a9663f1abe49b8f4f4f719fa2f4db3a5dd81b7 (diff)
downloadpleroma-363b462c54c454e847072869db09f8f4d5da4426.tar.gz
pleroma-363b462c54c454e847072869db09f8f4d5da4426.zip
Make the email attribute configurable
While here, fix the System.get_env usage to use the normal fallback value method and improve the UID label description
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