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