Merge branch '2016.11' into 2016.11-develop
[tine20] / tine20 / Tinebase / Config.php
1 <?php
2 /**
3  * Tine 2.0
4  * 
5  * @package     Tinebase
6  * @subpackage  Config
7  * @license     http://www.gnu.org/licenses/agpl.html AGPL Version 3
8  * @copyright   Copyright (c) 2007-2017 Metaways Infosystems GmbH (http://www.metaways.de)
9  * @author      Philipp Schüle <p.schuele@metaways.de>
10  * 
11  */
12
13 /**
14  * the class provides functions to handle config options
15  * 
16  * @package     Tinebase
17  * @subpackage  Config
18  * 
19  * @todo remove all deprecated stuff
20  */
21 class Tinebase_Config extends Tinebase_Config_Abstract
22 {
23     /**
24      * authentication backend config
25      *
26      * @var string
27      */
28     const AUTHENTICATIONBACKEND = 'Tinebase_Authentication_BackendConfiguration';
29
30     /**
31      * authentication backend type config
32      *
33      * @var string
34      */
35     const AUTHENTICATIONBACKENDTYPE = 'Tinebase_Authentication_BackendType';
36
37     /**
38      * authentication second factor
39      *
40      * @var string
41      */
42     const AUTHENTICATIONSECONDFACTOR = 'Tinebase_Authentication_SecondFactor';
43
44     /**
45      * authentication second factor protection for apps
46      *
47      * @var string
48      */
49     const SECONDFACTORPROTECTEDAPPS = 'Tinebase_Authentication_SecondFactor_Protected_Apps';
50
51     /**
52      * save automatic alarms when creating new record
53      *
54      * @var string
55      */
56     const AUTOMATICALARM = 'automaticalarm';
57
58     /**
59      * availableLanguages
60      *
61      * @var string
62      */
63     const AVAILABLE_LANGUAGES = 'availableLanguages';
64
65     /**
66      * DEFAULT_LOCALE
67      *
68      * @var string
69      */
70     const DEFAULT_LOCALE = 'defaultLocale';
71
72     /**
73      * default user role
74      */
75     const DEFAULT_USER_ROLE_NAME = 'defaultUserRoleName';
76
77     /**
78      * default user role
79      */
80     const DEFAULT_ADMIN_ROLE_NAME = 'defaulAdminRoleName';
81
82     /**
83      * INTERNET_PROXY
84      *
85      * @var string
86      */
87     const INTERNET_PROXY = 'internetProxy';
88
89     /**
90      * imap conf name
91      * 
92      * @var string
93      */
94     const IMAP = 'imap';
95     
96     /**
97      * smtp conf name
98      * 
99      * @var string
100      */
101     const SMTP = 'smtp';
102
103     /**
104      * sieve conf name
105      * 
106      * @var string
107      */
108     const SIEVE = 'sieve';
109
110     /**
111      * user backend config
112      * 
113      * @var string
114      */
115     const USERBACKEND = 'Tinebase_User_BackendConfiguration';
116
117     /**
118      * sync options for user backend
119      *
120      * @var string
121      */
122     const SYNCOPTIONS = 'syncOptions';
123
124     /**
125      * user backend type config
126      * 
127      * @var string
128      */
129     const USERBACKENDTYPE = 'Tinebase_User_BackendType';
130     
131     /**
132      * cronjob user id
133      * 
134      * @var string
135      */
136     const CRONUSERID = 'cronuserid';
137
138     /**
139      * setup user id
140      *
141      * @var string
142      */
143     const SETUPUSERID = 'setupuserid';
144
145     /**
146      * FEATURE_SHOW_ADVANCED_SEARCH
147      *
148      * @var string
149      */
150     const FEATURE_SHOW_ADVANCED_SEARCH = 'featureShowAdvancedSearch';
151
152     /**
153      * FEATURE_CONTAINER_CUSTOM_SORT
154      *
155      * @var string
156      */
157     const FEATURE_CONTAINER_CUSTOM_SORT = 'featureContainerCustomSort';
158
159     /**
160      * FEATURE_SHOW_ACCOUNT_EMAIL
161      *
162      * @var string
163      */
164     const FEATURE_SHOW_ACCOUNT_EMAIL = 'featureShowAccountEmail';
165
166     /**
167      * FEATURE_REMEMBER_POPUP_SIZE
168      *
169      * @var string
170      */
171     const FEATURE_REMEMBER_POPUP_SIZE = 'featureRememberPopupSize';
172
173     /**
174      * FEATURE_PATH
175      *
176      * @var string
177      */
178     const FEATURE_SEARCH_PATH = 'featureSearchPath';
179
180     /**
181      * user defined page title postfix for browser page title
182      * 
183      * @var string
184      */
185     const PAGETITLEPOSTFIX = 'pagetitlepostfix';
186
187     /**
188      * logout redirect url
189      * 
190      * @var string
191      */
192     const REDIRECTURL = 'redirectUrl';
193     
194     /**
195      * redirect always
196      * 
197      * @var string
198      */
199     const REDIRECTALWAYS = 'redirectAlways';
200     
201     /**
202      * Config key for Setting "Redirect to referring site if exists?"
203      * 
204      * @var string
205      */
206     const REDIRECTTOREFERRER = 'redirectToReferrer';
207     
208     /**
209      * Config key for configuring allowed origins of the json frontend
210      *  
211      * @var string
212      */
213     const ALLOWEDJSONORIGINS = 'allowedJsonOrigins';
214     
215     /**
216      * Config key for acceptedTermsVersion
217      * @var string
218      */
219     const ACCEPTEDTERMSVERSION = 'acceptedTermsVersion';
220     
221     /**
222      * Config key for map panel in addressbook / include geoext code
223      * @var string
224      */
225     const MAPPANEL = 'mapPanel';
226
227     /**
228      * disable ldap certificate check
229      *
230      * @var string
231      */
232     const LDAP_DISABLE_TLSREQCERT = 'ldapDisableTlsReqCert';
233
234     /**
235      * overwritten ldap fields
236      *
237      * @var string
238      */
239     const LDAP_OVERWRITE_CONTACT_FIELDS = 'ldapOverwriteContactFields';
240
241     /**
242      * configure hook class for user sync
243      *
244      * @var string
245      */
246     const SYNC_USER_HOOK_CLASS = 'syncUserHookClass';
247     
248     /**
249      * configure if user contact data should be synced from sync backend, default yes
250      *
251      * @var string
252      */
253     const SYNC_USER_CONTACT_DATA = 'syncUserContactData';
254
255     /**
256      * configure if user contact photo should be synced from sync backend, default yes
257      *
258      * @var string
259      */
260     const SYNC_USER_CONTACT_PHOTO = 'syncUserContactPhoto';
261
262     /**
263      * configure if deleted users from sync back should be deleted in sql backend, default yes
264      *
265      * @var string
266      */
267     const SYNC_DELETED_USER = 'syncDeletedUser';
268
269     /**
270      * configure when user should be removed from sql after it is removed from sync backend
271      *
272      * @var boolean
273      */
274     const SYNC_USER_DELETE_AFTER = 'syncUserDeleteAfter';
275
276     /**
277      * Config key for session ip validation -> if this is set to FALSE no Zend_Session_Validator_IpAddress is registered
278      * 
279      * @var string
280      */
281     const SESSIONIPVALIDATION = 'sessionIpValidation';
282     
283     /**
284      * Config key for session user agent validation -> if this is set to FALSE no Zend_Session_Validator_HttpUserAgent is registered
285      * 
286      * @var string
287      */
288     const SESSIONUSERAGENTVALIDATION = 'sessionUserAgentValidation';
289     
290     /**
291      * filestore directory
292      * 
293      * @var string
294      */
295     const FILESDIR = 'filesdir';
296     
297     /**
298      * xls export config
299      * 
300      * @deprecated move to app config
301      * @var string
302      */
303     const XLSEXPORTCONFIG = 'xlsexportconfig';
304     
305     /**
306      * app defaults
307      * 
308      * @deprecated move to app and split
309      * @var string
310      */
311     const APPDEFAULTS = 'appdefaults';
312     
313     /**
314     * REUSEUSERNAME_SAVEUSERNAME
315     *
316     * @var string
317     */
318     const REUSEUSERNAME_SAVEUSERNAME = 'saveusername';
319         
320     /**
321     * PASSWORD_CHANGE
322     *
323     * @var string
324     */
325     const PASSWORD_CHANGE = 'changepw';
326     
327     /**
328      * PASSWORD_POLICY_ACTIVE
329      *
330      * @var string
331      */
332     const PASSWORD_POLICY_ACTIVE = 'pwPolicyActive';
333     
334     /**
335      * PASSWORD_POLICY_ONLYASCII
336      *
337      * @var string
338      */
339     const PASSWORD_POLICY_ONLYASCII = 'pwPolicyOnlyASCII';
340     
341     /**
342      * PASSWORD_POLICY_MIN_LENGTH
343      *
344      * @var string
345      */
346     const PASSWORD_POLICY_MIN_LENGTH = 'pwPolicyMinLength';
347     
348     /**
349      * PASSWORD_POLICY_MIN_WORD_CHARS
350      *
351      * @var string
352      */
353     const PASSWORD_POLICY_MIN_WORD_CHARS = 'pwPolicyMinWordChars';
354     
355     /**
356      * PASSWORD_POLICY_MIN_UPPERCASE_CHARS
357      *
358      * @var string
359      */
360     const PASSWORD_POLICY_MIN_UPPERCASE_CHARS = 'pwPolicyMinUppercaseChars';
361     
362     /**
363      * PASSWORD_POLICY_MIN_SPECIAL_CHARS
364      *
365      * @var string
366      */
367     const PASSWORD_POLICY_MIN_SPECIAL_CHARS = 'pwPolicyMinSpecialChars';
368     
369     /**
370      * PASSWORD_POLICY_MIN_NUMBERS
371      *
372      * @var string
373      */
374     const PASSWORD_POLICY_MIN_NUMBERS = 'pwPolicyMinNumbers';
375     
376     /**
377      * PASSWORD_POLICY_FORBID_USERNAME
378      *
379      * @var string
380      */
381     const PASSWORD_POLICY_FORBID_USERNAME = 'pwPolicyForbidUsername';
382
383     /**
384      * PASSWORD_POLICY_CHANGE_AFTER
385      *
386      * @var string
387      */
388     const PASSWORD_POLICY_CHANGE_AFTER = 'pwPolicyChangeAfter';
389
390     /**
391      * AUTOMATIC_BUGREPORTS
392      *
393      * @var string
394      */
395     const AUTOMATIC_BUGREPORTS = 'automaticBugreports';
396     
397     /**
398      * LAST_SESSIONS_CLEANUP_RUN
399      *
400      * @var string
401      */
402     const LAST_SESSIONS_CLEANUP_RUN = 'lastSessionsCleanupRun';
403     
404     /**
405      * WARN_LOGIN_FAILURES
406      *
407      * @var string
408      */
409     const WARN_LOGIN_FAILURES = 'warnLoginFailures';
410      
411     /**
412      * ANYONE_ACCOUNT_DISABLED
413      *
414      * @var string
415      */
416     const ANYONE_ACCOUNT_DISABLED = 'anyoneAccountDisabled';
417     
418     /**
419      * ALARMS_EACH_JOB
420      *
421      * @var string
422      */
423     const ALARMS_EACH_JOB = 'alarmsEachJob';
424     
425     /**
426      * ACCOUNT_DEACTIVATION_NOTIFICATION
427      *
428      * @var string
429      */
430     const ACCOUNT_DEACTIVATION_NOTIFICATION = 'accountDeactivationNotification';
431
432     /**
433      * ACCOUNT_DELETION_EVENTCONFIGURATION
434      *
435      * @var string
436      */
437     const ACCOUNT_DELETION_EVENTCONFIGURATION = 'accountDeletionEventConfiguration';
438     
439     /**
440      * roleChangeAllowed
441      *
442      * @var string
443      */
444     const ROLE_CHANGE_ALLOWED = 'roleChangeAllowed';
445     
446     /**
447      * max username length
448      *
449      * @var string
450      */
451     const MAX_USERNAME_LENGTH = 'max_username_length';
452
453     /**
454      * conf.d folder name
455      *
456      * @var string
457      */
458     const CONFD_FOLDER = 'confdfolder';
459
460     /**
461      * maintenance mode
462      *
463      * @var string
464      */
465     const MAINTENANCE_MODE = 'maintenanceMode';
466
467     /**
468      * @var string
469      */
470     const FAT_CLIENT_CUSTOM_JS = 'fatClientCustomJS';
471     
472     const BRANDING_LOGO = 'branding_logo';
473     const BRANDING_FAVICON = 'branding_favicon';
474     const BRANDING_TITLE = 'branding_title';
475     const BRANDING_WEBURL = 'branding_weburl';
476     const BRANDING_DESCRIPTION = 'branding_description';
477
478     const CURRENCY_SYMBOL = 'currencySymbol';
479
480     /**
481      * @var string
482      */
483     const USE_LOGINNAME_AS_FOLDERNAME = 'useLoginnameAsFoldername';
484
485     /**
486      * @var string
487      */
488     const DENY_WEBDAV_CLIENT_LIST = 'denyWebDavClientList';
489
490     /**
491      * @var string
492      */
493     const VERSION_CHECK = 'versionCheck';
494
495     /**
496      * @var string
497      */
498     const REPLICATION_MASTER = 'replicationMaster';
499
500     /**
501      * @var string
502      */
503     const REPLICATION_SLAVE = 'replicationSlave';
504
505     /**
506      * @var string
507      */
508     const REPLICATION_USER_PASSWORD = 'replicationUserPassword';
509
510     /**
511      * @var string
512      */
513     const MASTER_URL = 'masterURL';
514
515     /**
516      * @var string
517      */
518     const MASTER_USERNAME = 'masterUsername';
519
520     /**
521      * @var string
522      */
523     const MASTER_PASSWORD = 'masterPassword';
524
525     /**
526      * @var string
527      */
528     const ERROR_NOTIFICATION_LIST = 'errorNotificationList';
529
530     const FULLTEXT = 'fulltext';
531     const FULLTEXT_BACKEND = 'backend';
532     const FULLTEXT_JAVABIN = 'javaBin';
533     const FULLTEXT_TIKAJAR = 'tikaJar';
534
535     const FILESYSTEM = 'filesystem';
536     const FILESYSTEM_MODLOGACTIVE = 'modLogActive';
537     const FILESYSTEM_NUMKEEPREVISIONS = 'numKeepRevisions';
538     const FILESYSTEM_MONTHKEEPREVISIONS = 'monthKeepRevisions';
539     const FILESYSTEM_INDEX_CONTENT = 'index_content';
540     const FILESYSTEM_CREATE_PREVIEWS = 'createPreviews';
541     const FILESYSTEM_PREVIEW_SERVICE_URL = 'previewServiceUrl';
542     const FILESYSTEM_ENABLE_NOTIFICATIONS = 'enableNotifications';
543
544     const ACTIONQUEUE = 'actionqueue';
545     const ACTIONQUEUE_BACKEND = 'backend';
546     const ACTIONQUEUE_ACTIVE = 'active';
547     const ACTIONQUEUE_HOST = 'host';
548     const ACTIONQUEUE_PORT = 'port';
549     const ACTIONQUEUE_NAME = 'queueName';
550
551     const QUOTA = 'quota';
552     const QUOTA_INCLUDE_REVISION = 'includeRevision';
553     const QUOTA_TOTALINMB = 'totalInMB';
554     const QUOTA_TOTALBYUSERINMB = 'totalByUserInMB';
555     const QUOTA_SOFT_QUOTA = 'softQuota';
556     const QUOTA_SQ_NOTIFICATION_ROLE = 'softQuotaNotificationRole';
557
558
559     /**
560      * (non-PHPdoc)
561      * @see tine20/Tinebase/Config/Definition::$_properties
562      */
563     protected static $_properties = array(
564         /**
565          * possible values:
566          *
567          * $_deletePersonalContainers => delete personal containers
568          * $_keepAsContact => keep "account" as contact in the addressbook
569          * $_keepOrganizerEvents => keep accounts organizer events as external events in the calendar
570          * $_keepAsContact => keep accounts calender event attendee as external attendee
571          *
572          * TODO add more options (like move to another container)
573          */
574         self::ACCOUNT_DELETION_EVENTCONFIGURATION => array(
575             //_('Account Deletion Event')
576             'label'                 => 'Account Deletion Event',
577             //_('Configure what should happen to data of deleted users')
578             'description'           => 'Configure what should happen to data of deleted users',
579             'type'                  => 'object',
580             'class'                 => 'Tinebase_Config_Struct',
581             'clientRegistryInclude' => FALSE,
582             'setByAdminModule'      => TRUE,
583             'setBySetupModule'      => TRUE,
584         ),
585         /**
586          * for example: array('en', 'de')
587          */
588         self::AVAILABLE_LANGUAGES => array(
589             //_('Available Languages')
590             'label'                 => 'Available Languages',
591             //_('Whitelist available languages that can be chosen in the GUI')
592             'description'           => 'Whitelist available languages that can be chosen in the GUI',
593             'type'                  => 'array',
594             'clientRegistryInclude' => TRUE,
595             'setByAdminModule'      => TRUE,
596             'setBySetupModule'      => TRUE,
597         ),
598         /**
599          * for example: 'de'
600          */
601         self::DEFAULT_LOCALE => array(
602             //_('Default Locale')
603             'label'                 => 'Default Locale',
604             //_('Default locale for this installation.')
605             'description'           => 'Default locale for this installation.',
606             'type'                  => 'string',
607             'default'               => 'en',
608             'clientRegistryInclude' => TRUE,
609             'setByAdminModule'      => FALSE,
610             'setBySetupModule'      => TRUE,
611         ),
612         /**
613          * config keys (see Zend_Http_Client_Adapter_Proxy):
614          *
615          * 'proxy_host' => 'proxy.com',
616          * 'proxy_port' => 3128,
617          * 'proxy_user' => 'user',
618          * 'proxy_pass' => 'pass'
619          */
620         self::INTERNET_PROXY => array(
621             //_('Internet proxy config')
622             'label'                 => 'Internet proxy config',
623             'description'           => 'Internet proxy config',
624             'type'                  => 'array',
625             'default'               => array(),
626             'clientRegistryInclude' => false,
627             'setByAdminModule'      => true,
628             'setBySetupModule'      => true,
629         ),
630         /**
631          * config keys:
632          *
633          * useSystemAccount (bool)
634          * domain (string)
635          * instanceName (string)
636          * useEmailAsUsername (bool)
637          * host (string)
638          * port (integer)
639          * ssl (bool)
640          * user (string) ?
641          * backend (string) - see Tinebase_EmailUser::$_supportedBackends
642          * verifyPeer (bool)
643          */
644         self::IMAP => array(
645                                    //_('System IMAP')
646             'label'                 => 'System IMAP',
647                                    //_('System IMAP server configuration.')
648             'description'           => 'System IMAP server configuration.',
649             'type'                  => 'object',
650             'class'                 => 'Tinebase_Config_Struct',
651             'clientRegistryInclude' => FALSE,
652             'setByAdminModule'      => FALSE,
653             'setBySetupModule'      => TRUE,
654         ),
655         self::SMTP => array(
656                                    //_('System SMTP')
657             'label'                 => 'System SMTP',
658                                    //_('System SMTP server configuration.')
659             'description'           => 'System SMTP server configuration.',
660             'type'                  => 'object',
661             'class'                 => 'Tinebase_Config_Struct',
662             'clientRegistryInclude' => FALSE,
663             'setByAdminModule'      => FALSE,
664             'setBySetupModule'      => TRUE,
665         ),
666         self::SIEVE => array(
667                                    //_('System SIEVE')
668             'label'                 => 'System SIEVE',
669                                    //_('System SIEVE server configuration.')
670             'description'           => 'System SIEVE server configuration.',
671             'type'                  => 'object',
672             'class'                 => 'Tinebase_Config_Struct',
673             'clientRegistryInclude' => FALSE,
674             'setByAdminModule'      => FALSE,
675             'setBySetupModule'      => TRUE,
676         ),
677         self::AUTHENTICATIONBACKENDTYPE => array(
678                                    //_('Authentication Backend')
679             'label'                 => 'Authentication Backend',
680                                    //_('Backend adapter for user authentication.')
681             'description'           => 'Backend adapter for user authentication.',
682             'type'                  => 'string',
683             'clientRegistryInclude' => FALSE,
684             'setByAdminModule'      => FALSE,
685             'setBySetupModule'      => TRUE,
686         ),
687         self::AUTHENTICATIONBACKEND => array(
688                                    //_('Authentication Configuration')
689             'label'                 => 'Authentication Configuration',
690                                    //_('Authentication backend configuration.')
691             'description'           => 'Authentication backend configuration.',
692             'type'                  => 'object',
693             'class'                 => 'Tinebase_Config_Struct',
694             'clientRegistryInclude' => FALSE,
695             'setByAdminModule'      => FALSE,
696             'setBySetupModule'      => TRUE,
697         ),
698         /**
699          * example config:
700          *
701          * array(
702          *      'active'                => true,
703          *      'provider'              => 'PrivacyIdea',
704          *      'url'                   => 'https://localhost/validate/check',
705          *      'allow_self_signed'     => true,
706          *      'ignorePeerName'        => true,
707          *      'login'                 => true, // validate during login + show field on login screen
708          *      'sessionLifetime'       => 15 // minutes
709          * )
710          */
711         self::AUTHENTICATIONSECONDFACTOR => array(
712             //_('Second Factor Authentication Configuration')
713             'label'                 => 'Second Factor Authentication Configuration',
714             'description'           => 'Second Factor Authentication Configuration',
715             'type'                  => 'object',
716             'class'                 => 'Tinebase_Config_Struct',
717             'clientRegistryInclude' => FALSE,
718             'setByAdminModule'      => FALSE,
719             'setBySetupModule'      => TRUE,
720         ),
721         self::SECONDFACTORPROTECTEDAPPS => array(
722             //_('Second Factor Protected Applications')
723             'label'                 => 'Second Factor Protected Applications',
724             //_('Second Factor Authentication is needed to access these applications')
725             'description'           => 'Second Factor Authentication is needed to access these applications',
726             'type'                  => 'array',
727             'clientRegistryInclude' => true,
728             'setByAdminModule'      => false,
729             'setBySetupModule'      => true,
730         ),
731         self::USERBACKENDTYPE => array(
732                                    //_('User Backend')
733             'label'                 => 'User Backend',
734                                    //_('Backend adapter for user data.')
735             'description'           => 'Backend adapter for user data.',
736             'type'                  => 'string',
737             'clientRegistryInclude' => FALSE,
738             'setByAdminModule'      => FALSE,
739             'setBySetupModule'      => TRUE,
740         ),
741         self::REPLICATION_MASTER => array(
742             //_('Replication master configuration')
743             'label'                 => 'Replication master configuration',
744             //_('Replication master configuration.')
745             'description'           => 'Replication master configuration.',
746             'type'                  => 'object',
747             'class'                 => 'Tinebase_Config_Struct',
748             'clientRegistryInclude' => FALSE,
749             'setByAdminModule'      => FALSE,
750             'setBySetupModule'      => TRUE,
751             'content'               => array(
752                 self::REPLICATION_USER_PASSWORD     => array(
753                     'type'                              => Tinebase_Config::TYPE_STRING
754                 )
755             ),
756         ),
757         self::REPLICATION_SLAVE => array(
758             //_('Replication slave configuration')
759             'label'                 => 'Replication slave configuration',
760             //_('Replication slave configuration.')
761             'description'           => 'Replication slave configuration.',
762             'type'                  => 'object',
763             'class'                 => 'Tinebase_Config_Struct',
764             'clientRegistryInclude' => FALSE,
765             'setByAdminModule'      => FALSE,
766             'setBySetupModule'      => TRUE,
767             'content'               => array(
768                 self::MASTER_URL                => array(
769                     'type'                          => Tinebase_Config::TYPE_STRING,
770                 ),
771                 self::MASTER_USERNAME           => array(
772                     'type'                          => Tinebase_Config::TYPE_STRING,
773                 ),
774                 self::MASTER_PASSWORD           => array(
775                     'type'                          => Tinebase_Config::TYPE_STRING,
776                 ),
777                 self::ERROR_NOTIFICATION_LIST   => array(
778                     'type'                          => Tinebase_Config::TYPE_ARRAY,
779                 )
780             )
781         ),
782         self::FULLTEXT => array(
783             //_('Full text configuration')
784             'label'                 => 'Full text configuration',
785             //_('Full text configuration.')
786             'description'           => 'Full text configuration.',
787             'type'                  => 'object',
788             'class'                 => 'Tinebase_Config_Struct',
789             'clientRegistryInclude' => FALSE,
790             'setByAdminModule'      => FALSE,
791             'setBySetupModule'      => TRUE,
792             'content'               => array(
793                 self::FULLTEXT_BACKEND          => array(
794                     'type'                              => Tinebase_Config::TYPE_STRING,
795                     'default'                           => 'Sql'
796                 ),
797                 self::FULLTEXT_JAVABIN          => array(
798                     'type'                              => Tinebase_Config::TYPE_STRING,
799                     'default'                           => 'java'
800                 ),
801                 self::FULLTEXT_TIKAJAR          => array(
802                     'type'                              => Tinebase_Config::TYPE_STRING,
803                 ),
804             ),
805             'default'                           => array()
806         ),
807         self::ACTIONQUEUE => array(
808             //_('Action queue configuration')
809             'label'                 => 'Action queue configuration',
810             //_('Action queue configuration.')
811             'description'           => 'Action queue configuration.',
812             'type'                  => 'object',
813             'class'                 => 'Tinebase_Config_Struct',
814             'clientRegistryInclude' => FALSE,
815             'setByAdminModule'      => FALSE,
816             'setBySetupModule'      => TRUE,
817             'content'               => array(
818                 self::ACTIONQUEUE_BACKEND       => array(
819                     'type'                              => Tinebase_Config::TYPE_STRING,
820                     'default'                           => 'Direct'
821                 ),
822                 self::ACTIONQUEUE_ACTIVE       => array(
823                     'type'                              => Tinebase_Config::TYPE_BOOL,
824                     'default'                           => false
825                 ),
826                 self::ACTIONQUEUE_HOST       => array(
827                     'type'                              => Tinebase_Config::TYPE_STRING,
828                     'default'                           => 'localhost'
829                 ),
830                 self::ACTIONQUEUE_PORT       => array(
831                     'type'                              => Tinebase_Config::TYPE_INT,
832                     'default'                           => 6379
833                 ),
834                 self::ACTIONQUEUE_NAME       => array(
835                     'type'                              => Tinebase_Config::TYPE_STRING,
836                     'default'                           => 'TinebaseQueue'
837                 ),
838             ),
839             'default'                           => array()
840         ),
841         self::USERBACKEND => array(
842                                    //_('User Configuration')
843             'label'                 => 'User Configuration',
844                                    //_('User backend configuration.')
845             'description'           => 'User backend configuration.',
846             'type'                  => 'object',
847             'class'                 => 'Tinebase_Config_Struct',
848             'clientRegistryInclude' => FALSE,
849             'setByAdminModule'      => FALSE,
850             'setBySetupModule'      => TRUE,
851             'content'               => array(
852                 Tinebase_User::DEFAULT_USER_GROUP_NAME_KEY => array(
853                     'type'                      => Tinebase_Config::TYPE_STRING,
854                 ),
855                 Tinebase_User::DEFAULT_ADMIN_GROUP_NAME_KEY => array(
856                     'type'                      => Tinebase_Config::TYPE_STRING,
857                 ),
858                 'host'                      => array(
859                     'type'                      => Tinebase_Config::TYPE_STRING,
860                 ),
861                 'port'                      => array(
862                     'type'                      => Tinebase_Config::TYPE_INT,
863                 ),
864                 'useSsl'                    => array(
865                     'type'                      => Tinebase_Config::TYPE_BOOL,
866                 ),
867                 'username'                  => array(
868                     'type'                      => Tinebase_Config::TYPE_STRING,
869                 ),
870                 'password'                  => array(
871                     'type'                      => Tinebase_Config::TYPE_STRING,
872                 ),
873                 'bindRequiresDn'            => array(
874                     'type'                      => Tinebase_Config::TYPE_BOOL,
875                 ),
876                 'baseDn'                    => array(
877                     'type'                      => Tinebase_Config::TYPE_STRING,
878                 ),
879                 'accountCanonicalForm'      => array(
880                     'type'                      => Tinebase_Config::TYPE_STRING,
881                 ),
882                 'accountDomainName'         => array(
883                     'type'                      => Tinebase_Config::TYPE_STRING,
884                 ),
885                 'accountDomainNameShort'    => array(
886                     'type'                      => Tinebase_Config::TYPE_STRING,
887                 ),
888                 'accountFilterFormat'       => array(
889                     'type'                      => Tinebase_Config::TYPE_STRING,
890                 ),
891                 'allowEmptyPassword'        => array(
892                     'type'                      => Tinebase_Config::TYPE_STRING,
893                 ),
894                 'useStartTls'               => array(
895                     'type'                      => Tinebase_Config::TYPE_BOOL,
896                 ),
897                 'optReferrals'              => array(
898                     'type'                      => Tinebase_Config::TYPE_STRING,
899                 ),
900                 'tryUsernameSplit'          => array(
901                     'type'                      => Tinebase_Config::TYPE_BOOL,
902                 ),
903                 'groupUUIDAttribute'        => array(
904                     'type'                      => Tinebase_Config::TYPE_STRING,
905                 ),
906                 'groupsDn'                  => array(
907                     'type'                      => Tinebase_Config::TYPE_STRING,
908                 ),
909                 'useRfc2307bis'             => array(
910                     'type'                      => Tinebase_Config::TYPE_BOOL,
911                 ),
912                 'userDn'                    => array(
913                     'type'                      => Tinebase_Config::TYPE_STRING,
914                 ),
915                 'userFilter'                => array(
916                     'type'                      => Tinebase_Config::TYPE_STRING,
917                 ),
918                 'userSearchScope'           => array(
919                     'type'                      => Tinebase_Config::TYPE_STRING,
920                 ),
921                 'groupFilter'               => array(
922                     'type'                      => Tinebase_Config::TYPE_STRING,
923                 ),
924                 'groupSearchScope'          => array(
925                     'type'                      => Tinebase_Config::TYPE_STRING,
926                 ),
927                 'pwEncType'                 => array(
928                     'type'                      => Tinebase_Config::TYPE_STRING,
929                 ),
930                 'minUserId'                 => array(
931                     'type'                      => Tinebase_Config::TYPE_INT,
932                 ),
933                 'maxUserId'                 => array(
934                     'type'                      => Tinebase_Config::TYPE_INT,
935                 ),
936                 'minGroupId'                => array(
937                     'type'                      => Tinebase_Config::TYPE_INT,
938                 ),
939                 'maxGroupId'                => array(
940                     'type'                      => Tinebase_Config::TYPE_INT,
941                 ),
942                 'userUUIDAttribute'         => array(
943                     'type'                      => Tinebase_Config::TYPE_STRING,
944                 ),
945                 'readonly'                  => array(
946                     'type'                      => Tinebase_Config::TYPE_BOOL,
947                 ),
948                 'useRfc2307'                => array(
949                     'type'                      => Tinebase_Config::TYPE_BOOL,
950                 ),
951                 self::SYNCOPTIONS           => array(
952                     'type'                      => 'object',
953                     'class'                     => 'Tinebase_Config_Struct',
954                     'content'                   => array(
955                         self::SYNC_USER_CONTACT_DATA => array(
956                             //_('Sync contact data from sync backend')
957                             'label'                 => 'Sync contact data from sync backend',
958                             //_('Sync user contact data from sync backend')
959                             'description'           => 'Sync user contact data from sync backend',
960                             'type'                  => 'bool',
961                             'clientRegistryInclude' => FALSE,
962                             'setByAdminModule'      => FALSE,
963                             'setBySetupModule'      => FALSE,
964                             'default'               => TRUE
965                         ),
966                         self::SYNC_USER_CONTACT_PHOTO => array(
967                             //_('Sync contact photo from sync backend')
968                             'label'                 => 'Sync contact photo from sync backend',
969                             //_('Sync user contact photo from sync backend')
970                             'description'           => 'Sync user contact photo from sync backend',
971                             'type'                  => 'bool',
972                             'clientRegistryInclude' => FALSE,
973                             'setByAdminModule'      => FALSE,
974                             'setBySetupModule'      => FALSE,
975                             'default'               => TRUE
976                         ),
977                         self::SYNC_DELETED_USER => array(
978                             //_('Sync deleted users from sync backend')
979                             'label'                 => 'Sync deleted users from sync backend',
980                             //_('Sync deleted users from sync backend')
981                             'description'           => 'Sync deleted users from sync backend',
982                             'type'                  => 'bool',
983                             'clientRegistryInclude' => FALSE,
984                             'setByAdminModule'      => FALSE,
985                             'setBySetupModule'      => FALSE,
986                             'default'               => TRUE
987                         ),
988                     ),
989                     'default'                   => array(),
990                 ),
991             ),
992         ),
993         self::ENABLED_FEATURES => array(
994             //_('Enabled Features')
995             'label'                 => 'Enabled Features',
996             'description'           => 'Enabled Features',
997             'type'                  => 'object',
998             'class'                 => 'Tinebase_Config_Struct',
999             'clientRegistryInclude' => TRUE,
1000             'content'               => array(
1001                 self::FEATURE_SHOW_ADVANCED_SEARCH => array(
1002                     'label'         => 'Show Advanced Search', //_('Show Advanced Search')
1003                     'description'   => 'Show toggle button to switch on or off the advanced search for the quickfilter',
1004                     //_('Show toggle button to switch on or off the advanced search for the quickfilter')
1005                 ),
1006                 self::FEATURE_CONTAINER_CUSTOM_SORT => array(
1007                     'label'         => 'Container Custom Sort', //_('Container Custom Sort')
1008                     'description'   => 'Allows to sort containers by setting the sort order in Admin/Container',
1009                     //_('Allows to sort containers by setting the sort order in Admin/Container')
1010                 ),
1011                 self::FEATURE_SHOW_ACCOUNT_EMAIL => array(
1012                     'label'         => 'Show Account Email Address', //_('Show Account Email Address')
1013                     'description'   => 'Show email address in account picker and attendee grids',
1014                     //_('Show email address in account picker and attendee grids')
1015                 ),
1016                 self::FEATURE_REMEMBER_POPUP_SIZE => array(
1017                     'label'         => 'Remeber Popup Size', //_('Remeber Popup Size')
1018                     'description'   => 'Save edit dialog size in state',
1019                     //_('Save edit dialog size in state')
1020                 ),
1021                 self::FEATURE_SEARCH_PATH => array(
1022                     'label'         => 'Search Paths',
1023                     'description'   => 'Search Paths'
1024                 ),
1025             ),
1026             'default'               => array(
1027                 self::FEATURE_SHOW_ADVANCED_SEARCH  => true,
1028                 self::FEATURE_CONTAINER_CUSTOM_SORT => true,
1029                 self::FEATURE_SHOW_ACCOUNT_EMAIL    => true,
1030                 self::FEATURE_REMEMBER_POPUP_SIZE   => true,
1031                 self::FEATURE_SEARCH_PATH           => true,
1032
1033             ),
1034         ),
1035         self::DEFAULT_ADMIN_ROLE_NAME => array(
1036             //_('Default Admin Role Name')
1037             'label'                 => 'Default Admin Role Name',
1038             'description'           => 'Default Admin Role Name',
1039             'type'                  => 'string',
1040             'clientRegistryInclude' => false,
1041             'setByAdminModule'      => false,
1042             'setBySetupModule'      => true,
1043             'default'               => 'admin role'
1044         ),
1045         self::DEFAULT_USER_ROLE_NAME => array(
1046             //_('Default User Role Name')
1047             'label'                 => 'Default User Role Name',
1048             'description'           => 'Default User Role Name',
1049             'type'                  => 'string',
1050             'clientRegistryInclude' => false,
1051             'setByAdminModule'      => false,
1052             'setBySetupModule'      => true,
1053             'default'               => 'user role'
1054         ),
1055         self::CRONUSERID => array(
1056                                    //_('Cronuser ID')
1057             'label'                 => 'Cronuser ID',
1058                                    //_('User ID of the cron user.')
1059             'description'           => 'User ID of the cron user.',
1060             'type'                  => 'string',
1061             'clientRegistryInclude' => FALSE,
1062             'setByAdminModule'      => TRUE,
1063             'setBySetupModule'      => TRUE,
1064         ),
1065         self::PAGETITLEPOSTFIX => array(
1066                                    //_('Title Postfix')
1067             'label'                 => 'Title Postfix',
1068                                    //_('Postfix string appended to the title of this installation.')
1069             'description'           => 'Postfix string appended to the title of this installation.',
1070             'type'                  => 'string',
1071             'clientRegistryInclude' => FALSE,
1072             'setByAdminModule'      => TRUE,
1073             'setBySetupModule'      => TRUE,
1074         ),
1075         self::REDIRECTURL => array(
1076                                    //_('Redirect URL')
1077             'label'                 => 'Redirect URL',
1078                                    //_('Redirect to this URL after logout.')
1079             'description'           => 'Redirect to this URL after logout.',
1080             'type'                  => 'string',
1081             'clientRegistryInclude' => FALSE,
1082             'setByAdminModule'      => FALSE,
1083             'setBySetupModule'      => TRUE,
1084         ),
1085         self::REDIRECTTOREFERRER => array(
1086                                    //_('Redirect to Referrer')
1087             'label'                 => 'Redirect to Referrer',
1088                                    //_('Redirect to referrer after logout.')
1089             'description'           => 'Redirect to referrer after logout.',
1090             'type'                  => 'bool',
1091             'clientRegistryInclude' => FALSE,
1092             'setByAdminModule'      => FALSE,
1093             'setBySetupModule'      => TRUE,
1094         ),
1095         self::REDIRECTALWAYS => array(
1096                                    //_('Redirect Always')
1097             'label'                 => 'Redirect Always',
1098                                    //_('Redirect to configured redirect URL also for login.')
1099             'description'           => 'Redirect to configured redirect URL also for login.',
1100             'type'                  => 'bool',
1101             'clientRegistryInclude' => FALSE,
1102             'setByAdminModule'      => FALSE,
1103             'setBySetupModule'      => TRUE,
1104         ),
1105         self::ALLOWEDJSONORIGINS => array(
1106                                    //_('Allowed Origins')
1107             'label'                 => 'Allowed Origins',
1108                                    //_('Allowed Origins for the JSON API.')
1109             'description'           => 'Allowed Origins for the JSON API.',
1110             'type'                  => 'array',
1111             'clientRegistryInclude' => FALSE,
1112             'setByAdminModule'      => FALSE,
1113             'setBySetupModule'      => FALSE,
1114         ),
1115         self::ACCEPTEDTERMSVERSION => array(
1116                                    //_('Accepted Terms Version')
1117             'label'                 => 'Accepted Terms Version',
1118                                    //_('Accepted version number of the terms and conditions document.')
1119             'description'           => 'Accepted version number of the terms and conditions document.',
1120             'type'                  => 'int',
1121             'clientRegistryInclude' => FALSE,
1122             'setByAdminModule'      => FALSE,
1123             'setBySetupModule'      => FALSE,
1124         ),
1125         self::MAPPANEL => array(
1126                                    //_('Use Geolocation Services')
1127             'label'                 => 'Use Geolocation Services',
1128                                    //_('Use of external Geolocation services is allowed.')
1129             'description'           => 'Use of external Geolocation services is allowed.',
1130             'type'                  => 'bool',
1131             'clientRegistryInclude' => true,
1132             'setByAdminModule'      => false,
1133             'setBySetupModule'      => true,
1134             'default'               => true,
1135         ),
1136         // TODO should this be added to LDAP config array/struct?
1137         self::LDAP_DISABLE_TLSREQCERT => array(
1138                                    //_('Disable LDAP TLS Certificate Check')
1139             'label'                 => 'Disable LDAP TLS Certificate Check',
1140                                    //_('LDAP TLS Certificate should not be checked')
1141             'description'           => 'LDAP TLS Certificate should not be checked',
1142             'type'                  => 'bool',
1143             'clientRegistryInclude' => false,
1144             'setByAdminModule'      => false,
1145             'setBySetupModule'      => true,
1146             'default'               => false
1147         ),
1148         // TODO should this be added to LDAP config array/struct?
1149         // TODO does this depend on LDAP readonly option?
1150         self::LDAP_OVERWRITE_CONTACT_FIELDS => array(
1151             //_('Contact fields overwritten by LDAP')
1152             'label'                 => 'Contact fields overwritten by LDAP',
1153             //_('These fields are overwritten during LDAP sync if empty')
1154             'description'           => 'These fields are overwritten during LDAP sync if empty',
1155             'type'                  => 'array',
1156             'clientRegistryInclude' => false,
1157             'setByAdminModule'      => false,
1158             'setBySetupModule'      => true,
1159             'default'               => array()
1160         ),
1161         self::SYNC_USER_HOOK_CLASS => array(
1162                                    //_('Configure hook class for user sync')
1163             'label'                 => 'Configure hook class for user sync',
1164                                    //_('Allows to change data after fetching user from sync backend')
1165             'description'           => 'Allows to change data after fetching user from sync backend',
1166             'type'                  => 'string',
1167             'clientRegistryInclude' => false,
1168             'setByAdminModule'      => false,
1169             'setBySetupModule'      => true,
1170         ),
1171         self::SYNC_USER_CONTACT_DATA => array(
1172             //_('Sync contact data from sync backend')
1173             'label'                 => 'Sync contact data from sync backend',
1174             //_('Sync user contact data from sync backend')
1175             'description'           => 'Sync user contact data from sync backend',
1176             'type'                  => 'bool',
1177             'clientRegistryInclude' => FALSE,
1178             'setByAdminModule'      => FALSE,
1179             'setBySetupModule'      => FALSE,
1180             'default'               => TRUE
1181         ),
1182         self::SYNC_USER_DELETE_AFTER => array(
1183             //_('Sync user: delete after X months)
1184             'label'                 => 'Sync user: delete after X months',
1185             //_('Removed users should be deleted after X months')
1186             'description'           => 'Removed users should be deleted after X months',
1187             'type'                  => 'integer',
1188             'clientRegistryInclude' => FALSE,
1189             'setByAdminModule'      => FALSE,
1190             'setBySetupModule'      => FALSE,
1191             'default'               => 12,
1192         ),
1193         self::SESSIONIPVALIDATION => array(
1194                                    //_('IP Session Validator')
1195             'label'                 => 'IP Session Validator',
1196                                    //_('Destroy session if the users IP changes.')
1197             'description'           => 'Destroy session if the users IP changes.',
1198             'type'                  => 'bool',
1199             'clientRegistryInclude' => FALSE,
1200             'setByAdminModule'      => FALSE,
1201             'setBySetupModule'      => TRUE,
1202         ),
1203         self::SESSIONUSERAGENTVALIDATION => array(
1204                                    //_('UA Session Validator')
1205             'label'                 => 'UA Session Validator',
1206                                    //_('Destroy session if the users user agent string changes.')
1207             'description'           => 'Destroy session if the users user agent string changes.',
1208             'type'                  => 'bool',
1209             'clientRegistryInclude' => FALSE,
1210             'setByAdminModule'      => FALSE,
1211             'setBySetupModule'      => TRUE,
1212         ),
1213         // TODO move to FILESYSTEM
1214         self::FILESDIR => array(
1215                                    //_('Files Directory')
1216             'label'                 => 'Files Directory',
1217                                    //_('Directory with web server write access for user files.')
1218             'description'           => 'Directory with web server write access for user files.',
1219             'type'                  => 'string',
1220             'clientRegistryInclude' => FALSE,
1221             'setByAdminModule'      => FALSE,
1222             'setBySetupModule'      => TRUE,
1223         ),
1224         self::REUSEUSERNAME_SAVEUSERNAME => array(
1225             //_('Reuse last username logged')
1226             'label'                 => 'Reuse last username logged',
1227             //_('Reuse last username logged')            
1228             'description'           => 'Reuse last username logged',
1229             'type'                  => 'bool',
1230             'clientRegistryInclude' => FALSE,
1231             'setByAdminModule'      => FALSE,
1232             'setBySetupModule'      => TRUE,
1233         ),
1234         self::PASSWORD_CHANGE => array(
1235         //_('User may change password')
1236             'label'                 => 'User may change password',
1237         //_('User may change password')
1238             'description'           => 'User may change password',
1239             'type'                  => 'bool',
1240             'clientRegistryInclude' => TRUE,
1241             'setByAdminModule'      => FALSE,
1242             'setBySetupModule'      => TRUE,
1243             'default'               => TRUE
1244         ),
1245         self::PASSWORD_POLICY_ACTIVE => array(
1246         //_('Enable password policy')
1247             'label'                 => 'Enable password policy',
1248         //_('Enable password policy')
1249             'description'           => 'Enable password policy',
1250             'type'                  => 'bool',
1251             'clientRegistryInclude' => TRUE,
1252             'setByAdminModule'      => FALSE,
1253             'setBySetupModule'      => TRUE,
1254         ),
1255         self::PASSWORD_POLICY_ONLYASCII => array(
1256         //_('Only ASCII')
1257             'label'                 => 'Only ASCII',
1258         //_('Only ASCII characters are allowed in passwords.')
1259             'description'           => 'Only ASCII characters are allowed in passwords.',
1260             'type'                  => 'bool',
1261             'clientRegistryInclude' => FALSE,
1262             'setByAdminModule'      => FALSE,
1263             'setBySetupModule'      => TRUE,
1264         ),
1265         self::PASSWORD_POLICY_MIN_LENGTH => array(
1266         //_('Minimum length')
1267             'label'                 => 'Minimum length',
1268         //_('Minimum password length')
1269             'description'           => 'Minimum password length.',
1270             'type'                  => 'int',
1271             'clientRegistryInclude' => TRUE,
1272             'setByAdminModule'      => FALSE,
1273             'setBySetupModule'      => TRUE,
1274         ),
1275         self::PASSWORD_POLICY_MIN_WORD_CHARS => array(
1276         //_('Minimum word chars')
1277             'label'                 => 'Minimum word chars',
1278         //_('Minimum word chars in password')
1279             'description'           => 'Minimum word chars in password',
1280             'type'                  => 'int',
1281             'clientRegistryInclude' => TRUE,
1282             'setByAdminModule'      => FALSE,
1283             'setBySetupModule'      => TRUE,
1284         ),
1285         self::PASSWORD_POLICY_MIN_UPPERCASE_CHARS => array(
1286         //_('Minimum uppercase chars')
1287             'label'                 => 'Minimum uppercase chars',
1288         //_('Minimum uppercase chars in password')
1289             'description'           => 'Minimum uppercase chars in password',
1290             'type'                  => 'int',
1291             'clientRegistryInclude' => TRUE,
1292             'setByAdminModule'      => FALSE,
1293             'setBySetupModule'      => TRUE,
1294         ),
1295         self::PASSWORD_POLICY_MIN_SPECIAL_CHARS => array(
1296         //_('Minimum special chars')
1297             'label'                 => 'Minimum special chars',
1298         //_('Minimum special chars in password')
1299             'description'           => 'Minimum special chars in password',
1300             'type'                  => 'int',
1301             'clientRegistryInclude' => TRUE,
1302             'setByAdminModule'      => FALSE,
1303             'setBySetupModule'      => TRUE,
1304         ),
1305         self::PASSWORD_POLICY_MIN_NUMBERS => array(
1306         //_('Minimum numbers')
1307             'label'                 => 'Minimum numbers',
1308         //_('Minimum numbers in password')
1309             'description'           => 'Minimum numbers in password',
1310             'type'                  => 'int',
1311             'clientRegistryInclude' => TRUE,
1312             'setByAdminModule'      => FALSE,
1313             'setBySetupModule'      => TRUE,
1314         ),
1315         self::PASSWORD_POLICY_FORBID_USERNAME => array(
1316         //_('Forbid part of username')
1317             'label'                 => 'Forbid part of username',
1318         //_('Forbid part of username in password')
1319             'description'           => 'Forbid part of username in password',
1320             'type'                  => 'bool',
1321             'clientRegistryInclude' => FALSE,
1322             'setByAdminModule'      => FALSE,
1323             'setBySetupModule'      => TRUE,
1324         ),
1325         self::PASSWORD_POLICY_CHANGE_AFTER => array(
1326         //_('Change Password After ... Days')
1327             'label'                 => 'Change Password After ... Days',
1328         //_('Users need to change their passwords after defined number of days')
1329             'description'           => 'Users need to change their passwords after defined number of days',
1330             'type'                  => 'integer',
1331             'clientRegistryInclude' => FALSE,
1332             'setByAdminModule'      => FALSE,
1333             'setBySetupModule'      => TRUE,
1334             'default'               => 0,
1335         ),
1336         self::AUTOMATIC_BUGREPORTS => array(
1337                                    //_('Automatic bugreports')
1338             'label'                 => 'Automatic bugreports',
1339                                    //_('Always send bugreports, even on timeouts and other exceptions / failures.')
1340             'description'           => 'Always send bugreports, even on timeouts and other exceptions / failures.',
1341             'type'                  => 'bool',
1342             'clientRegistryInclude' => TRUE,
1343             'setByAdminModule'      => FALSE,
1344             'setBySetupModule'      => TRUE,
1345         ),
1346         self::LAST_SESSIONS_CLEANUP_RUN => array(
1347                                    //_('Last sessions cleanup run')
1348             'label'                 => 'Last sessions cleanup run',
1349                                    //_('Stores the timestamp of the last sessions cleanup task run.')
1350             'description'           => 'Stores the timestamp of the last sessions cleanup task run.',
1351             'type'                  => self::TYPE_DATETIME,
1352             'clientRegistryInclude' => FALSE,
1353             'setByAdminModule'      => FALSE,
1354             'setBySetupModule'      => FALSE,
1355         ),
1356         self::WARN_LOGIN_FAILURES => array(
1357             //_('Warn after X login failures')
1358             'label'                 => 'Warn after X login failures',
1359             //_('Maximum allowed login failures before writing warn log messages')
1360             'description'           => 'Maximum allowed login failures before writing warn log messages',
1361             'type'                  => 'int',
1362             'clientRegistryInclude' => FALSE,
1363             'setByAdminModule'      => FALSE,
1364             'setBySetupModule'      => TRUE,
1365             'default'               => 4
1366         ),
1367         self::ANYONE_ACCOUNT_DISABLED => array(
1368                                    //_('Disable Anyone Account')
1369             'label'                 => 'Disable Anyone Account',
1370                                    //_('Disallow anyone account in grant configurations')
1371             'description'           => 'Disallow anyone account in grant configurations',
1372             'type'                  => 'bool',
1373             'clientRegistryInclude' => TRUE,
1374             'setByAdminModule'      => FALSE,
1375             'setBySetupModule'      => TRUE,
1376         ),
1377         self::ALARMS_EACH_JOB => array(
1378                                    //_('Alarms sent each job')
1379             'label'                 => 'Alarms sent each job',
1380                                    //_('Allows to configure the maximum number of alarm notifications in each run of sendPendingAlarms (0 = no limit)')
1381             'description'           => 'Allows to configure the maximum number of alarm notifications in each run of sendPendingAlarms (0 = no limit)',
1382             'type'                  => 'integer',
1383             'clientRegistryInclude' => FALSE,
1384             'setByAdminModule'      => FALSE,
1385             'setBySetupModule'      => TRUE,
1386         ),
1387         self::ACCOUNT_DEACTIVATION_NOTIFICATION => array(
1388             //_('Account deactivation notfication')
1389             'label'                 => 'Account deactivation notfication',
1390             //_('Send E-Mail to user if the account is deactivated or the user tries to login with deactivated account')
1391             'description'           => 'Send E-Mail to User if the account is deactivated or the user tries to login with deactivated account',
1392             'type'                  => 'bool',
1393             'clientRegistryInclude' => FALSE,
1394             'setByAdminModule'      => FALSE,
1395             'setBySetupModule'      => TRUE,
1396         ),
1397         self::ROLE_CHANGE_ALLOWED => array(
1398                                    //_('Role change allowed')
1399             'label'                 => 'Role change allowed',
1400                                    //_('Allows to configure which user is allowed to switch to another users account')
1401             'description'           => 'Allows to configure which user is allowed to switch to another users account',
1402             'type'                  => 'Tinebase_Config_Struct',
1403             'clientRegistryInclude' => TRUE,
1404             'setByAdminModule'      => FALSE,
1405             'setBySetupModule'      => TRUE,
1406         ),
1407         self::MAX_USERNAME_LENGTH => array(
1408             //_('Max username length')
1409             'label'                 => 'Max username length',
1410             //_('Max username length')
1411             'description'           => 'Max username length',
1412             'type'                  => 'int',
1413             'default'               => NULL,
1414             'clientRegistryInclude' => FALSE,
1415         ),
1416         self::CONFD_FOLDER => array(
1417             //_('conf.d folder name')
1418             'label'                 => 'conf.d folder name',
1419             //_('Folder for additional config files (conf.d) - NOTE: this is only used if set in config.inc.php!')
1420             'description'           => 'Folder for additional config files (conf.d) - NOTE: this is only used if set in config.inc.php!',
1421             'type'                  => 'string',
1422             'default'               => '',
1423             'clientRegistryInclude' => FALSE,
1424             'setByAdminModule'      => FALSE,
1425             'setBySetupModule'      => FALSE,
1426         ),
1427         self::MAINTENANCE_MODE => array(
1428             //_('Maintenance mode enabled')
1429             'label'                 => 'Maintenance mode enabled',
1430             //_('Folder for additional config files (conf.d) - NOTE: this is only used if set in config.inc.php!')
1431             'description'           => 'Installation is in maintenance mode. With this only users having the maintenance right can login',
1432             'type'                  => 'bool',
1433             'default'               => '',
1434             'clientRegistryInclude' => FALSE,
1435             'setByAdminModule'      => TRUE,
1436             'setBySetupModule'      => TRUE,
1437         ),
1438         self::VERSION_CHECK => array(
1439             //_('Version check enabled')
1440             'label'                 => 'Version check enabled',
1441             'description'           => 'Version check enabled',
1442             'type'                  => 'bool',
1443             'default'               => true,
1444             'clientRegistryInclude' => true,
1445             'setByAdminModule'      => false,
1446             'setBySetupModule'      => false,
1447         ),
1448         self::FAT_CLIENT_CUSTOM_JS => array(
1449             // NOTE: it's possible to deliver customjs vom vfs by using the tine20:// streamwrapper
1450             //       tine20://<applicationid>/folders/shared/<containerid>/custom.js
1451             //_('Custom Javascript includes for Fat-Client')
1452             'label'                 => 'Custom Javascript includes for Fat-Client',
1453             //_('An array of javascript files to include for the fat client. This files might be stored outside the docroot of the webserver.')
1454             'description'           => "An array of javascript files to include for the fat client. This files might be stored outside the docroot of the webserver.",
1455             'type'                  => 'array',
1456             'default'               => array(),
1457             'clientRegistryInclude' => FALSE,
1458             'setByAdminModule'      => FALSE,
1459             'setBySetupModule'      => FALSE,
1460         ),
1461         self::BRANDING_DESCRIPTION => array(
1462                 //_('custom description')
1463                 'label'                 => 'custom description',
1464                 //_('Custom description for branding.')
1465                 'description'           => 'Custom description for branding.',
1466                 'type'                  => 'string',
1467                 'default'               => '',
1468                 'clientRegistryInclude' => FALSE,
1469                 'setByAdminModule'      => FALSE,
1470                 'setBySetupModule'      => FALSE,
1471         ),
1472         self::BRANDING_WEBURL => array(
1473                 //_('custom weburl')
1474                 'label'                 => 'custom weburl',
1475                 //_('Custom weburl for branding.')
1476                 'description'           => 'Custom weburl for branding.',
1477                 'type'                  => 'string',
1478                 'default'               => '',
1479                 'clientRegistryInclude' => FALSE,
1480                 'setByAdminModule'      => FALSE,
1481                 'setBySetupModule'      => FALSE,
1482         ),
1483         self::BRANDING_TITLE => array(
1484                 //_('custom title')
1485                 'label'                 => 'custom title',
1486                 //_('Custom title for branding.')
1487                 'description'           => 'Custom ltitle for branding.',
1488                 'type'                  => 'string',
1489                 'default'               => '',
1490                 'clientRegistryInclude' => FALSE,
1491                 'setByAdminModule'      => FALSE,
1492                 'setBySetupModule'      => FALSE,
1493         ),
1494         self::BRANDING_LOGO => array(
1495                 //_('custom logo path')
1496                 'label'                 => 'custom logo path',
1497                 //_('Path to custom logo.')
1498                 'description'           => 'Path to custom logo.',
1499                 'type'                  => 'string',
1500                 'default'               => './images/tine_logo.png',
1501                 'clientRegistryInclude' => FALSE,
1502                 'setByAdminModule'      => FALSE,
1503                 'setBySetupModule'      => FALSE,
1504         ),
1505         self::BRANDING_FAVICON => array(
1506                 //_('custom favicon path')
1507                 'label'                 => 'custom favicon path',
1508                 //_('Path to custom favicon.')
1509                 'description'           => 'Path to custom favicon.',
1510                 'type'                  => 'string',
1511                 'default'               => '',
1512                 'clientRegistryInclude' => FALSE,
1513                 'setByAdminModule'      => FALSE,
1514                 'setBySetupModule'      => FALSE,
1515         ),
1516         self::USE_LOGINNAME_AS_FOLDERNAME => array(
1517         //_('Use login name instead of full name')
1518             'label'                 => 'Use login name instead of full name',
1519         //_('Use login name instead of full name for webdav.')
1520             'description'           => 'Use login name instead of full name for webdav.',
1521             'type'                  => 'bool',
1522             'clientRegistryInclude' => FALSE,
1523             'setByAdminModule'      => FALSE,
1524             'setBySetupModule'      => FALSE,
1525             'default'               => FALSE,
1526         ),
1527         self::DENY_WEBDAV_CLIENT_LIST  => array(
1528             //_('List of WebDav agent strings that will be denied')
1529             'label'                 => 'List of WebDav agent strings that will be denied',
1530             //_('List of WebDav agent strings that will be denied.')
1531             'description'           => 'List of WebDav agent strings that will be denied.',
1532             'type'                  => 'array',
1533             'clientRegistryInclude' => FALSE,
1534             'setByAdminModule'      => FALSE,
1535             'setBySetupModule'      => FALSE,
1536             'default'               => NULL,
1537         ),
1538         self::CURRENCY_SYMBOL => array(
1539             //_('currency symbol')
1540             'label' => 'urrency symbol',
1541             //_('Path to custom favicon.')
1542             'description' => 'Define currency symbol to be used.',
1543             'type' => 'string',
1544             'default' => '€',
1545             'clientRegistryInclude' => true,
1546             'setByAdminModule' => false,
1547             'setBySetupModule' => false,
1548         ),
1549         self::FILESYSTEM => array(
1550             //_('Filesystem settings')
1551             'label'                 => 'Filesystem settings',
1552             //_('Filesystem settings.')
1553             'description'           => 'Filesystem settings.',
1554             'type'                  => 'object',
1555             'class'                 => 'Tinebase_Config_Struct',
1556             'clientRegistryInclude' => TRUE,
1557             'setByAdminModule'      => FALSE,
1558             'setBySetupModule'      => FALSE,
1559             'content'               => array(
1560                 self::FILESYSTEM_MODLOGACTIVE => array(
1561                     //_('Filesystem history')
1562                     'label'                 => 'Filesystem history',
1563                     //_('Filesystem keeps history, default is false.')
1564                     'description'           => 'Filesystem keeps history, default is false.',
1565                     'type'                  => 'bool',
1566                     'clientRegistryInclude' => TRUE,
1567                     'setByAdminModule'      => FALSE,
1568                     'setBySetupModule'      => FALSE,
1569                     'default'               => FALSE,
1570                 ),
1571                 self::FILESYSTEM_NUMKEEPREVISIONS => array(
1572                     //_('Filesystem number of revisions')
1573                     'label'                 => 'Filesystem number of revisions',
1574                     //_('Filesystem number of revisions being kept before they are automatically deleted.')
1575                     'description'           => 'Filesystem number of revisions being kept before they are automatically deleted.',
1576                     'type'                  => 'integer',
1577                     'clientRegistryInclude' => TRUE,
1578                     'setByAdminModule'      => FALSE,
1579                     'setBySetupModule'      => FALSE,
1580                     'default'               => 100,
1581                 ),
1582                 self::FILESYSTEM_MONTHKEEPREVISIONS => array(
1583                     //_('Filesystem months of revisions')
1584                     'label'                 => 'Filesystem months of revisions',
1585                     //_('Filesystem number of months revisions being kept before they are automatically deleted.')
1586                     'description'           => 'Filesystem number of months revisions being kept before they are automatically deleted.',
1587                     'type'                  => 'integer',
1588                     'clientRegistryInclude' => TRUE,
1589                     'setByAdminModule'      => FALSE,
1590                     'setBySetupModule'      => FALSE,
1591                     'default'               => 60,
1592                 ),
1593                 self::FILESYSTEM_INDEX_CONTENT => array(
1594                     //_('Filesystem index content')
1595                     'label'                 => 'Filesystem index content',
1596                     //_('Filesystem index content.')
1597                     'description'           => 'Filesystem index content.',
1598                     'type'                  => 'bool',
1599                     'clientRegistryInclude' => TRUE,
1600                     'setByAdminModule'      => FALSE,
1601                     'setBySetupModule'      => FALSE,
1602                     'default'               => FALSE,
1603                 ),
1604                 self::FILESYSTEM_ENABLE_NOTIFICATIONS => array(
1605                     //_('Filesystem enable notifications')
1606                     'label'                 => 'Filesystem enable notifications',
1607                     //_('Filesystem enable notifications.')
1608                     'description'           => 'Filesystem enable notifications.',
1609                     'type'                  => 'bool',
1610                     'clientRegistryInclude' => TRUE,
1611                     'setByAdminModule'      => FALSE,
1612                     'setBySetupModule'      => FALSE,
1613                     'default'               => FALSE,
1614                 ),
1615                 self::FILESYSTEM_CREATE_PREVIEWS => array(
1616                     //_('Filesystem create previews')
1617                     'label'                 => 'Filesystem create previews',
1618                     //_('Filesystem create previews.')
1619                     'description'           => 'Filesystem create previews.',
1620                     'type'                  => 'bool',
1621                     'clientRegistryInclude' => TRUE,
1622                     'setByAdminModule'      => FALSE,
1623                     'setBySetupModule'      => FALSE,
1624                     'default'               => FALSE,
1625                 ),
1626                 self::FILESYSTEM_PREVIEW_SERVICE_URL => array(
1627                     //_('URL of preview service')
1628                     'label'                 => 'URL of preview service',
1629                     //_('URL of preview service.')
1630                     'description'           => 'URL of preview service.',
1631                     'type'                  => 'string',
1632                     'clientRegistryInclude' => FALSE,
1633                     'setByAdminModule'      => FALSE,
1634                     'setBySetupModule'      => FALSE,
1635                     'default'               => NULL,
1636                 ),
1637             ),
1638             'default'               => array(),
1639         ),
1640         self::QUOTA => array(
1641             //_('Quota settings')
1642             'label'                 => 'Quota settings',
1643             //_('Quota settings')
1644             'description'           => 'Quota settings',
1645             'type'                  => 'object',
1646             'class'                 => 'Tinebase_Config_Struct',
1647             'clientRegistryInclude' => true,
1648             'setByAdminModule'      => true,
1649             'setBySetupModule'      => false,
1650             'content'               => array(
1651                 self::QUOTA_INCLUDE_REVISION => array(
1652                     //_('Include revisions')
1653                     'label'                 => 'Include revisions',
1654                     //_('Should all revisions be used to calculate total usage?')
1655                     'description'           => 'Should all revisions be used to calculate total usage?',
1656                     'type'                  => 'bool',
1657                     'clientRegistryInclude' => true,
1658                     'setByAdminModule'      => true,
1659                     'setBySetupModule'      => false,
1660                     'default'               => false,
1661                 ),
1662                 self::QUOTA_TOTALINMB => array(
1663                     //_('Total quota in MB')
1664                     'label'                 => 'Total quota in MB',
1665                     //_('Total quota in MB (0 for unlimited)')
1666                     'description'           => 'Total quota in MB (0 for unlimited)',
1667                     'type'                  => 'integer',
1668                     'clientRegistryInclude' => true,
1669                     'setByAdminModule'      => true,
1670                     'setBySetupModule'      => false,
1671                     'default'               => 0,
1672                 ),
1673                 self::QUOTA_TOTALBYUSERINMB => array(
1674                     //_('Total quota by user in MB')
1675                     'label'                 => 'Total quota by user in MB',
1676                     //_('Total quota by user in MB (0 for unlimited)')
1677                     'description'           => 'Total quota by user in MB (0 for unlimited)',
1678                     'type'                  => 'integer',
1679                     'clientRegistryInclude' => true,
1680                     'setByAdminModule'      => true,
1681                     'setBySetupModule'      => false,
1682                     'default'               => 0,
1683                 ),
1684                 self::QUOTA_SOFT_QUOTA => array(
1685                     //_('Soft quota in %')
1686                     'label'                 => 'Soft quota in %',
1687                     //_('Soft quota in % (0-100, 0 means off)')
1688                     'description'           => 'Soft quota in % (0-100, 0 means off)',
1689                     'type'                  => 'integer',
1690                     'clientRegistryInclude' => true,
1691                     'setByAdminModule'      => true,
1692                     'setBySetupModule'      => false,
1693                     'default'               => 90,
1694                 ),
1695                 self::QUOTA_SQ_NOTIFICATION_ROLE => array(
1696                     //_('Soft quota notification role')
1697                     'label'                 => 'Soft quota notification role',
1698                     //_('Name of the role to notify if soft quote is exceeded')
1699                     'description'           => 'Name of the role to notify if soft quote is exceeded',
1700                     'type'                  => 'string',
1701                     'clientRegistryInclude' => true,
1702                     'setByAdminModule'      => true,
1703                     'setBySetupModule'      => false,
1704                     'default'               => 'soft quota notification',
1705                 ),
1706             ),
1707             'default'               => array(),
1708         ),
1709         /*
1710
1711     const QUOTA_SQ_NOTIFICATION_ROLE = 'softQuotaNotificationRole';*/
1712     );
1713     
1714     /**
1715      * (non-PHPdoc)
1716      * @see tine20/Tinebase/Config/Abstract::$_appName
1717      */
1718     protected $_appName = 'Tinebase';
1719     
1720     /**
1721      * holds the instance of the singleton
1722      *
1723      * @var Tinebase_Config
1724      */
1725     private static $_instance = NULL;
1726
1727     /**
1728      * server classes
1729      *
1730      * @var array
1731      */
1732     protected static $_serverPlugins = array(
1733         'Tinebase_Server_Plugin_Json'   => 80,
1734         'Tinebase_Server_Plugin_WebDAV' => 80,
1735         'Tinebase_Server_Plugin_Cli'    => 90,
1736         'Tinebase_Server_Plugin_Http'   => 100
1737     );
1738
1739     /**
1740      * the constructor
1741      *
1742      * don't use the constructor. use the singleton 
1743      */
1744     private function __construct() {}
1745     
1746     /**
1747      * the constructor
1748      *
1749      * don't use the constructor. use the singleton 
1750      */
1751     private function __clone() {}
1752     
1753     /**
1754      * Returns instance of Tinebase_Config
1755      *
1756      * @return Tinebase_Config
1757      */
1758     public static function getInstance() 
1759     {
1760         if (self::$_instance === NULL) {
1761             self::$_instance = new Tinebase_Config();
1762         }
1763         
1764         return self::$_instance;
1765     }
1766     
1767     /**
1768      * (non-PHPdoc)
1769      * @see tine20/Tinebase/Config/Abstract::getProperties()
1770      */
1771     public static function getProperties()
1772     {
1773         return self::$_properties;
1774     }
1775     
1776     /**
1777      * get config for client registry
1778      * 
1779      * @return Tinebase_Config_Struct
1780      */
1781     public function getClientRegistryConfig()
1782     {
1783         // get all config names to be included in registry
1784         $clientProperties = new Tinebase_Config_Struct(array());
1785         $userApplications = Tinebase_Core::getUser()->getApplications(TRUE);
1786         foreach ($userApplications as $application) {
1787             $config = Tinebase_Config_Abstract::factory($application->name);
1788             if ($config) {
1789                 $clientProperties[$application->name] = new Tinebase_Config_Struct(array());
1790                 $properties = $config->getProperties();
1791                 foreach ((array) $properties as $name => $definition) {
1792                     
1793                     if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ 
1794                         . ' ' . print_r($definition, TRUE));
1795                     
1796                     if (isset($definition['clientRegistryInclude']) && $definition['clientRegistryInclude'] === TRUE)
1797                     {
1798                         // add definition here till we have a better place
1799                         try {
1800                             $configRegistryItem = new Tinebase_Config_Struct(array(
1801                                 'value' => $config->{$name},
1802                                 'definition' => new Tinebase_Config_Struct($definition),
1803                             ), null, null, array(
1804                                 'value' => array('type' => $definition['type']),
1805                                 'definition' => array('type' => Tinebase_Config_Abstract::TYPE_ARRAY, 'class' => 'Tinebase_Config_Struct')
1806                             ));
1807                             if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__
1808                                 . ' ' . print_r($configRegistryItem->toArray(), TRUE));
1809                             $clientProperties[$application->name][$name] = $configRegistryItem;
1810                         } catch (Exception $e) {
1811                             Tinebase_Exception::log($e);
1812                         }
1813                     }
1814                 }
1815                 if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ 
1816                     . ' Got ' . count($clientProperties[$application->name]) . ' config items for ' . $application->name . '.');
1817             }
1818         }
1819         
1820         return $clientProperties;
1821     }
1822     
1823     /**
1824      * get application config
1825      *
1826      * @param  string  $applicationName Application name
1827      * @return Tinebase_Config_Abstract  $configClass
1828      */
1829     public static function getAppConfig($applicationName)
1830     {
1831         $configClassName = $applicationName . '_Config';
1832         if (@class_exists($configClassName)) {
1833             /** @noinspection PhpUndefinedMethodInspection */
1834             return $configClassName::getInstance();
1835         } else {
1836             if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__
1837                 . ' Application ' . $applicationName . ' has no config.');
1838             return NULL;
1839         }
1840     }
1841 }