[kronolith] Automatically prepare Kronolith's search_sources

Fábio Sousa fabiojsousa at gmail.com
Thu May 30 13:28:46 UTC 2019


Hello,

Like I saw on ticket https://bugs.horde.org/ticket/14928 I've one 
similar problem, but my hook give me more information, give me the 
search_sources and the default fb_cals.

My hook configuration in kronolith/config/hooks.php:

<?PHP
class Kronolith_Hooks
{
      public function prefs_init($pref, $value, $username, $scope_ob)
      {
          if (is_null($username)) {    // not logged in
              return $value;
          }

          switch ($pref) {
          case 'search_sources':
                  $sources = $GLOBALS['registry']->call('contacts/sources');
                  $value = json_encode(array_keys($sources));
                  $scope_ob->set($pref, $value);
                  $scope_ob->setDirty($pref, true);
                  return $sources;

            case 'fb_cals':
                $fb_cals = 
@unserialize($GLOBALS['prefs']->getValue('fb_cals'));
                if (empty($fb_cals)) {
                  $display_calendars = 
@unserialize($GLOBALS['prefs']->getValue('display_cals'));
                  $fb_url = 'a:1:{i:0;s:32:"internal_' . 
$display_calendars[0] . '";}';
                  $GLOBALS['prefs']->setValue('fb_cals', $fb_url);
                  $scope_ob->set($pref, $cenas);
                  $scope_ob->setDirty($pref, true);
                }
                return $fb_cals;

          }
      }
}

Before this configuration I had my search_source configured manually to 
look only for my localldap configuration and that way my freebusy work fine.


After the search_sources implementation, when I made my appointments and 
when I'm checking the freebusy information is empty.

Any idea of what are happening?

Thank you.



More information about the kronolith mailing list