logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/
commit: 6bc70b8b2a7c6942bfda01bfcc301a198cf3238b
parent ff039f953043d2c15f1eb44f794a77865ab5a775
Author: Mark Felder <feld@feld.me>
Date:   Fri, 11 Oct 2024 15:45:09 -0400

Add change_password/3 to LDAP module

Diffstat:

Mlib/pleroma/ldap.ex4++++
Mlib/pleroma/web/auth/ldap_authenticator.ex2+-
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git 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 @@ -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