diff options
author | Mark Felder <feld@feld.me> | 2024-10-11 15:45:09 -0400 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2024-10-11 15:45:09 -0400 |
commit | 6bc70b8b2a7c6942bfda01bfcc301a198cf3238b (patch) | |
tree | 696c7c67b5b3ff0bd8ef88edac7c3ec2d317156f | |
parent | ff039f953043d2c15f1eb44f794a77865ab5a775 (diff) | |
download | pleroma-6bc70b8b2a7c6942bfda01bfcc301a198cf3238b.tar.gz pleroma-6bc70b8b2a7c6942bfda01bfcc301a198cf3238b.zip |
Add change_password/3 to LDAP module
-rw-r--r-- | lib/pleroma/ldap.ex | 4 | ||||
-rw-r--r-- | lib/pleroma/web/auth/ldap_authenticator.ex | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/pleroma/ldap.ex b/lib/pleroma/ldap.ex index 9c1263fcf..2bc894bd8 100644 --- a/lib/pleroma/ldap.ex +++ b/lib/pleroma/ldap.ex @@ -104,6 +104,10 @@ defmodule Pleroma.LDAP do GenServer.call(__MODULE__, {:bind_user, name, password}) end + def change_password(name, password, new_password) do + GenServer.call(__MODULE__, {:change_password, name, password, new_password}) + end + defp connect do ldap = Config.get(:ldap, []) host = Keyword.get(ldap, :host, "localhost") diff --git a/lib/pleroma/web/auth/ldap_authenticator.ex b/lib/pleroma/web/auth/ldap_authenticator.ex index 9bdf8447d..ec6601fb9 100644 --- a/lib/pleroma/web/auth/ldap_authenticator.ex +++ b/lib/pleroma/web/auth/ldap_authenticator.ex @@ -32,7 +32,7 @@ defmodule Pleroma.Web.Auth.LDAPAuthenticator do end def change_password(user, password, new_password, new_password) do - case GenServer.call(LDAP, {:change_password, user.nickname, password, new_password}) do + case LDAP.change_password(user.nickname, password, new_password) do :ok -> {:ok, user} e -> e end |