[kronolith] using e-mail instead of username in free/busy URL

winnertako fabiojsousa at gmail.com
Tue Jun 11 09:29:54 UTC 2019


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


More information about the kronolith mailing list