Merge branch '2013.10' into 2014.11
authorPhilipp Schüle <p.schuele@metaways.de>
Wed, 17 Dec 2014 15:57:50 +0000 (16:57 +0100)
committerPhilipp Schüle <p.schuele@metaways.de>
Wed, 17 Dec 2014 15:57:50 +0000 (16:57 +0100)
1  2 
tests/tine20/ActiveSync/Command/SyncTests.php
tine20/ActiveSync/Frontend/Abstract.php
tine20/ActiveSync/Server/Http.php
tine20/Calendar/Frontend/Cli.php
tine20/Tinebase/Config.php
tine20/Tinebase/Core.php
tine20/Tinebase/User.php

@@@ -173,35 -198,20 +173,27 @@@ class ActiveSync_Server_Http extends Ti
       */
      protected function _initializeRegistry()
      {
-         Syncroton_Registry::setDatabase(Tinebase_Core::getDb());
-         Syncroton_Registry::setTransactionManager(Tinebase_TransactionManager::getInstance());
-         
-         Syncroton_Registry::set(Syncroton_Registry::DEVICEBACKEND,       new Syncroton_Backend_Device(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_'));
-         Syncroton_Registry::set(Syncroton_Registry::FOLDERBACKEND,       new Syncroton_Backend_Folder(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_'));
-         Syncroton_Registry::set(Syncroton_Registry::SYNCSTATEBACKEND,    new Syncroton_Backend_SyncState(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_'));
-         Syncroton_Registry::set(Syncroton_Registry::CONTENTSTATEBACKEND, new Syncroton_Backend_Content(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_'));
-         Syncroton_Registry::set(Syncroton_Registry::POLICYBACKEND,       new Syncroton_Backend_Policy(Tinebase_Core::getDb(), SQL_TABLE_PREFIX . 'acsync_'));
-         Syncroton_Registry::set('loggerBackend',       Tinebase_Core::getLogger());
+         ActiveSync_Controller::initSyncrotonRegistry();
          
 -        if (Tinebase_Core::getUser()->hasRight('Addressbook', Tinebase_Acl_Rights::RUN) === true) {
 -            Syncroton_Registry::setContactsDataClass('ActiveSync_Controller_Contacts');
 -            Syncroton_Registry::setGALDataClass('ActiveSync_Controller_Contacts');
 +        $applications = is_object(Tinebase_Core::getUser())
 +            ? Tinebase_Core::getUser()->getApplications()
 +            : new Tinebase_Record_RecordSet('Tinebase_Model_Application');
 +        
 +        if ($applications->find('name', 'Addressbook')) {
 +            Syncroton_Registry::setContactsDataClass('Addressbook_Frontend_ActiveSync');
 +            Syncroton_Registry::setGALDataClass('Addressbook_Frontend_ActiveSync');
          }
 -        if (Tinebase_Core::getUser()->hasRight('Calendar', Tinebase_Acl_Rights::RUN) === true) {
 -            Syncroton_Registry::setCalendarDataClass('ActiveSync_Controller_Calendar');
 +        
 +        if ($applications->find('name', 'Calendar')) {
 +            Syncroton_Registry::setCalendarDataClass('Calendar_Frontend_ActiveSync');
          }
 -        if (Tinebase_Core::getUser()->hasRight('Felamimail', Tinebase_Acl_Rights::RUN) === true) {
 -            Syncroton_Registry::setEmailDataClass('ActiveSync_Controller_Email');
 +        
 +        if ($applications->find('name', 'Felamimail')) {
 +            Syncroton_Registry::setEmailDataClass('Felamimail_Frontend_ActiveSync');
          }
 -        if (Tinebase_Core::getUser()->hasRight('Tasks', Tinebase_Acl_Rights::RUN) === true) {
 -            Syncroton_Registry::setTasksDataClass('ActiveSync_Controller_Tasks');
 +        
 +        if ($applications->find('name', 'Tasks')) {
 +            Syncroton_Registry::setTasksDataClass('Tasks_Frontend_ActiveSync');
          }
          
          Syncroton_Registry::set(Syncroton_Registry::DEFAULT_POLICY, ActiveSync_Config::getInstance()->get(ActiveSync_Config::DEFAULT_POLICY));
Simple merge
Simple merge
Simple merge
Simple merge