[owncloud-devel] Editing LDAP profile data

Arthur Schiwon blizzz at owncloud.com
Thu Mar 3 13:22:39 GMT 2016


On Tue, 1 Mar 2016 03:06:49 -0700 (MST)
user3254 <lulahlulah at yahoo.com> wrote:

Hey Lucy,

> Hi Arthur,
> 
> I'm going to write and possibly contribute an app which can write to
> LDAP and any modifications to user data in the MySQL database should
> also be done in LDAP. 
> 
> Could you please eloborate the interfaces you mentioned? Which
> methods need to be hooked in? 

Please keep the old mail quoted, so the context is not missing. If I
would not have it in my maildir it would have been tough to find this
again ;)

Back then I was writing

>>  However, I am open for needed interfaces or so in here if you
>> follow the approach with an another app.

That said, there is currently nothing that would let you interact with
the LDAP backend. 

What we would need to do is to provide an public API in ownCloud core.
Probably the basic methods would be user centered

* translate an ownCloud username to the LDAP DN: This allows you to
  work with a user record.

* return the LDAP connection for the specified user (since more than
  one LDAP server can be configured): This allows you to talk to the
  LDAP server and you do not need to worry about establishing
  connections and stuff

Or is there anything else needed by you?

Those methods need to be specified in an interface within a new folder
lib/public/ldap/

There needs to be a default dummy implementation in core (lib/private/…)
that would just throw exceptions, and an real implementation in
apps/user_ldap/. Upon install/update it should override the default
implementation and set it back when disabling. 

The server (lib/private/server.php) would just receive a need method
and provide an instance of that implementation.

This is less complicated than may sound :)

When this is done, your future app would just retrieve the instance via
\OC::$server->getLDAPProvider() (maybe find a better name), which
allows you to receive the DN of the user and the LDAP connection
resource, allowing you to use all the PHP ldap_* methods to interact
with the server.

What do you think?

Cheers
Arthur



> 
> Thanks a lot.
> 
> 
> Regards,
> Lucy
> 
> 
> 
> --
> View this message in context:
> http://owncloud.10557.n7.nabble.com/Editing-LDAP-profile-data-tp15999p16748.html
> Sent from the Developers mailing list archive at Nabble.com.
> _______________________________________________ Devel mailing list
> Devel at owncloud.org
> http://mailman.owncloud.org/mailman/listinfo/devel




More information about the Devel mailing list