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