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
This commit is contained in:
parent
14a9663f1a
commit
363b462c54
3 changed files with 17 additions and 7 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue