[kronolith] using e-mail instead of username in free/busy URL
Michael J Rubinsky
mrubinsk at horde.org
Tue Jun 11 11:58:26 UTC 2019
Wrong hook...
--
Mike
Sent from mobile
________________________________
From: winnertako <fabiojsousa at gmail.com>
Sent: Tuesday, June 11, 2019 5:29 AM
To: kronolith at lists.horde.org
Subject: Re: [kronolith] using e-mail instead of username in free/busy URL
> Hi Jan,
>
> I have the hook configured but only field my Personal Information.
>
> <?php
> class Horde_Hooks
> {
> public function prefs_init($pref, $value, $username, $scope_ob)
> {
> switch ($pref) {
> case 'from_addr':
> if (is_null($username)) {
> return $value;
> }
> $searchBase = 'dc=domain,dc=com';
> $cmd = '/usr/bin/ldapsearch -ZZ -x -h auth.domain -b ' .
> $searchBase . ' uid=' . escapeshellcmd($username) . ' mail | /bin/grep mail:
> | /usr/bin/awk \'{print $2}\'';
> $mails = `$cmd`;
> $mail_array = explode("\n", $mails);
> $mail = $mail_array['0'];
> return empty($mail)
> ? ''
> : $mail;
>
> case 'fullname':
> if (is_null($username)) {
> return $value;
> }
> $searchBase = 'dc=domain,dc=com';
> $cmd = '/usr/bin/ldapsearch -ZZ -x -h auth.domain -b ' .
> $searchBase . ' uid=' . escapeshellcmd($username) . ' displayName |
> /bin/grep displayName: | /usr/bin/cut -c14-';
> $cns = `$cmd`;
> $cn_array = explode("\n", $cns);
> $cn = $cn_array['0'];
> return empty($cn)
> ? $username
> : $cn;
> }
> }
> }
> ?>
>
>
> For example if the name of my user is *nlastname* after the login the
> information are good *Name LastName <name.lastname at email.com>* but in the
> table *horde_pref* the preferences are saved with the id *nlastname*.
>
> If I logged in with the email *name.lastname at email.com* new preferences are
> created with the email address.
>
> What I'm missing?
>
> Thank you.
>
>
>
> --
> Sent from: http://horde.690.n7.nabble.com/Horde-Kronolith-f87467.html
> --
> kronolith mailing list
> Frequently Asked Questions: http://wiki.horde.org/FAQ
> To unsubscribe, mail: kronolith-unsubscribe at lists.horde.org
>
More information about the kronolith
mailing list