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