Merge branch '2016.11-develop' into 2017.02
[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      * WEBDAV_SYNCTOKEN_ENABLED
497      *
498      * @var string
499      */
500     const WEBDAV_SYNCTOKEN_ENABLED = 'webdavSynctokenEnabled';
501
502     /**
503      * @var string
504      */
505     const REPLICATION_MASTER = 'replicationMaster';
506
507     /**
508      * @var string
509      */
510     const REPLICATION_SLAVE = 'replicationSlave';
511
512     /**
513      * @var string
514      */
515     const REPLICATION_USER_PASSWORD = 'replicationUserPassword';
516
517     /**
518      * @var string
519      */
520     const MASTER_URL = 'masterURL';
521
522     /**
523      * @var string
524      */
525     const MASTER_USERNAME = 'masterUsername';
526
527     /**
528      * @var string
529      */
530     const MASTER_PASSWORD = 'masterPassword';
531
532     /**
533      * @var string
534      */
535     const ERROR_NOTIFICATION_LIST = 'errorNotificationList';
536
537     const FULLTEXT = 'fulltext';
538     const FULLTEXT_BACKEND = 'backend';
539     const FULLTEXT_JAVABIN = 'javaBin';
540     const FULLTEXT_TIKAJAR = 'tikaJar';
541
542     const FILESYSTEM = 'filesystem';
543     const FILESYSTEM_MODLOGACTIVE = 'modLogActive';
544     const FILESYSTEM_NUMKEEPREVISIONS = 'numKeepRevisions';
545     const FILESYSTEM_MONTHKEEPREVISIONS = 'monthKeepRevisions';
546     const FILESYSTEM_INDEX_CONTENT = 'index_content';
547     const FILESYSTEM_CREATE_PREVIEWS = 'createPreviews';
548     const FILESYSTEM_PREVIEW_SERVICE_URL = 'previewServiceUrl';
549     const FILESYSTEM_ENABLE_NOTIFICATIONS = 'enableNotifications';
550
551     const ACTIONQUEUE = 'actionqueue';
552     const ACTIONQUEUE_BACKEND = 'backend';
553     const ACTIONQUEUE_ACTIVE = 'active';
554     const ACTIONQUEUE_HOST = 'host';
555     const ACTIONQUEUE_PORT = 'port';
556     const ACTIONQUEUE_NAME = 'queueName';
557
558     const QUOTA = 'quota';
559     const QUOTA_INCLUDE_REVISION = 'includeRevision';
560     const QUOTA_TOTALINMB = 'totalInMB';
561     const QUOTA_TOTALBYUSERINMB = 'totalByUserInMB';
562     const QUOTA_SOFT_QUOTA = 'softQuota';
563     const QUOTA_SQ_NOTIFICATION_ROLE = 'softQuotaNotificationRole';
564
565
566     /**
567      * (non-PHPdoc)
568      * @see tine20/Tinebase/Config/Definition::$_properties
569      */
570     protected static $_properties = array(
571         /**
572          * possible values:
573          *
574          * $_deletePersonalContainers => delete personal containers
575          * $_keepAsContact => keep "account" as contact in the addressbook
576          * $_keepOrganizerEvents => keep accounts organizer events as external events in the calendar
577          * $_keepAsContact => keep accounts calender event attendee as external attendee
578          *
579          * TODO add more options (like move to another container)
580          */
581         self::ACCOUNT_DELETION_EVENTCONFIGURATION => array(
582             //_('Account Deletion Event')
583             'label'                 => 'Account Deletion Event',
584             //_('Configure what should happen to data of deleted users')
585             'description'           => 'Configure what should happen to data of deleted users',
586             'type'                  => 'object',
587             'class'                 => 'Tinebase_Config_Struct',
588             'clientRegistryInclude' => FALSE,
589             'setByAdminModule'      => TRUE,
590             'setBySetupModule'      => TRUE,
591         ),
592         /**
593          * for example: array('en', 'de')
594          */
595         self::AVAILABLE_LANGUAGES => array(
596             //_('Available Languages')
597             'label'                 => 'Available Languages',
598             //_('Whitelist available languages that can be chosen in the GUI')
599             'description'           => 'Whitelist available languages that can be chosen in the GUI',
600             'type'                  => 'array',
601             'clientRegistryInclude' => TRUE,
602             'setByAdminModule'      => TRUE,
603             'setBySetupModule'      => TRUE,
604         ),
605         /**
606          * for example: 'de'
607          */
608         self::DEFAULT_LOCALE => array(
609             //_('Default Locale')
610             'label'                 => 'Default Locale',
611             //_('Default locale for this installation.')
612             'description'           => 'Default locale for this installation.',
613             'type'                  => 'string',
614             'default'               => 'en',
615             'clientRegistryInclude' => TRUE,
616             'setByAdminModule'      => FALSE,
617             'setBySetupModule'      => TRUE,
618         ),
619         /**
620          * config keys (see Zend_Http_Client_Adapter_Proxy):
621          *
622          * 'proxy_host' => 'proxy.com',
623          * 'proxy_port' => 3128,
624          * 'proxy_user' => 'user',
625          * 'proxy_pass' => 'pass'
626          */
627         self::INTERNET_PROXY => array(
628             //_('Internet proxy config')
629             'label'                 => 'Internet proxy config',
630             'description'           => 'Internet proxy config',
631             'type'                  => 'array',
632             'default'               => array(),
633             'clientRegistryInclude' => false,
634             'setByAdminModule'      => true,
635             'setBySetupModule'      => true,
636         ),
637         /**
638          * config keys:
639          *
640          * useSystemAccount (bool)
641          * domain (string)
642          * instanceName (string)
643          * useEmailAsUsername (bool)
644          * host (string)
645          * port (integer)
646          * ssl (bool)
647          * user (string) ?
648          * backend (string) - see Tinebase_EmailUser::$_supportedBackends
649          * verifyPeer (bool)
650          */
651         self::IMAP => array(
652                                    //_('System IMAP')
653             'label'                 => 'System IMAP',
654                                    //_('System IMAP server configuration.')
655             'description'           => 'System IMAP server configuration.',
656             'type'                  => 'object',
657             'class'                 => 'Tinebase_Config_Struct',
658             'clientRegistryInclude' => FALSE,
659             'setByAdminModule'      => FALSE,
660             'setBySetupModule'      => TRUE,
661         ),
662         self::SMTP => array(
663                                    //_('System SMTP')
664             'label'                 => 'System SMTP',
665                                    //_('System SMTP server configuration.')
666             'description'           => 'System SMTP server configuration.',
667             'type'                  => 'object',
668             'class'                 => 'Tinebase_Config_Struct',
669             'clientRegistryInclude' => FALSE,
670             'setByAdminModule'      => FALSE,
671             'setBySetupModule'      => TRUE,
672         ),
673         self::SIEVE => array(
674                                    //_('System SIEVE')
675             'label'                 => 'System SIEVE',
676                                    //_('System SIEVE server configuration.')
677             'description'           => 'System SIEVE server configuration.',
678             'type'                  => 'object',
679             'class'                 => 'Tinebase_Config_Struct',
680             'clientRegistryInclude' => FALSE,
681             'setByAdminModule'      => FALSE,
682             'setBySetupModule'      => TRUE,
683         ),
684         self::AUTHENTICATIONBACKENDTYPE => array(
685                                    //_('Authentication Backend')
686             'label'                 => 'Authentication Backend',
687                                    //_('Backend adapter for user authentication.')
688             'description'           => 'Backend adapter for user authentication.',
689             'type'                  => 'string',
690             'clientRegistryInclude' => FALSE,
691             'setByAdminModule'      => FALSE,
692             'setBySetupModule'      => TRUE,
693         ),
694         self::AUTHENTICATIONBACKEND => array(
695                                    //_('Authentication Configuration')
696             'label'                 => 'Authentication Configuration',
697                                    //_('Authentication backend configuration.')
698             'description'           => 'Authentication backend configuration.',
699             'type'                  => 'object',
700             'class'                 => 'Tinebase_Config_Struct',
701             'clientRegistryInclude' => FALSE,
702             'setByAdminModule'      => FALSE,
703             'setBySetupModule'      => TRUE,
704         ),
705         /**
706          * example config:
707          *
708          * array(
709          *      'active'                => true,
710          *      'provider'              => 'PrivacyIdea',
711          *      'url'                   => 'https://localhost/validate/check',
712          *      'allow_self_signed'     => true,
713          *      'ignorePeerName'        => true,
714          *      'login'                 => true, // validate during login + show field on login screen
715          *      'sessionLifetime'       => 15 // minutes
716          * )
717          */
718         self::AUTHENTICATIONSECONDFACTOR => array(
719             //_('Second Factor Authentication Configuration')
720             'label'                 => 'Second Factor Authentication Configuration',
721             'description'           => 'Second Factor Authentication Configuration',
722             'type'                  => 'object',
723             'class'                 => 'Tinebase_Config_Struct',
724             'clientRegistryInclude' => FALSE,
725             'setByAdminModule'      => FALSE,
726             'setBySetupModule'      => TRUE,
727         ),
728         self::SECONDFACTORPROTECTEDAPPS => array(
729             //_('Second Factor Protected Applications')
730             'label'                 => 'Second Factor Protected Applications',
731             //_('Second Factor Authentication is needed to access these applications')
732             'description'           => 'Second Factor Authentication is needed to access these applications',
733             'type'                  => 'array',
734             'clientRegistryInclude' => true,
735             'setByAdminModule'      => false,
736             'setBySetupModule'      => true,
737         ),
738         self::USERBACKENDTYPE => array(
739                                    //_('User Backend')
740             'label'                 => 'User Backend',
741                                    //_('Backend adapter for user data.')
742             'description'           => 'Backend adapter for user data.',
743             'type'                  => 'string',
744             'clientRegistryInclude' => FALSE,
745             'setByAdminModule'      => FALSE,
746             'setBySetupModule'      => TRUE,
747         ),
748         self::REPLICATION_MASTER => array(
749             //_('Replication master configuration')
750             'label'                 => 'Replication master configuration',
751             //_('Replication master configuration.')
752             'description'           => 'Replication master configuration.',
753             'type'                  => 'object',
754             'class'                 => 'Tinebase_Config_Struct',
755             'clientRegistryInclude' => FALSE,
756             'setByAdminModule'      => FALSE,
757             'setBySetupModule'      => TRUE,
758             'content'               => array(
759                 self::REPLICATION_USER_PASSWORD     => array(
760                     'type'                              => Tinebase_Config::TYPE_STRING
761                 )
762             ),
763         ),
764         self::REPLICATION_SLAVE => array(
765             //_('Replication slave configuration')
766             'label'                 => 'Replication slave configuration',
767             //_('Replication slave configuration.')
768             'description'           => 'Replication slave configuration.',
769             'type'                  => 'object',
770             'class'                 => 'Tinebase_Config_Struct',
771             'clientRegistryInclude' => FALSE,
772             'setByAdminModule'      => FALSE,
773             'setBySetupModule'      => TRUE,
774             'content'               => array(
775                 self::MASTER_URL                => array(
776                     'type'                          => Tinebase_Config::TYPE_STRING,
777                 ),
778                 self::MASTER_USERNAME           => array(
779                     'type'                          => Tinebase_Config::TYPE_STRING,
780                 ),
781                 self::MASTER_PASSWORD           => array(
782                     'type'                          => Tinebase_Config::TYPE_STRING,
783                 ),
784                 self::ERROR_NOTIFICATION_LIST   => array(
785                     'type'                          => Tinebase_Config::TYPE_ARRAY,
786                 )
787             )
788         ),
789         self::FULLTEXT => array(
790             //_('Full text configuration')
791             'label'                 => 'Full text configuration',
792             //_('Full text configuration.')
793             'description'           => 'Full text configuration.',
794             'type'                  => 'object',
795             'class'                 => 'Tinebase_Config_Struct',
796             'clientRegistryInclude' => FALSE,
797             'setByAdminModule'      => FALSE,
798             'setBySetupModule'      => TRUE,
799             'content'               => array(
800                 self::FULLTEXT_BACKEND          => array(
801                     'type'                              => Tinebase_Config::TYPE_STRING,
802                     'default'                           => 'Sql'
803                 ),
804                 self::FULLTEXT_JAVABIN          => array(
805                     'type'                              => Tinebase_Config::TYPE_STRING,
806                     'default'                           => 'java'
807                 ),
808                 self::FULLTEXT_TIKAJAR          => array(
809                     'type'                              => Tinebase_Config::TYPE_STRING,
810                 ),
811             ),
812             'default'                           => array()
813         ),
814         self::ACTIONQUEUE => array(
815             //_('Action queue configuration')
816             'label'                 => 'Action queue configuration',
817             //_('Action queue configuration.')
818             'description'           => 'Action queue configuration.',
819             'type'                  => 'object',
820             'class'                 => 'Tinebase_Config_Struct',
821             'clientRegistryInclude' => FALSE,
822             'setByAdminModule'      => FALSE,
823             'setBySetupModule'      => TRUE,
824             'content'               => array(
825                 self::ACTIONQUEUE_BACKEND       => array(
826                     'type'                              => Tinebase_Config::TYPE_STRING,
827                     'default'                           => 'Direct'
828                 ),
829                 self::ACTIONQUEUE_ACTIVE       => array(
830                     'type'                              => Tinebase_Config::TYPE_BOOL,
831                     'default'                           => false
832                 ),
833                 self::ACTIONQUEUE_HOST       => array(
834                     'type'                              => Tinebase_Config::TYPE_STRING,
835                     'default'                           => 'localhost'
836                 ),
837                 self::ACTIONQUEUE_PORT       => array(
838                     'type'                              => Tinebase_Config::TYPE_INT,
839                     'default'                           => 6379
840                 ),
841                 self::ACTIONQUEUE_NAME       => array(
842                     'type'                              => Tinebase_Config::TYPE_STRING,
843                     'default'                           => 'TinebaseQueue'
844                 ),
845             ),
846             'default'                           => array()
847         ),
848         self::USERBACKEND => array(
849                                    //_('User Configuration')
850             'label'                 => 'User Configuration',
851                                    //_('User backend configuration.')
852             'description'           => 'User backend configuration.',
853             'type'                  => 'object',
854             'class'                 => 'Tinebase_Config_Struct',
855             'clientRegistryInclude' => FALSE,
856             'setByAdminModule'      => FALSE,
857             'setBySetupModule'      => TRUE,
858             'content'               => array(
859                 Tinebase_User::DEFAULT_USER_GROUP_NAME_KEY => array(
860                     'type'                      => Tinebase_Config::TYPE_STRING,
861                 ),
862                 Tinebase_User::DEFAULT_ADMIN_GROUP_NAME_KEY => array(
863                     'type'                      => Tinebase_Config::TYPE_STRING,
864                 ),
865                 'host'                      => array(
866                     'type'                      => Tinebase_Config::TYPE_STRING,
867                 ),
868                 'port'                      => array(
869                     'type'                      => Tinebase_Config::TYPE_INT,
870                 ),
871                 'useSsl'                    => array(
872                     'type'                      => Tinebase_Config::TYPE_BOOL,
873                 ),
874                 'username'                  => array(
875                     'type'                      => Tinebase_Config::TYPE_STRING,
876                 ),
877                 'password'                  => array(
878                     'type'                      => Tinebase_Config::TYPE_STRING,
879                 ),
880                 'bindRequiresDn'            => array(
881                     'type'                      => Tinebase_Config::TYPE_BOOL,
882                 ),
883                 'baseDn'                    => array(
884                     'type'                      => Tinebase_Config::TYPE_STRING,
885                 ),
886                 'accountCanonicalForm'      => array(
887                     'type'                      => Tinebase_Config::TYPE_STRING,
888                 ),
889                 'accountDomainName'         => array(
890                     'type'                      => Tinebase_Config::TYPE_STRING,
891                 ),
892                 'accountDomainNameShort'    => array(
893                     'type'                      => Tinebase_Config::TYPE_STRING,
894                 ),
895                 'accountFilterFormat'       => array(
896                     'type'                      => Tinebase_Config::TYPE_STRING,
897                 ),
898                 'allowEmptyPassword'        => array(
899                     'type'                      => Tinebase_Config::TYPE_STRING,
900                 ),
901                 'useStartTls'               => array(
902                     'type'                      => Tinebase_Config::TYPE_BOOL,
903                 ),
904                 'optReferrals'              => array(
905                     'type'                      => Tinebase_Config::TYPE_STRING,
906                 ),
907                 'tryUsernameSplit'          => array(
908                     'type'                      => Tinebase_Config::TYPE_BOOL,
909                 ),
910                 'groupUUIDAttribute'        => array(
911                     'type'                      => Tinebase_Config::TYPE_STRING,
912                 ),
913                 'groupsDn'                  => array(
914                     'type'                      => Tinebase_Config::TYPE_STRING,
915                 ),
916                 'useRfc2307bis'             => array(
917                     'type'                      => Tinebase_Config::TYPE_BOOL,
918                 ),
919                 'userDn'                    => array(
920                     'type'                      => Tinebase_Config::TYPE_STRING,
921                 ),
922                 'userFilter'                => array(
923                     'type'                      => Tinebase_Config::TYPE_STRING,
924                 ),
925                 'userSearchScope'           => array(
926                     'type'                      => Tinebase_Config::TYPE_STRING,
927                 ),
928                 'groupFilter'               => array(
929                     'type'                      => Tinebase_Config::TYPE_STRING,
930                 ),
931                 'groupSearchScope'          => array(
932                     'type'                      => Tinebase_Config::TYPE_STRING,
933                 ),
934                 'pwEncType'                 => array(
935                     'type'                      => Tinebase_Config::TYPE_STRING,
936                 ),
937                 'minUserId'                 => array(
938                     'type'                      => Tinebase_Config::TYPE_INT,
939                 ),
940                 'maxUserId'                 => array(
941                     'type'                      => Tinebase_Config::TYPE_INT,
942                 ),
943                 'minGroupId'                => array(
944                     'type'                      => Tinebase_Config::TYPE_INT,
945                 ),
946                 'maxGroupId'                => array(
947                     'type'                      => Tinebase_Config::TYPE_INT,
948                 ),
949                 'userUUIDAttribute'         => array(
950                     'type'                      => Tinebase_Config::TYPE_STRING,
951                 ),
952                 'readonly'                  => array(
953                     'type'                      => Tinebase_Config::TYPE_BOOL,
954                 ),
955                 'useRfc2307'                => array(
956                     'type'                      => Tinebase_Config::TYPE_BOOL,
957                 ),
958                 self::SYNCOPTIONS           => array(
959                     'type'                      => 'object',
960                     'class'                     => 'Tinebase_Config_Struct',
961                     'content'                   => array(
962                         self::SYNC_USER_CONTACT_DATA => array(
963                             //_('Sync contact data from sync backend')
964                             'label'                 => 'Sync contact data from sync backend',
965                             //_('Sync user contact data from sync backend')
966                             'description'           => 'Sync user contact data from sync backend',
967                             'type'                  => 'bool',
968                             'clientRegistryInclude' => FALSE,
969                             'setByAdminModule'      => FALSE,
970                             'setBySetupModule'      => FALSE,
971                             'default'               => TRUE
972                         ),
973                         self::SYNC_USER_CONTACT_PHOTO => array(
974                             //_('Sync contact photo from sync backend')
975                             'label'                 => 'Sync contact photo from sync backend',
976                             //_('Sync user contact photo from sync backend')
977                             'description'           => 'Sync user contact photo from sync backend',
978                             'type'                  => 'bool',
979                             'clientRegistryInclude' => FALSE,
980                             'setByAdminModule'      => FALSE,
981                             'setBySetupModule'      => FALSE,
982                             'default'               => TRUE
983                         ),
984                         self::SYNC_DELETED_USER => array(
985                             //_('Sync deleted users from sync backend')
986                             'label'                 => 'Sync deleted users from sync backend',
987                             //_('Sync deleted users from sync backend')
988                             'description'           => 'Sync deleted users from sync backend',
989                             'type'                  => 'bool',
990                             'clientRegistryInclude' => FALSE,
991                             'setByAdminModule'      => FALSE,
992                             'setBySetupModule'      => FALSE,
993                             'default'               => TRUE
994                         ),
995                     ),
996                     'default'                   => array(),
997                 ),
998             ),
999         ),
1000         self::ENABLED_FEATURES => array(
1001             //_('Enabled Features')
1002             'label'                 => 'Enabled Features',
1003             'description'           => 'Enabled Features',
1004             'type'                  => 'object',
1005             'class'                 => 'Tinebase_Config_Struct',
1006             'clientRegistryInclude' => TRUE,
1007             'content'               => array(
1008                 self::FEATURE_SHOW_ADVANCED_SEARCH => array(
1009                     'label'         => 'Show Advanced Search', //_('Show Advanced Search')
1010                     'description'   => 'Show toggle button to switch on or off the advanced search for the quickfilter',
1011                     //_('Show toggle button to switch on or off the advanced search for the quickfilter')
1012                 ),
1013                 self::FEATURE_CONTAINER_CUSTOM_SORT => array(
1014                     'label'         => 'Container Custom Sort', //_('Container Custom Sort')
1015                     'description'   => 'Allows to sort containers by setting the sort order in Admin/Container',
1016                     //_('Allows to sort containers by setting the sort order in Admin/Container')
1017                 ),
1018                 self::FEATURE_SHOW_ACCOUNT_EMAIL => array(
1019                     'label'         => 'Show Account Email Address', //_('Show Account Email Address')
1020                     'description'   => 'Show email address in account picker and attendee grids',
1021                     //_('Show email address in account picker and attendee grids')
1022                 ),
1023                 self::FEATURE_REMEMBER_POPUP_SIZE => array(
1024                     'label'         => 'Remeber Popup Size', //_('Remeber Popup Size')
1025                     'description'   => 'Save edit dialog size in state',
1026                     //_('Save edit dialog size in state')
1027                 ),
1028                 self::FEATURE_SEARCH_PATH => array(
1029                     'label'         => 'Search Paths',
1030                     'description'   => 'Search Paths'
1031                 ),
1032             ),
1033             'default'               => array(
1034                 self::FEATURE_SHOW_ADVANCED_SEARCH  => true,
1035                 self::FEATURE_CONTAINER_CUSTOM_SORT => true,
1036                 self::FEATURE_SHOW_ACCOUNT_EMAIL    => true,
1037                 self::FEATURE_REMEMBER_POPUP_SIZE   => true,
1038                 self::FEATURE_SEARCH_PATH           => true,
1039
1040             ),
1041         ),
1042         self::DEFAULT_ADMIN_ROLE_NAME => array(
1043             //_('Default Admin Role Name')
1044             'label'                 => 'Default Admin Role Name',
1045             'description'           => 'Default Admin Role Name',
1046             'type'                  => 'string',
1047             'clientRegistryInclude' => false,
1048             'setByAdminModule'      => false,
1049             'setBySetupModule'      => true,
1050             'default'               => 'admin role'
1051         ),
1052         self::DEFAULT_USER_ROLE_NAME => array(
1053             //_('Default User Role Name')
1054             'label'                 => 'Default User Role Name',
1055             'description'           => 'Default User Role Name',
1056             'type'                  => 'string',
1057             'clientRegistryInclude' => false,
1058             'setByAdminModule'      => false,
1059             'setBySetupModule'      => true,
1060             'default'               => 'user role'
1061         ),
1062         self::CRONUSERID => array(
1063                                    //_('Cronuser ID')
1064             'label'                 => 'Cronuser ID',
1065                                    //_('User ID of the cron user.')
1066             'description'           => 'User ID of the cron user.',
1067             'type'                  => 'string',
1068             'clientRegistryInclude' => FALSE,
1069             'setByAdminModule'      => TRUE,
1070             'setBySetupModule'      => TRUE,
1071         ),
1072         self::PAGETITLEPOSTFIX => array(
1073                                    //_('Title Postfix')
1074             'label'                 => 'Title Postfix',
1075                                    //_('Postfix string appended to the title of this installation.')
1076             'description'           => 'Postfix string appended to the title of this installation.',
1077             'type'                  => 'string',
1078             'clientRegistryInclude' => FALSE,
1079             'setByAdminModule'      => TRUE,
1080             'setBySetupModule'      => TRUE,
1081         ),
1082         self::REDIRECTURL => array(
1083                                    //_('Redirect URL')
1084             'label'                 => 'Redirect URL',
1085                                    //_('Redirect to this URL after logout.')
1086             'description'           => 'Redirect to this URL after logout.',
1087             'type'                  => 'string',
1088             'clientRegistryInclude' => FALSE,
1089             'setByAdminModule'      => FALSE,
1090             'setBySetupModule'      => TRUE,
1091         ),
1092         self::REDIRECTTOREFERRER => array(
1093                                    //_('Redirect to Referrer')
1094             'label'                 => 'Redirect to Referrer',
1095                                    //_('Redirect to referrer after logout.')
1096             'description'           => 'Redirect to referrer after logout.',
1097             'type'                  => 'bool',
1098             'clientRegistryInclude' => FALSE,
1099             'setByAdminModule'      => FALSE,
1100             'setBySetupModule'      => TRUE,
1101         ),
1102         self::REDIRECTALWAYS => array(
1103                                    //_('Redirect Always')
1104             'label'                 => 'Redirect Always',
1105                                    //_('Redirect to configured redirect URL also for login.')
1106             'description'           => 'Redirect to configured redirect URL also for login.',
1107             'type'                  => 'bool',
1108             'clientRegistryInclude' => FALSE,
1109             'setByAdminModule'      => FALSE,
1110             'setBySetupModule'      => TRUE,
1111         ),
1112         self::ALLOWEDJSONORIGINS => array(
1113                                    //_('Allowed Origins')
1114             'label'                 => 'Allowed Origins',
1115                                    //_('Allowed Origins for the JSON API.')
1116             'description'           => 'Allowed Origins for the JSON API.',
1117             'type'                  => 'array',
1118             'clientRegistryInclude' => FALSE,
1119             'setByAdminModule'      => FALSE,
1120             'setBySetupModule'      => FALSE,
1121         ),
1122         self::ACCEPTEDTERMSVERSION => array(
1123                                    //_('Accepted Terms Version')
1124             'label'                 => 'Accepted Terms Version',
1125                                    //_('Accepted version number of the terms and conditions document.')
1126             'description'           => 'Accepted version number of the terms and conditions document.',
1127             'type'                  => 'int',
1128             'clientRegistryInclude' => FALSE,
1129             'setByAdminModule'      => FALSE,
1130             'setBySetupModule'      => FALSE,
1131         ),
1132         self::MAPPANEL => array(
1133                                    //_('Use Geolocation Services')
1134             'label'                 => 'Use Geolocation Services',
1135                                    //_('Use of external Geolocation services is allowed.')
1136             'description'           => 'Use of external Geolocation services is allowed.',
1137             'type'                  => 'bool',
1138             'clientRegistryInclude' => true,
1139             'setByAdminModule'      => false,
1140             'setBySetupModule'      => true,
1141             'default'               => true,
1142         ),
1143         // TODO should this be added to LDAP config array/struct?
1144         self::LDAP_DISABLE_TLSREQCERT => array(
1145                                    //_('Disable LDAP TLS Certificate Check')
1146             'label'                 => 'Disable LDAP TLS Certificate Check',
1147                                    //_('LDAP TLS Certificate should not be checked')
1148             'description'           => 'LDAP TLS Certificate should not be checked',
1149             'type'                  => 'bool',
1150             'clientRegistryInclude' => false,
1151             'setByAdminModule'      => false,
1152             'setBySetupModule'      => true,
1153             'default'               => false
1154         ),
1155         // TODO should this be added to LDAP config array/struct?
1156         // TODO does this depend on LDAP readonly option?
1157         self::LDAP_OVERWRITE_CONTACT_FIELDS => array(
1158             //_('Contact fields overwritten by LDAP')
1159             'label'                 => 'Contact fields overwritten by LDAP',
1160             //_('These fields are overwritten during LDAP sync if empty')
1161             'description'           => 'These fields are overwritten during LDAP sync if empty',
1162             'type'                  => 'array',
1163             'clientRegistryInclude' => false,
1164             'setByAdminModule'      => false,
1165             'setBySetupModule'      => true,
1166             'default'               => array()
1167         ),
1168         self::SYNC_USER_HOOK_CLASS => array(
1169                                    //_('Configure hook class for user sync')
1170             'label'                 => 'Configure hook class for user sync',
1171                                    //_('Allows to change data after fetching user from sync backend')
1172             'description'           => 'Allows to change data after fetching user from sync backend',
1173             'type'                  => 'string',
1174             'clientRegistryInclude' => false,
1175             'setByAdminModule'      => false,
1176             'setBySetupModule'      => true,
1177         ),
1178         self::SYNC_USER_CONTACT_DATA => array(
1179             //_('Sync contact data from sync backend')
1180             'label'                 => 'Sync contact data from sync backend',
1181             //_('Sync user contact data from sync backend')
1182             'description'           => 'Sync user contact data from sync backend',
1183             'type'                  => 'bool',
1184             'clientRegistryInclude' => FALSE,
1185             'setByAdminModule'      => FALSE,
1186             'setBySetupModule'      => FALSE,
1187             'default'               => TRUE
1188         ),
1189         self::SYNC_USER_DELETE_AFTER => array(
1190             //_('Sync user: delete after X months)
1191             'label'                 => 'Sync user: delete after X months',
1192             //_('Removed users should be deleted after X months')
1193             'description'           => 'Removed users should be deleted after X months',
1194             'type'                  => 'integer',
1195             'clientRegistryInclude' => FALSE,
1196             'setByAdminModule'      => FALSE,
1197             'setBySetupModule'      => FALSE,
1198             'default'               => 12,
1199         ),
1200         self::SESSIONIPVALIDATION => array(
1201                                    //_('IP Session Validator')
1202             'label'                 => 'IP Session Validator',
1203                                    //_('Destroy session if the users IP changes.')
1204             'description'           => 'Destroy session if the users IP changes.',
1205             'type'                  => 'bool',
1206             'clientRegistryInclude' => FALSE,
1207             'setByAdminModule'      => FALSE,
1208             'setBySetupModule'      => TRUE,
1209         ),
1210         self::SESSIONUSERAGENTVALIDATION => array(
1211                                    //_('UA Session Validator')
1212             'label'                 => 'UA Session Validator',
1213                                    //_('Destroy session if the users user agent string changes.')
1214             'description'           => 'Destroy session if the users user agent string changes.',
1215             'type'                  => 'bool',
1216             'clientRegistryInclude' => FALSE,
1217             'setByAdminModule'      => FALSE,
1218             'setBySetupModule'      => TRUE,
1219         ),
1220         // TODO move to FILESYSTEM
1221         self::FILESDIR => array(
1222                                    //_('Files Directory')
1223             'label'                 => 'Files Directory',
1224                                    //_('Directory with web server write access for user files.')
1225             'description'           => 'Directory with web server write access for user files.',
1226             'type'                  => 'string',
1227             'clientRegistryInclude' => FALSE,
1228             'setByAdminModule'      => FALSE,
1229             'setBySetupModule'      => TRUE,
1230         ),
1231         self::REUSEUSERNAME_SAVEUSERNAME => array(
1232             //_('Reuse last username logged')
1233             'label'                 => 'Reuse last username logged',
1234             //_('Reuse last username logged')            
1235             'description'           => 'Reuse last username logged',
1236             'type'                  => 'bool',
1237             'clientRegistryInclude' => FALSE,
1238             'setByAdminModule'      => FALSE,
1239             'setBySetupModule'      => TRUE,
1240         ),
1241         self::PASSWORD_CHANGE => array(
1242         //_('User may change password')
1243             'label'                 => 'User may change password',
1244         //_('User may change password')
1245             'description'           => 'User may change password',
1246             'type'                  => 'bool',
1247             'clientRegistryInclude' => TRUE,
1248             'setByAdminModule'      => FALSE,
1249             'setBySetupModule'      => TRUE,
1250             'default'               => TRUE
1251         ),
1252         self::PASSWORD_POLICY_ACTIVE => array(
1253         //_('Enable password policy')
1254             'label'                 => 'Enable password policy',
1255         //_('Enable password policy')
1256             'description'           => 'Enable password policy',
1257             'type'                  => 'bool',
1258             'clientRegistryInclude' => TRUE,
1259             'setByAdminModule'      => FALSE,
1260             'setBySetupModule'      => TRUE,
1261         ),
1262         self::PASSWORD_POLICY_ONLYASCII => array(
1263         //_('Only ASCII')
1264             'label'                 => 'Only ASCII',
1265         //_('Only ASCII characters are allowed in passwords.')
1266             'description'           => 'Only ASCII characters are allowed in passwords.',
1267             'type'                  => 'bool',
1268             'clientRegistryInclude' => FALSE,
1269             'setByAdminModule'      => FALSE,
1270             'setBySetupModule'      => TRUE,
1271         ),
1272         self::PASSWORD_POLICY_MIN_LENGTH => array(
1273         //_('Minimum length')
1274             'label'                 => 'Minimum length',
1275         //_('Minimum password length')
1276             'description'           => 'Minimum password length.',
1277             'type'                  => 'int',
1278             'clientRegistryInclude' => TRUE,
1279             'setByAdminModule'      => FALSE,
1280             'setBySetupModule'      => TRUE,
1281         ),
1282         self::PASSWORD_POLICY_MIN_WORD_CHARS => array(
1283         //_('Minimum word chars')
1284             'label'                 => 'Minimum word chars',
1285         //_('Minimum word chars in password')
1286             'description'           => 'Minimum word chars in password',
1287             'type'                  => 'int',
1288             'clientRegistryInclude' => TRUE,
1289             'setByAdminModule'      => FALSE,
1290             'setBySetupModule'      => TRUE,
1291         ),
1292         self::PASSWORD_POLICY_MIN_UPPERCASE_CHARS => array(
1293         //_('Minimum uppercase chars')
1294             'label'                 => 'Minimum uppercase chars',
1295         //_('Minimum uppercase chars in password')
1296             'description'           => 'Minimum uppercase chars in password',
1297             'type'                  => 'int',
1298             'clientRegistryInclude' => TRUE,
1299             'setByAdminModule'      => FALSE,
1300             'setBySetupModule'      => TRUE,
1301         ),
1302         self::PASSWORD_POLICY_MIN_SPECIAL_CHARS => array(
1303         //_('Minimum special chars')
1304             'label'                 => 'Minimum special chars',
1305         //_('Minimum special chars in password')
1306             'description'           => 'Minimum special chars in password',
1307             'type'                  => 'int',
1308             'clientRegistryInclude' => TRUE,
1309             'setByAdminModule'      => FALSE,
1310             'setBySetupModule'      => TRUE,
1311         ),
1312         self::PASSWORD_POLICY_MIN_NUMBERS => array(
1313         //_('Minimum numbers')
1314             'label'                 => 'Minimum numbers',
1315         //_('Minimum numbers in password')
1316             'description'           => 'Minimum numbers in password',
1317             'type'                  => 'int',
1318             'clientRegistryInclude' => TRUE,
1319             'setByAdminModule'      => FALSE,
1320             'setBySetupModule'      => TRUE,
1321         ),
1322         self::PASSWORD_POLICY_FORBID_USERNAME => array(
1323         //_('Forbid part of username')
1324             'label'                 => 'Forbid part of username',
1325         //_('Forbid part of username in password')
1326             'description'           => 'Forbid part of username in password',
1327             'type'                  => 'bool',
1328             'clientRegistryInclude' => FALSE,
1329             'setByAdminModule'      => FALSE,
1330             'setBySetupModule'      => TRUE,
1331         ),
1332         self::PASSWORD_POLICY_CHANGE_AFTER => array(
1333         //_('Change Password After ... Days')
1334             'label'                 => 'Change Password After ... Days',
1335         //_('Users need to change their passwords after defined number of days')
1336             'description'           => 'Users need to change their passwords after defined number of days',
1337             'type'                  => 'integer',
1338             'clientRegistryInclude' => FALSE,
1339             'setByAdminModule'      => FALSE,
1340             'setBySetupModule'      => TRUE,
1341             'default'               => 0,
1342         ),
1343         self::AUTOMATIC_BUGREPORTS => array(
1344                                    //_('Automatic bugreports')
1345             'label'                 => 'Automatic bugreports',
1346                                    //_('Always send bugreports, even on timeouts and other exceptions / failures.')
1347             'description'           => 'Always send bugreports, even on timeouts and other exceptions / failures.',
1348             'type'                  => 'bool',
1349             'clientRegistryInclude' => TRUE,
1350             'setByAdminModule'      => FALSE,
1351             'setBySetupModule'      => TRUE,
1352         ),
1353         self::LAST_SESSIONS_CLEANUP_RUN => array(
1354                                    //_('Last sessions cleanup run')
1355             'label'                 => 'Last sessions cleanup run',
1356                                    //_('Stores the timestamp of the last sessions cleanup task run.')
1357             'description'           => 'Stores the timestamp of the last sessions cleanup task run.',
1358             'type'                  => self::TYPE_DATETIME,
1359             'clientRegistryInclude' => FALSE,
1360             'setByAdminModule'      => FALSE,
1361             'setBySetupModule'      => FALSE,
1362         ),
1363         self::WARN_LOGIN_FAILURES => array(
1364             //_('Warn after X login failures')
1365             'label'                 => 'Warn after X login failures',
1366             //_('Maximum allowed login failures before writing warn log messages')
1367             'description'           => 'Maximum allowed login failures before writing warn log messages',
1368             'type'                  => 'int',
1369             'clientRegistryInclude' => FALSE,
1370             'setByAdminModule'      => FALSE,
1371             'setBySetupModule'      => TRUE,
1372             'default'               => 4
1373         ),
1374         self::ANYONE_ACCOUNT_DISABLED => array(
1375                                    //_('Disable Anyone Account')
1376             'label'                 => 'Disable Anyone Account',
1377                                    //_('Disallow anyone account in grant configurations')
1378             'description'           => 'Disallow anyone account in grant configurations',
1379             'type'                  => 'bool',
1380             'clientRegistryInclude' => TRUE,
1381             'setByAdminModule'      => FALSE,
1382             'setBySetupModule'      => TRUE,
1383         ),
1384         self::ALARMS_EACH_JOB => array(
1385                                    //_('Alarms sent each job')
1386             'label'                 => 'Alarms sent each job',
1387                                    //_('Allows to configure the maximum number of alarm notifications in each run of sendPendingAlarms (0 = no limit)')
1388             'description'           => 'Allows to configure the maximum number of alarm notifications in each run of sendPendingAlarms (0 = no limit)',
1389             'type'                  => 'integer',
1390             'clientRegistryInclude' => FALSE,
1391             'setByAdminModule'      => FALSE,
1392             'setBySetupModule'      => TRUE,
1393         ),
1394         self::ACCOUNT_DEACTIVATION_NOTIFICATION => array(
1395             //_('Account deactivation notfication')
1396             'label'                 => 'Account deactivation notfication',
1397             //_('Send E-Mail to user if the account is deactivated or the user tries to login with deactivated account')
1398             'description'           => 'Send E-Mail to User if the account is deactivated or the user tries to login with deactivated account',
1399             'type'                  => 'bool',
1400             'clientRegistryInclude' => FALSE,
1401             'setByAdminModule'      => FALSE,
1402             'setBySetupModule'      => TRUE,
1403         ),
1404         self::ROLE_CHANGE_ALLOWED => array(
1405                                    //_('Role change allowed')
1406             'label'                 => 'Role change allowed',
1407                                    //_('Allows to configure which user is allowed to switch to another users account')
1408             'description'           => 'Allows to configure which user is allowed to switch to another users account',
1409             'type'                  => 'Tinebase_Config_Struct',
1410             'clientRegistryInclude' => TRUE,
1411             'setByAdminModule'      => FALSE,
1412             'setBySetupModule'      => TRUE,
1413         ),
1414         self::MAX_USERNAME_LENGTH => array(
1415             //_('Max username length')
1416             'label'                 => 'Max username length',
1417             //_('Max username length')
1418             'description'           => 'Max username length',
1419             'type'                  => 'int',
1420             'default'               => NULL,
1421             'clientRegistryInclude' => FALSE,
1422         ),
1423         self::CONFD_FOLDER => array(
1424             //_('conf.d folder name')
1425             'label'                 => 'conf.d folder name',
1426             //_('Folder for additional config files (conf.d) - NOTE: this is only used if set in config.inc.php!')
1427             'description'           => 'Folder for additional config files (conf.d) - NOTE: this is only used if set in config.inc.php!',
1428             'type'                  => 'string',
1429             'default'               => '',
1430             'clientRegistryInclude' => FALSE,
1431             'setByAdminModule'      => FALSE,
1432             'setBySetupModule'      => FALSE,
1433         ),
1434         self::MAINTENANCE_MODE => array(
1435             //_('Maintenance mode enabled')
1436             'label'                 => 'Maintenance mode enabled',
1437             //_('Folder for additional config files (conf.d) - NOTE: this is only used if set in config.inc.php!')
1438             'description'           => 'Installation is in maintenance mode. With this only users having the maintenance right can login',
1439             'type'                  => 'bool',
1440             'default'               => '',
1441             'clientRegistryInclude' => FALSE,
1442             'setByAdminModule'      => TRUE,
1443             'setBySetupModule'      => TRUE,
1444         ),
1445         self::VERSION_CHECK => array(
1446             //_('Version check enabled')
1447             'label'                 => 'Version check enabled',
1448             'description'           => 'Version check enabled',
1449             'type'                  => 'bool',
1450             'default'               => true,
1451             'clientRegistryInclude' => true,
1452             'setByAdminModule'      => false,
1453             'setBySetupModule'      => false,
1454         ),
1455         self::FAT_CLIENT_CUSTOM_JS => array(
1456             // NOTE: it's possible to deliver customjs vom vfs by using the tine20:// streamwrapper
1457             //       tine20://<applicationid>/folders/shared/<containerid>/custom.js
1458             //_('Custom Javascript includes for Fat-Client')
1459             'label'                 => 'Custom Javascript includes for Fat-Client',
1460             //_('An array of javascript files to include for the fat client. This files might be stored outside the docroot of the webserver.')
1461             'description'           => "An array of javascript files to include for the fat client. This files might be stored outside the docroot of the webserver.",
1462             'type'                  => 'array',
1463             'default'               => array(),
1464             'clientRegistryInclude' => FALSE,
1465             'setByAdminModule'      => FALSE,
1466             'setBySetupModule'      => FALSE,
1467         ),
1468         self::BRANDING_DESCRIPTION => array(
1469                 //_('custom description')
1470                 'label'                 => 'custom description',
1471                 //_('Custom description for branding.')
1472                 'description'           => 'Custom description for branding.',
1473                 'type'                  => 'string',
1474                 'default'               => '',
1475                 'clientRegistryInclude' => FALSE,
1476                 'setByAdminModule'      => FALSE,
1477                 'setBySetupModule'      => FALSE,
1478         ),
1479         self::BRANDING_WEBURL => array(
1480                 //_('custom weburl')
1481                 'label'                 => 'custom weburl',
1482                 //_('Custom weburl for branding.')
1483                 'description'           => 'Custom weburl for branding.',
1484                 'type'                  => 'string',
1485                 'default'               => '',
1486                 'clientRegistryInclude' => FALSE,
1487                 'setByAdminModule'      => FALSE,
1488                 'setBySetupModule'      => FALSE,
1489         ),
1490         self::BRANDING_TITLE => array(
1491                 //_('custom title')
1492                 'label'                 => 'custom title',
1493                 //_('Custom title for branding.')
1494                 'description'           => 'Custom ltitle for branding.',
1495                 'type'                  => 'string',
1496                 'default'               => '',
1497                 'clientRegistryInclude' => FALSE,
1498                 'setByAdminModule'      => FALSE,
1499                 'setBySetupModule'      => FALSE,
1500         ),
1501         self::BRANDING_LOGO => array(
1502                 //_('custom logo path')
1503                 'label'                 => 'custom logo path',
1504                 //_('Path to custom logo.')
1505                 'description'           => 'Path to custom logo.',
1506                 'type'                  => 'string',
1507                 'default'               => './images/tine_logo.png',
1508                 'clientRegistryInclude' => FALSE,
1509                 'setByAdminModule'      => FALSE,
1510                 'setBySetupModule'      => FALSE,
1511         ),
1512         self::BRANDING_FAVICON => array(
1513                 //_('custom favicon path')
1514                 'label'                 => 'custom favicon path',
1515                 //_('Path to custom favicon.')
1516                 'description'           => 'Path to custom favicon.',
1517                 'type'                  => 'string',
1518                 'default'               => '',
1519                 'clientRegistryInclude' => FALSE,
1520                 'setByAdminModule'      => FALSE,
1521                 'setBySetupModule'      => FALSE,
1522         ),
1523         self::USE_LOGINNAME_AS_FOLDERNAME => array(
1524         //_('Use login name instead of full name')
1525             'label'                 => 'Use login name instead of full name',
1526         //_('Use login name instead of full name for webdav.')
1527             'description'           => 'Use login name instead of full name for webdav.',
1528             'type'                  => 'bool',
1529             'clientRegistryInclude' => FALSE,
1530             'setByAdminModule'      => FALSE,
1531             'setBySetupModule'      => FALSE,
1532             'default'               => FALSE,
1533         ),
1534         self::DENY_WEBDAV_CLIENT_LIST  => array(
1535             //_('List of WebDav agent strings that will be denied')
1536             'label'                 => 'List of WebDav agent strings that will be denied',
1537             //_('List of WebDav agent strings that will be denied.')
1538             'description'           => 'List of WebDav agent strings that will be denied.',
1539             'type'                  => 'array',
1540             'clientRegistryInclude' => FALSE,
1541             'setByAdminModule'      => FALSE,
1542             'setBySetupModule'      => FALSE,
1543             'default'               => NULL,
1544         ),
1545         self::WEBDAV_SYNCTOKEN_ENABLED => array(
1546         //_('Enable SyncToken plugin')
1547             'label'                 => 'Enable SyncToken plugin',
1548         //_('Enable the use of the SyncToken plugin.')
1549             'description'           => 'Enable the use of the SyncToken plugin.',
1550             'type'                  => 'bool',
1551             'clientRegistryInclude' => FALSE,
1552             'setByAdminModule'      => FALSE,
1553             'setBySetupModule'      => FALSE,
1554             'default'               => TRUE,
1555         ),
1556         self::CURRENCY_SYMBOL => array(
1557             //_('currency symbol')
1558             'label' => 'urrency symbol',
1559             //_('Path to custom favicon.')
1560             'description' => 'Define currency symbol to be used.',
1561             'type' => 'string',
1562             'default' => '€',
1563             'clientRegistryInclude' => true,
1564             'setByAdminModule' => false,
1565             'setBySetupModule' => false,
1566         ),
1567         self::FILESYSTEM => array(
1568             //_('Filesystem settings')
1569             'label'                 => 'Filesystem settings',
1570             //_('Filesystem settings.')
1571             'description'           => 'Filesystem settings.',
1572             'type'                  => 'object',
1573             'class'                 => 'Tinebase_Config_Struct',
1574             'clientRegistryInclude' => TRUE,
1575             'setByAdminModule'      => FALSE,
1576             'setBySetupModule'      => FALSE,
1577             'content'               => array(
1578                 self::FILESYSTEM_MODLOGACTIVE => array(
1579                     //_('Filesystem history')
1580                     'label'                 => 'Filesystem history',
1581                     //_('Filesystem keeps history, default is false.')
1582                     'description'           => 'Filesystem keeps history, default is false.',
1583                     'type'                  => 'bool',
1584                     'clientRegistryInclude' => TRUE,
1585                     'setByAdminModule'      => FALSE,
1586                     'setBySetupModule'      => FALSE,
1587                     'default'               => FALSE,
1588                 ),
1589                 self::FILESYSTEM_NUMKEEPREVISIONS => array(
1590                     //_('Filesystem number of revisions')
1591                     'label'                 => 'Filesystem number of revisions',
1592                     //_('Filesystem number of revisions being kept before they are automatically deleted.')
1593                     'description'           => 'Filesystem number of revisions being kept before they are automatically deleted.',
1594                     'type'                  => 'integer',
1595                     'clientRegistryInclude' => TRUE,
1596                     'setByAdminModule'      => FALSE,
1597                     'setBySetupModule'      => FALSE,
1598                     'default'               => 100,
1599                 ),
1600                 self::FILESYSTEM_MONTHKEEPREVISIONS => array(
1601                     //_('Filesystem months of revisions')
1602                     'label'                 => 'Filesystem months of revisions',
1603                     //_('Filesystem number of months revisions being kept before they are automatically deleted.')
1604                     'description'           => 'Filesystem number of months revisions being kept before they are automatically deleted.',
1605                     'type'                  => 'integer',
1606                     'clientRegistryInclude' => TRUE,
1607                     'setByAdminModule'      => FALSE,
1608                     'setBySetupModule'      => FALSE,
1609                     'default'               => 60,
1610                 ),
1611                 self::FILESYSTEM_INDEX_CONTENT => array(
1612                     //_('Filesystem index content')
1613                     'label'                 => 'Filesystem index content',
1614                     //_('Filesystem index content.')
1615                     'description'           => 'Filesystem index content.',
1616                     'type'                  => 'bool',
1617                     'clientRegistryInclude' => TRUE,
1618                     'setByAdminModule'      => FALSE,
1619                     'setBySetupModule'      => FALSE,
1620                     'default'               => FALSE,
1621                 ),
1622                 self::FILESYSTEM_ENABLE_NOTIFICATIONS => array(
1623                     //_('Filesystem enable notifications')
1624                     'label'                 => 'Filesystem enable notifications',
1625                     //_('Filesystem enable notifications.')
1626                     'description'           => 'Filesystem enable notifications.',
1627                     'type'                  => 'bool',
1628                     'clientRegistryInclude' => TRUE,
1629                     'setByAdminModule'      => FALSE,
1630                     'setBySetupModule'      => FALSE,
1631                     'default'               => FALSE,
1632                 ),
1633                 self::FILESYSTEM_CREATE_PREVIEWS => array(
1634                     //_('Filesystem create previews')
1635                     'label'                 => 'Filesystem create previews',
1636                     //_('Filesystem create previews.')
1637                     'description'           => 'Filesystem create previews.',
1638                     'type'                  => 'bool',
1639                     'clientRegistryInclude' => TRUE,
1640                     'setByAdminModule'      => FALSE,
1641                     'setBySetupModule'      => FALSE,
1642                     'default'               => FALSE,
1643                 ),
1644                 self::FILESYSTEM_PREVIEW_SERVICE_URL => array(
1645                     //_('URL of preview service')
1646                     'label'                 => 'URL of preview service',
1647                     //_('URL of preview service.')
1648                     'description'           => 'URL of preview service.',
1649                     'type'                  => 'string',
1650                     'clientRegistryInclude' => FALSE,
1651                     'setByAdminModule'      => FALSE,
1652                     'setBySetupModule'      => FALSE,
1653                     'default'               => NULL,
1654                 ),
1655             ),
1656             'default'               => array(),
1657         ),
1658         self::QUOTA => array(
1659             //_('Quota settings')
1660             'label'                 => 'Quota settings',
1661             //_('Quota settings')
1662             'description'           => 'Quota settings',
1663             'type'                  => 'object',
1664             'class'                 => 'Tinebase_Config_Struct',
1665             'clientRegistryInclude' => true,
1666             'setByAdminModule'      => true,
1667             'setBySetupModule'      => false,
1668             'content'               => array(
1669                 self::QUOTA_INCLUDE_REVISION => array(
1670                     //_('Include revisions')
1671                     'label'                 => 'Include revisions',
1672                     //_('Should all revisions be used to calculate total usage?')
1673                     'description'           => 'Should all revisions be used to calculate total usage?',
1674                     'type'                  => 'bool',
1675                     'clientRegistryInclude' => true,
1676                     'setByAdminModule'      => true,
1677                     'setBySetupModule'      => false,
1678                     'default'               => false,
1679                 ),
1680                 self::QUOTA_TOTALINMB => array(
1681                     //_('Total quota in MB')
1682                     'label'                 => 'Total quota in MB',
1683                     //_('Total quota in MB (0 for unlimited)')
1684                     'description'           => 'Total quota in MB (0 for unlimited)',
1685                     'type'                  => 'integer',
1686                     'clientRegistryInclude' => true,
1687                     'setByAdminModule'      => true,
1688                     'setBySetupModule'      => false,
1689                     'default'               => 0,
1690                 ),
1691                 self::QUOTA_TOTALBYUSERINMB => array(
1692                     //_('Total quota by user in MB')
1693                     'label'                 => 'Total quota by user in MB',
1694                     //_('Total quota by user in MB (0 for unlimited)')
1695                     'description'           => 'Total quota by user in MB (0 for unlimited)',
1696                     'type'                  => 'integer',
1697                     'clientRegistryInclude' => true,
1698                     'setByAdminModule'      => true,
1699                     'setBySetupModule'      => false,
1700                     'default'               => 0,
1701                 ),
1702                 self::QUOTA_SOFT_QUOTA => array(
1703                     //_('Soft quota in %')
1704                     'label'                 => 'Soft quota in %',
1705                     //_('Soft quota in % (0-100, 0 means off)')
1706                     'description'           => 'Soft quota in % (0-100, 0 means off)',
1707                     'type'                  => 'integer',
1708                     'clientRegistryInclude' => true,
1709                     'setByAdminModule'      => true,
1710                     'setBySetupModule'      => false,
1711                     'default'               => 90,
1712                 ),
1713                 self::QUOTA_SQ_NOTIFICATION_ROLE => array(
1714                     //_('Soft quota notification role')
1715                     'label'                 => 'Soft quota notification role',
1716                     //_('Name of the role to notify if soft quote is exceeded')
1717                     'description'           => 'Name of the role to notify if soft quote is exceeded',
1718                     'type'                  => 'string',
1719                     'clientRegistryInclude' => true,
1720                     'setByAdminModule'      => true,
1721                     'setBySetupModule'      => false,
1722                     'default'               => 'soft quota notification',
1723                 ),
1724             ),
1725             'default'               => array(),
1726         ),
1727         /*
1728
1729     const QUOTA_SQ_NOTIFICATION_ROLE = 'softQuotaNotificationRole';*/
1730     );
1731     
1732     /**
1733      * (non-PHPdoc)
1734      * @see tine20/Tinebase/Config/Abstract::$_appName
1735      */
1736     protected $_appName = 'Tinebase';
1737     
1738     /**
1739      * holds the instance of the singleton
1740      *
1741      * @var Tinebase_Config
1742      */
1743     private static $_instance = NULL;
1744
1745     /**
1746      * server classes
1747      *
1748      * @var array
1749      */
1750     protected static $_serverPlugins = array(
1751         'Tinebase_Server_Plugin_Json'   => 80,
1752         'Tinebase_Server_Plugin_WebDAV' => 80,
1753         'Tinebase_Server_Plugin_Cli'    => 90,
1754         'Tinebase_Server_Plugin_Http'   => 100
1755     );
1756
1757     /**
1758      * the constructor
1759      *
1760      * don't use the constructor. use the singleton 
1761      */
1762     private function __construct() {}
1763     
1764     /**
1765      * the constructor
1766      *
1767      * don't use the constructor. use the singleton 
1768      */
1769     private function __clone() {}
1770     
1771     /**
1772      * Returns instance of Tinebase_Config
1773      *
1774      * @return Tinebase_Config
1775      */
1776     public static function getInstance() 
1777     {
1778         if (self::$_instance === NULL) {
1779             self::$_instance = new Tinebase_Config();
1780         }
1781         
1782         return self::$_instance;
1783     }
1784     
1785     /**
1786      * (non-PHPdoc)
1787      * @see tine20/Tinebase/Config/Abstract::getProperties()
1788      */
1789     public static function getProperties()
1790     {
1791         return self::$_properties;
1792     }
1793     
1794     /**
1795      * get config for client registry
1796      * 
1797      * @return Tinebase_Config_Struct
1798      */
1799     public function getClientRegistryConfig()
1800     {
1801         // get all config names to be included in registry
1802         $clientProperties = new Tinebase_Config_Struct(array());
1803         $userApplications = Tinebase_Core::getUser()->getApplications(TRUE);
1804         foreach ($userApplications as $application) {
1805             $config = Tinebase_Config_Abstract::factory($application->name);
1806             if ($config) {
1807                 $clientProperties[$application->name] = new Tinebase_Config_Struct(array());
1808                 $properties = $config->getProperties();
1809                 foreach ((array) $properties as $name => $definition) {
1810                     
1811                     if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__ 
1812                         . ' ' . print_r($definition, TRUE));
1813                     
1814                     if (isset($definition['clientRegistryInclude']) && $definition['clientRegistryInclude'] === TRUE)
1815                     {
1816                         // add definition here till we have a better place
1817                         try {
1818                             $configRegistryItem = new Tinebase_Config_Struct(array(
1819                                 'value' => $config->{$name},
1820                                 'definition' => new Tinebase_Config_Struct($definition),
1821                             ), null, null, array(
1822                                 'value' => array('type' => $definition['type']),
1823                                 'definition' => array('type' => Tinebase_Config_Abstract::TYPE_ARRAY, 'class' => 'Tinebase_Config_Struct')
1824                             ));
1825                             if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__
1826                                 . ' ' . print_r($configRegistryItem->toArray(), TRUE));
1827                             $clientProperties[$application->name][$name] = $configRegistryItem;
1828                         } catch (Exception $e) {
1829                             Tinebase_Exception::log($e);
1830                         }
1831                     }
1832                 }
1833                 if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ 
1834                     . ' Got ' . count($clientProperties[$application->name]) . ' config items for ' . $application->name . '.');
1835             }
1836         }
1837         
1838         return $clientProperties;
1839     }
1840     
1841     /**
1842      * get application config
1843      *
1844      * @param  string  $applicationName Application name
1845      * @return Tinebase_Config_Abstract  $configClass
1846      */
1847     public static function getAppConfig($applicationName)
1848     {
1849         $configClassName = $applicationName . '_Config';
1850         if (@class_exists($configClassName)) {
1851             /** @noinspection PhpUndefinedMethodInspection */
1852             return $configClassName::getInstance();
1853         } else {
1854             if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__
1855                 . ' Application ' . $applicationName . ' has no config.');
1856             return NULL;
1857         }
1858     }
1859 }