Re: using e-mail instead of username in free/busy URL
Michael J Rubinsky <[email protected]> Tue, 11 Jun 2019 11:58:26 +0000
| Newsgroups | gmane.comp.horde.kronolith |
|---|---|
| Message-ID | <20190611115826.Horde.4GUYRJ0OnbdLTRm4UKajuAm@tarn.theupstairsroom.com> |
Wrong hook... -- Mike Sent from mobile ________________________________ From: winnertako <[email protected]> Sent: Tuesday, June 11, 2019 5:29 AM To: [email protected] 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 <[email protected]>* but in the > table *horde_pref* the preferences are saved with the id *nlastname*. > > If I logged in with the email *[email protected]* 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: [email protected] > -- kronolith mailing list Frequently Asked Questions: http://wiki.horde.org/FAQ To unsubscribe, mail: [email protected]