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