Discussion:
Kolab Webadmin -> run script
hede
2018-11-11 11:04:26 UTC
Permalink
Hi all,

does anybody know a simple way of triggering a shell script after changing something (ldap) within the Kolab Web Admin?

I would like to sync the available Email addresses from kolab to some other mail host – without using a direct ldap connection between those hosts.

regards
hede
Jan Kowalsky
2018-11-11 18:25:38 UTC
Permalink
Hi Hede,
Post by hede
does anybody know a simple way of triggering a shell script after changing something (ldap) within the Kolab Web Admin?
I would like to sync the available Email addresses from kolab to some other mail host – without using a direct ldap connection between those hosts.
I would start to search here:
https://git.kolab.org/diffusion/WAP/browse/master/lib/client/kolab_client_task_user.php

At least for adding users it is the right starting point. It should be
easy to trigger any command from inside the save function.

Another approach: search continuously for modified ldap entries with
ldapsearch and 'modifytimestamp=<SOMETHING'. If your ldap directory
isn't too big, it should be sufficient and you don't have to change the
kolab code (which could get broken after next update).

Regards
Jan
hede
2018-11-11 23:12:07 UTC
Permalink
Hi Jan,

thanks for your answer.
Post by Jan Kowalsky
https://git.kolab.org/diffusion/WAP/browse/master/lib/client/kolab_client_task_user.php
At least for adding users it is the right starting point. It should be
easy to trigger any command from inside the save function.
I think maybe I'll write some wrapper to net_ldap3's modify_entry function. Some static value plus a timer should help triggering only one event every x seconds regardless of the change count. This way it'll hit all kind of sources.
Post by Jan Kowalsky
Another approach: search continuously for modified ldap entries with
ldapsearch and 'modifytimestamp=<SOMETHING'. If your ldap directory
isn't too big, it should be sufficient and
I don't like busy waiting. I try to avoid it wherever possible.

Bummer: I realised even kolabd does use busy waiting and doesn't get triggered via events. :-(
Post by Jan Kowalsky
you don't have to change the
kolab code (which could get broken after next update).
That's indeed a good point. Maybe it's possible to create some kind of a "common plugin interface" which gets accepted upstream. ;-)

(... I don't think so; my spare time is quite limited at the moment)

regards
hede

Loading...