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