Default fb_cals on first user login via hooks doesn't work right

winnertako <[email protected]> Tue, 11 Jun 2019 08:53:51 -0700 (MST)
Newsgroups gmane.comp.horde.kronolith
Message-ID <[email protected]>
Hello, 

I'm trying to initialize the free-busy information on users first login via
hooks. My hook: 

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

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

 		} 
 		return $fb_url; 
 	}
 }


I've one strange problem, when the user get is first login the free-busy
link is wrong *a:1:{i:0;s:32:"internal_";}*
but when the user do the second login the free-busy information get the
correct syntax  *a:1:{i:0;s:32:"internal_pZFqfLNIZnq_4Rm6je1d_aE";}*

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]