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>
14 * the class provides functions to handle config options
19 * @todo remove all deprecated stuff
21 class Tinebase_Config extends Tinebase_Config_Abstract
24 * authentication backend config
28 const AUTHENTICATIONBACKEND = 'Tinebase_Authentication_BackendConfiguration';
31 * authentication backend type config
35 const AUTHENTICATIONBACKENDTYPE = 'Tinebase_Authentication_BackendType';
38 * authentication second factor
42 const AUTHENTICATIONSECONDFACTOR = 'Tinebase_Authentication_SecondFactor';
45 * save automatic alarms when creating new record
49 const AUTOMATICALARM = 'automaticalarm';
56 const AVAILABLE_LANGUAGES = 'availableLanguages';
63 const DEFAULT_LOCALE = 'defaultLocale';
70 const INTERNET_PROXY = 'internetProxy';
91 const SIEVE = 'sieve';
98 const USERBACKEND = 'Tinebase_User_BackendConfiguration';
101 * sync options for user backend
105 const SYNCOPTIONS = 'syncOptions';
108 * user backend type config
112 const USERBACKENDTYPE = 'Tinebase_User_BackendType';
119 const CRONUSERID = 'cronuserid';
126 const SETUPUSERID = 'setupuserid';
129 * FEATURE_SHOW_ADVANCED_SEARCH
133 const FEATURE_SHOW_ADVANCED_SEARCH = 'featureShowAdvancedSearch';
136 * FEATURE_CONTAINER_CUSTOM_SORT
140 const FEATURE_CONTAINER_CUSTOM_SORT = 'featureContainerCustomSort';
143 * FEATURE_SHOW_ACCOUNT_EMAIL
147 const FEATURE_SHOW_ACCOUNT_EMAIL = 'featureShowAccountEmail';
150 * FEATURE_REMEMBER_POPUP_SIZE
154 const FEATURE_REMEMBER_POPUP_SIZE = 'featureRememberPopupSize';
161 const FEATURE_SEARCH_PATH = 'featureSearchPath';
164 * user defined page title postfix for browser page title
168 const PAGETITLEPOSTFIX = 'pagetitlepostfix';
171 * logout redirect url
175 const REDIRECTURL = 'redirectUrl';
182 const REDIRECTALWAYS = 'redirectAlways';
185 * Config key for Setting "Redirect to referring site if exists?"
189 const REDIRECTTOREFERRER = 'redirectToReferrer';
192 * Config key for configuring allowed origins of the json frontend
196 const ALLOWEDJSONORIGINS = 'allowedJsonOrigins';
199 * Config key for acceptedTermsVersion
202 const ACCEPTEDTERMSVERSION = 'acceptedTermsVersion';
205 * Config key for map panel in addressbook / include geoext code
208 const MAPPANEL = 'mapPanel';
211 * disable ldap certificate check
215 const LDAP_DISABLE_TLSREQCERT = 'ldapDisableTlsReqCert';
218 * overwritten ldap fields
222 const LDAP_OVERWRITE_CONTACT_FIELDS = 'ldapOverwriteContactFields';
225 * configure hook class for user sync
229 const SYNC_USER_HOOK_CLASS = 'syncUserHookClass';
232 * configure if user contact data should be synced from sync backend, default yes
236 const SYNC_USER_CONTACT_DATA = 'syncUserContactData';
239 * configure if user contact photo should be synced from sync backend, default yes
243 const SYNC_USER_CONTACT_PHOTO = 'syncUserContactPhoto';
246 * configure if deleted users from sync back should be deleted in sql backend, default yes
250 const SYNC_DELETED_USER = 'syncDeletedUser';
253 * configure when user should be removed from sql after it is removed from sync backend
257 const SYNC_USER_DELETE_AFTER = 'syncUserDeleteAfter';
260 * Config key for session ip validation -> if this is set to FALSE no Zend_Session_Validator_IpAddress is registered
264 const SESSIONIPVALIDATION = 'sessionIpValidation';
267 * Config key for session user agent validation -> if this is set to FALSE no Zend_Session_Validator_HttpUserAgent is registered
271 const SESSIONUSERAGENTVALIDATION = 'sessionUserAgentValidation';
274 * filestore directory
278 const FILESDIR = 'filesdir';
283 * @deprecated move to app config
286 const XLSEXPORTCONFIG = 'xlsexportconfig';
291 * @deprecated move to app and split
294 const APPDEFAULTS = 'appdefaults';
297 * REUSEUSERNAME_SAVEUSERNAME
301 const REUSEUSERNAME_SAVEUSERNAME = 'saveusername';
308 const PASSWORD_CHANGE = 'changepw';
311 * PASSWORD_POLICY_ACTIVE
315 const PASSWORD_POLICY_ACTIVE = 'pwPolicyActive';
318 * PASSWORD_POLICY_ONLYASCII
322 const PASSWORD_POLICY_ONLYASCII = 'pwPolicyOnlyASCII';
325 * PASSWORD_POLICY_MIN_LENGTH
329 const PASSWORD_POLICY_MIN_LENGTH = 'pwPolicyMinLength';
332 * PASSWORD_POLICY_MIN_WORD_CHARS
336 const PASSWORD_POLICY_MIN_WORD_CHARS = 'pwPolicyMinWordChars';
339 * PASSWORD_POLICY_MIN_UPPERCASE_CHARS
343 const PASSWORD_POLICY_MIN_UPPERCASE_CHARS = 'pwPolicyMinUppercaseChars';
346 * PASSWORD_POLICY_MIN_SPECIAL_CHARS
350 const PASSWORD_POLICY_MIN_SPECIAL_CHARS = 'pwPolicyMinSpecialChars';
353 * PASSWORD_POLICY_MIN_NUMBERS
357 const PASSWORD_POLICY_MIN_NUMBERS = 'pwPolicyMinNumbers';
360 * PASSWORD_POLICY_FORBID_USERNAME
364 const PASSWORD_POLICY_FORBID_USERNAME = 'pwPolicyForbidUsername';
367 * AUTOMATIC_BUGREPORTS
371 const AUTOMATIC_BUGREPORTS = 'automaticBugreports';
374 * LAST_SESSIONS_CLEANUP_RUN
378 const LAST_SESSIONS_CLEANUP_RUN = 'lastSessionsCleanupRun';
381 * WARN_LOGIN_FAILURES
385 const WARN_LOGIN_FAILURES = 'warnLoginFailures';
388 * ANYONE_ACCOUNT_DISABLED
392 const ANYONE_ACCOUNT_DISABLED = 'anyoneAccountDisabled';
399 const ALARMS_EACH_JOB = 'alarmsEachJob';
402 * ACCOUNT_DEACTIVATION_NOTIFICATION
406 const ACCOUNT_DEACTIVATION_NOTIFICATION = 'accountDeactivationNotification';
409 * ACCOUNT_DELETION_EVENTCONFIGURATION
413 const ACCOUNT_DELETION_EVENTCONFIGURATION = 'accountDeletionEventConfiguration';
420 const ROLE_CHANGE_ALLOWED = 'roleChangeAllowed';
423 * max username length
427 const MAX_USERNAME_LENGTH = 'max_username_length';
434 const CONFD_FOLDER = 'confdfolder';
441 const MAINTENANCE_MODE = 'maintenanceMode';
446 const FAT_CLIENT_CUSTOM_JS = 'fatClientCustomJS';
448 const BRANDING_LOGO = 'branding_logo';
449 const BRANDING_FAVICON = 'branding_favicon';
450 const BRANDING_TITLE = 'branding_title';
451 const BRANDING_WEBURL = 'branding_weburl';
452 const BRANDING_DESCRIPTION = 'branding_description';
457 const USE_LOGINNAME_AS_FOLDERNAME = 'useLoginnameAsFoldername';
462 const DENY_WEBDAV_CLIENT_LIST = 'denyWebDavClientList';
467 const VERSION_CHECK = 'versionCheck';
472 const REPLICATION_MASTER = 'replicationMaster';
477 const REPLICATION_SLAVE = 'replicationSlave';
482 const REPLICATION_USER_PASSWORD = 'replicationUserPassword';
487 const MASTER_URL = 'masterURL';
492 const MASTER_USERNAME = 'masterUsername';
497 const MASTER_PASSWORD = 'masterPassword';
502 const ERROR_NOTIFICATION_LIST = 'errorNotificationList';
504 const FULLTEXT = 'fulltext';
505 const FULLTEXT_BACKEND = 'backend';
506 const FULLTEXT_JAVABIN = 'javaBin';
507 const FULLTEXT_TIKAJAR = 'tikaJar';
509 const FILESYSTEM = 'filesystem';
510 const FILESYSTEM_MODLOGACTIVE = 'modLogActive';
511 const FILESYSTEM_NUMKEEPREVISIONS = 'numKeepRevisions';
512 const FILESYSTEM_MONTHKEEPREVISIONS = 'monthKeepRevisions';
513 const FILESYSTEM_INDEX_CONTENT = 'index_content';
514 const FILESYSTEM_CREATE_PREVIEWS = 'createPreviews';
515 const FILESYSTEM_PREVIEW_SERVICE_URL = 'previewServiceUrl';
516 const FILESYSTEM_ENABLE_NOTIFICATIONS = 'enableNotifications';
520 * @see tine20/Tinebase/Config/Definition::$_properties
522 protected static $_properties = array(
526 * $_deletePersonalContainers => delete personal containers
527 * $_keepAsContact => keep "account" as contact in the addressbook
528 * $_keepOrganizerEvents => keep accounts organizer events as external events in the calendar
529 * $_keepAsContact => keep accounts calender event attendee as external attendee
531 * TODO add more options (like move to another container)
533 self::ACCOUNT_DELETION_EVENTCONFIGURATION => array(
534 //_('Account Deletion Event')
535 'label' => 'Account Deletion Event',
536 //_('Configure what should happen to data of deleted users')
537 'description' => 'Configure what should happen to data of deleted users',
539 'class' => 'Tinebase_Config_Struct',
540 'clientRegistryInclude' => FALSE,
541 'setByAdminModule' => TRUE,
542 'setBySetupModule' => TRUE,
545 * for example: array('en', 'de')
547 self::AVAILABLE_LANGUAGES => array(
548 //_('Available Languages')
549 'label' => 'Available Languages',
550 //_('Whitelist available languages that can be chosen in the GUI')
551 'description' => 'Whitelist available languages that can be chosen in the GUI',
553 'clientRegistryInclude' => TRUE,
554 'setByAdminModule' => TRUE,
555 'setBySetupModule' => TRUE,
560 self::DEFAULT_LOCALE => array(
561 //_('Default Locale')
562 'label' => 'Default Locale',
563 //_('Default locale for this installation.')
564 'description' => 'Default locale for this installation.',
567 'clientRegistryInclude' => TRUE,
568 'setByAdminModule' => FALSE,
569 'setBySetupModule' => TRUE,
572 * config keys (see Zend_Http_Client_Adapter_Proxy):
574 * 'proxy_host' => 'proxy.com',
575 * 'proxy_port' => 3128,
576 * 'proxy_user' => 'user',
577 * 'proxy_pass' => 'pass'
579 self::INTERNET_PROXY => array(
580 //_('Internet proxy config')
581 'label' => 'Internet proxy config',
582 'description' => 'Internet proxy config',
584 'default' => array(),
585 'clientRegistryInclude' => false,
586 'setByAdminModule' => true,
587 'setBySetupModule' => true,
592 * useSystemAccount (bool)
594 * useEmailAsUsername (bool)
599 * backend (string) - see Tinebase_EmailUser::$_supportedBackends
604 'label' => 'System IMAP',
605 //_('System IMAP server configuration.')
606 'description' => 'System IMAP server configuration.',
608 'class' => 'Tinebase_Config_Struct',
609 'clientRegistryInclude' => FALSE,
610 'setByAdminModule' => FALSE,
611 'setBySetupModule' => TRUE,
615 'label' => 'System SMTP',
616 //_('System SMTP server configuration.')
617 'description' => 'System SMTP server configuration.',
619 'class' => 'Tinebase_Config_Struct',
620 'clientRegistryInclude' => FALSE,
621 'setByAdminModule' => FALSE,
622 'setBySetupModule' => TRUE,
624 self::SIEVE => array(
626 'label' => 'System SIEVE',
627 //_('System SIEVE server configuration.')
628 'description' => 'System SIEVE server configuration.',
630 'class' => 'Tinebase_Config_Struct',
631 'clientRegistryInclude' => FALSE,
632 'setByAdminModule' => FALSE,
633 'setBySetupModule' => TRUE,
635 self::AUTHENTICATIONBACKENDTYPE => array(
636 //_('Authentication Backend')
637 'label' => 'Authentication Backend',
638 //_('Backend adapter for user authentication.')
639 'description' => 'Backend adapter for user authentication.',
641 'clientRegistryInclude' => FALSE,
642 'setByAdminModule' => FALSE,
643 'setBySetupModule' => TRUE,
645 self::AUTHENTICATIONBACKEND => array(
646 //_('Authentication Configuration')
647 'label' => 'Authentication Configuration',
648 //_('Authentication backend configuration.')
649 'description' => 'Authentication backend configuration.',
651 'class' => 'Tinebase_Config_Struct',
652 'clientRegistryInclude' => FALSE,
653 'setByAdminModule' => FALSE,
654 'setBySetupModule' => TRUE,
661 * 'provider' => 'PrivacyIdea',
662 * 'url' => 'https://localhost/validate/check',
663 * 'allow_self_signed' => true,
664 * 'ignorePeerName' => true,
667 self::AUTHENTICATIONSECONDFACTOR => array(
668 //_('Second Factor Authentication Configuration')
669 'label' => 'Second Factor Authentication Configuration',
670 'description' => 'Second Factor Authentication Configuration',
672 'class' => 'Tinebase_Config_Struct',
673 'clientRegistryInclude' => FALSE,
674 'setByAdminModule' => FALSE,
675 'setBySetupModule' => TRUE,
677 self::USERBACKENDTYPE => array(
679 'label' => 'User Backend',
680 //_('Backend adapter for user data.')
681 'description' => 'Backend adapter for user data.',
683 'clientRegistryInclude' => FALSE,
684 'setByAdminModule' => FALSE,
685 'setBySetupModule' => TRUE,
687 self::REPLICATION_MASTER => array(
688 //_('Replication master configuration')
689 'label' => 'Replication master configuration',
690 //_('Replication master configuration.')
691 'description' => 'Replication master configuration.',
693 'class' => 'Tinebase_Config_Struct',
694 'clientRegistryInclude' => FALSE,
695 'setByAdminModule' => FALSE,
696 'setBySetupModule' => TRUE,
698 self::REPLICATION_USER_PASSWORD => array(
699 'type' => Tinebase_Config::TYPE_STRING
703 self::REPLICATION_SLAVE => array(
704 //_('Replication slave configuration')
705 'label' => 'Replication slave configuration',
706 //_('Replication slave configuration.')
707 'description' => 'Replication slave configuration.',
709 'class' => 'Tinebase_Config_Struct',
710 'clientRegistryInclude' => FALSE,
711 'setByAdminModule' => FALSE,
712 'setBySetupModule' => TRUE,
714 self::MASTER_URL => array(
715 'type' => Tinebase_Config::TYPE_STRING,
717 self::MASTER_USERNAME => array(
718 'type' => Tinebase_Config::TYPE_STRING,
720 self::MASTER_PASSWORD => array(
721 'type' => Tinebase_Config::TYPE_STRING,
723 self::ERROR_NOTIFICATION_LIST => array(
724 'type' => Tinebase_Config::TYPE_ARRAY,
728 self::FULLTEXT => array(
729 //_('Full text configuration')
730 'label' => 'Full text configuration',
731 //_('Full text configuration.')
732 'description' => 'Full text configuration.',
734 'class' => 'Tinebase_Config_Struct',
735 'clientRegistryInclude' => FALSE,
736 'setByAdminModule' => FALSE,
737 'setBySetupModule' => TRUE,
739 self::FULLTEXT_BACKEND => array(
740 'type' => Tinebase_Config::TYPE_STRING,
743 self::FULLTEXT_JAVABIN => array(
744 'type' => Tinebase_Config::TYPE_STRING,
747 self::FULLTEXT_TIKAJAR => array(
748 'type' => Tinebase_Config::TYPE_STRING,
753 self::USERBACKEND => array(
754 //_('User Configuration')
755 'label' => 'User Configuration',
756 //_('User backend configuration.')
757 'description' => 'User backend configuration.',
759 'class' => 'Tinebase_Config_Struct',
760 'clientRegistryInclude' => FALSE,
761 'setByAdminModule' => FALSE,
762 'setBySetupModule' => TRUE,
764 Tinebase_User::DEFAULT_USER_GROUP_NAME_KEY => array(
765 'type' => Tinebase_Config::TYPE_STRING,
767 Tinebase_User::DEFAULT_ADMIN_GROUP_NAME_KEY => array(
768 'type' => Tinebase_Config::TYPE_STRING,
771 'type' => Tinebase_Config::TYPE_STRING,
774 'type' => Tinebase_Config::TYPE_INT,
777 'type' => Tinebase_Config::TYPE_BOOL,
780 'type' => Tinebase_Config::TYPE_STRING,
783 'type' => Tinebase_Config::TYPE_STRING,
785 'bindRequiresDn' => array(
786 'type' => Tinebase_Config::TYPE_BOOL,
789 'type' => Tinebase_Config::TYPE_STRING,
791 'accountCanonicalForm' => array(
792 'type' => Tinebase_Config::TYPE_STRING,
794 'accountDomainName' => array(
795 'type' => Tinebase_Config::TYPE_STRING,
797 'accountDomainNameShort' => array(
798 'type' => Tinebase_Config::TYPE_STRING,
800 'accountFilterFormat' => array(
801 'type' => Tinebase_Config::TYPE_STRING,
803 'allowEmptyPassword' => array(
804 'type' => Tinebase_Config::TYPE_STRING,
806 'useStartTls' => array(
807 'type' => Tinebase_Config::TYPE_BOOL,
809 'optReferrals' => array(
810 'type' => Tinebase_Config::TYPE_STRING,
812 'tryUsernameSplit' => array(
813 'type' => Tinebase_Config::TYPE_BOOL,
815 'groupUUIDAttribute' => array(
816 'type' => Tinebase_Config::TYPE_STRING,
819 'type' => Tinebase_Config::TYPE_STRING,
821 'useRfc2307bis' => array(
822 'type' => Tinebase_Config::TYPE_BOOL,
825 'type' => Tinebase_Config::TYPE_STRING,
827 'userFilter' => array(
828 'type' => Tinebase_Config::TYPE_STRING,
830 'userSearchScope' => array(
831 'type' => Tinebase_Config::TYPE_STRING,
833 'groupFilter' => array(
834 'type' => Tinebase_Config::TYPE_STRING,
836 'groupSearchScope' => array(
837 'type' => Tinebase_Config::TYPE_STRING,
839 'pwEncType' => array(
840 'type' => Tinebase_Config::TYPE_STRING,
842 'minUserId' => array(
843 'type' => Tinebase_Config::TYPE_INT,
845 'maxUserId' => array(
846 'type' => Tinebase_Config::TYPE_INT,
848 'minGroupId' => array(
849 'type' => Tinebase_Config::TYPE_INT,
851 'maxGroupId' => array(
852 'type' => Tinebase_Config::TYPE_INT,
854 'userUUIDAttribute' => array(
855 'type' => Tinebase_Config::TYPE_STRING,
858 'type' => Tinebase_Config::TYPE_BOOL,
860 'useRfc2307' => array(
861 'type' => Tinebase_Config::TYPE_BOOL,
863 self::SYNCOPTIONS => array(
865 'class' => 'Tinebase_Config_Struct',
867 self::SYNC_USER_CONTACT_DATA => array(
868 //_('Sync contact data from sync backend')
869 'label' => 'Sync contact data from sync backend',
870 //_('Sync user contact data from sync backend')
871 'description' => 'Sync user contact data from sync backend',
873 'clientRegistryInclude' => FALSE,
874 'setByAdminModule' => FALSE,
875 'setBySetupModule' => FALSE,
878 self::SYNC_USER_CONTACT_PHOTO => array(
879 //_('Sync contact photo from sync backend')
880 'label' => 'Sync contact photo from sync backend',
881 //_('Sync user contact photo from sync backend')
882 'description' => 'Sync user contact photo from sync backend',
884 'clientRegistryInclude' => FALSE,
885 'setByAdminModule' => FALSE,
886 'setBySetupModule' => FALSE,
889 self::SYNC_DELETED_USER => array(
890 //_('Sync deleted users from sync backend')
891 'label' => 'Sync deleted users from sync backend',
892 //_('Sync deleted users from sync backend')
893 'description' => 'Sync deleted users from sync backend',
895 'clientRegistryInclude' => FALSE,
896 'setByAdminModule' => FALSE,
897 'setBySetupModule' => FALSE,
901 'default' => array(),
905 self::ENABLED_FEATURES => array(
906 //_('Enabled Features')
907 'label' => 'Enabled Features',
908 'description' => 'Enabled Features',
910 'class' => 'Tinebase_Config_Struct',
911 'clientRegistryInclude' => TRUE,
913 self::FEATURE_SHOW_ADVANCED_SEARCH => array(
914 'label' => 'Show Advanced Search', //_('Show Advanced Search')
915 'description' => 'Show toggle button to switch on or off the advanced search for the quickfilter',
916 //_('Show toggle button to switch on or off the advanced search for the quickfilter')
918 self::FEATURE_CONTAINER_CUSTOM_SORT => array(
919 'label' => 'Container Custom Sort', //_('Container Custom Sort')
920 'description' => 'Allows to sort containers by setting the sort order in Admin/Container',
921 //_('Allows to sort containers by setting the sort order in Admin/Container')
923 self::FEATURE_SHOW_ACCOUNT_EMAIL => array(
924 'label' => 'Show Account Email Address', //_('Show Account Email Address')
925 'description' => 'Show email address in account picker and attendee grids',
926 //_('Show email address in account picker and attendee grids')
928 self::FEATURE_REMEMBER_POPUP_SIZE => array(
929 'label' => 'Remeber Popup Size', //_('Remeber Popup Size')
930 'description' => 'Save edit dialog size in state',
931 //_('Save edit dialog size in state')
933 self::FEATURE_SEARCH_PATH => array(
934 'label' => 'Search Paths',
935 'description' => 'Search Paths'
939 self::FEATURE_SHOW_ADVANCED_SEARCH => true,
940 self::FEATURE_CONTAINER_CUSTOM_SORT => true,
941 self::FEATURE_SHOW_ACCOUNT_EMAIL => true,
942 self::FEATURE_REMEMBER_POPUP_SIZE => true,
943 self::FEATURE_SEARCH_PATH => true,
947 self::CRONUSERID => array(
949 'label' => 'Cronuser ID',
950 //_('User ID of the cron user.')
951 'description' => 'User ID of the cron user.',
953 'clientRegistryInclude' => FALSE,
954 'setByAdminModule' => TRUE,
955 'setBySetupModule' => TRUE,
957 self::PAGETITLEPOSTFIX => array(
959 'label' => 'Title Postfix',
960 //_('Postfix string appended to the title of this installation.')
961 'description' => 'Postfix string appended to the title of this installation.',
963 'clientRegistryInclude' => FALSE,
964 'setByAdminModule' => TRUE,
965 'setBySetupModule' => TRUE,
967 self::REDIRECTURL => array(
969 'label' => 'Redirect URL',
970 //_('Redirect to this URL after logout.')
971 'description' => 'Redirect to this URL after logout.',
973 'clientRegistryInclude' => FALSE,
974 'setByAdminModule' => FALSE,
975 'setBySetupModule' => TRUE,
977 self::REDIRECTTOREFERRER => array(
978 //_('Redirect to Referrer')
979 'label' => 'Redirect to Referrer',
980 //_('Redirect to referrer after logout.')
981 'description' => 'Redirect to referrer after logout.',
983 'clientRegistryInclude' => FALSE,
984 'setByAdminModule' => FALSE,
985 'setBySetupModule' => TRUE,
987 self::REDIRECTALWAYS => array(
988 //_('Redirect Always')
989 'label' => 'Redirect Always',
990 //_('Redirect to configured redirect URL also for login.')
991 'description' => 'Redirect to configured redirect URL also for login.',
993 'clientRegistryInclude' => FALSE,
994 'setByAdminModule' => FALSE,
995 'setBySetupModule' => TRUE,
997 self::ALLOWEDJSONORIGINS => array(
998 //_('Allowed Origins')
999 'label' => 'Allowed Origins',
1000 //_('Allowed Origins for the JSON API.')
1001 'description' => 'Allowed Origins for the JSON API.',
1003 'clientRegistryInclude' => FALSE,
1004 'setByAdminModule' => FALSE,
1005 'setBySetupModule' => FALSE,
1007 self::ACCEPTEDTERMSVERSION => array(
1008 //_('Accepted Terms Version')
1009 'label' => 'Accepted Terms Version',
1010 //_('Accepted version number of the terms and conditions document.')
1011 'description' => 'Accepted version number of the terms and conditions document.',
1013 'clientRegistryInclude' => FALSE,
1014 'setByAdminModule' => FALSE,
1015 'setBySetupModule' => FALSE,
1017 self::MAPPANEL => array(
1018 //_('Use Geolocation Services')
1019 'label' => 'Use Geolocation Services',
1020 //_('Use of external Geolocation services is allowed.')
1021 'description' => 'Use of external Geolocation services is allowed.',
1023 'clientRegistryInclude' => true,
1024 'setByAdminModule' => false,
1025 'setBySetupModule' => true,
1028 // TODO should this be added to LDAP config array/struct?
1029 self::LDAP_DISABLE_TLSREQCERT => array(
1030 //_('Disable LDAP TLS Certificate Check')
1031 'label' => 'Disable LDAP TLS Certificate Check',
1032 //_('LDAP TLS Certificate should not be checked')
1033 'description' => 'LDAP TLS Certificate should not be checked',
1035 'clientRegistryInclude' => false,
1036 'setByAdminModule' => false,
1037 'setBySetupModule' => true,
1040 // TODO should this be added to LDAP config array/struct?
1041 // TODO does this depend on LDAP readonly option?
1042 self::LDAP_OVERWRITE_CONTACT_FIELDS => array(
1043 //_('Contact fields overwritten by LDAP')
1044 'label' => 'Contact fields overwritten by LDAP',
1045 //_('These fields are overwritten during LDAP sync if empty')
1046 'description' => 'These fields are overwritten during LDAP sync if empty',
1048 'clientRegistryInclude' => false,
1049 'setByAdminModule' => false,
1050 'setBySetupModule' => true,
1051 'default' => array()
1053 self::SYNC_USER_HOOK_CLASS => array(
1054 //_('Configure hook class for user sync')
1055 'label' => 'Configure hook class for user sync',
1056 //_('Allows to change data after fetching user from sync backend')
1057 'description' => 'Allows to change data after fetching user from sync backend',
1059 'clientRegistryInclude' => false,
1060 'setByAdminModule' => false,
1061 'setBySetupModule' => true,
1063 self::SYNC_USER_CONTACT_DATA => array(
1064 //_('Sync contact data from sync backend')
1065 'label' => 'Sync contact data from sync backend',
1066 //_('Sync user contact data from sync backend')
1067 'description' => 'Sync user contact data from sync backend',
1069 'clientRegistryInclude' => FALSE,
1070 'setByAdminModule' => FALSE,
1071 'setBySetupModule' => FALSE,
1074 self::SYNC_USER_DELETE_AFTER => array(
1075 //_('Sync user: delete after X months)
1076 'label' => 'Sync user: delete after X months',
1077 //_('Removed users should be deleted after X months')
1078 'description' => 'Removed users should be deleted after X months',
1079 'type' => 'integer',
1080 'clientRegistryInclude' => FALSE,
1081 'setByAdminModule' => FALSE,
1082 'setBySetupModule' => FALSE,
1085 self::SESSIONIPVALIDATION => array(
1086 //_('IP Session Validator')
1087 'label' => 'IP Session Validator',
1088 //_('Destroy session if the users IP changes.')
1089 'description' => 'Destroy session if the users IP changes.',
1091 'clientRegistryInclude' => FALSE,
1092 'setByAdminModule' => FALSE,
1093 'setBySetupModule' => TRUE,
1095 self::SESSIONUSERAGENTVALIDATION => array(
1096 //_('UA Session Validator')
1097 'label' => 'UA Session Validator',
1098 //_('Destroy session if the users user agent string changes.')
1099 'description' => 'Destroy session if the users user agent string changes.',
1101 'clientRegistryInclude' => FALSE,
1102 'setByAdminModule' => FALSE,
1103 'setBySetupModule' => TRUE,
1105 // TODO move to FILESYSTEM
1106 self::FILESDIR => array(
1107 //_('Files Directory')
1108 'label' => 'Files Directory',
1109 //_('Directory with web server write access for user files.')
1110 'description' => 'Directory with web server write access for user files.',
1112 'clientRegistryInclude' => FALSE,
1113 'setByAdminModule' => FALSE,
1114 'setBySetupModule' => TRUE,
1116 self::REUSEUSERNAME_SAVEUSERNAME => array(
1117 //_('Reuse last username logged')
1118 'label' => 'Reuse last username logged',
1119 //_('Reuse last username logged')
1120 'description' => 'Reuse last username logged',
1122 'clientRegistryInclude' => FALSE,
1123 'setByAdminModule' => FALSE,
1124 'setBySetupModule' => TRUE,
1126 self::PASSWORD_CHANGE => array(
1127 //_('User may change password')
1128 'label' => 'User may change password',
1129 //_('User may change password')
1130 'description' => 'User may change password',
1132 'clientRegistryInclude' => TRUE,
1133 'setByAdminModule' => FALSE,
1134 'setBySetupModule' => TRUE,
1137 self::PASSWORD_POLICY_ACTIVE => array(
1138 //_('Enable password policy')
1139 'label' => 'Enable password policy',
1140 //_('Enable password policy')
1141 'description' => 'Enable password policy',
1143 'clientRegistryInclude' => TRUE,
1144 'setByAdminModule' => FALSE,
1145 'setBySetupModule' => TRUE,
1147 self::PASSWORD_POLICY_ONLYASCII => array(
1149 'label' => 'Only ASCII',
1150 //_('Only ASCII characters are allowed in passwords.')
1151 'description' => 'Only ASCII characters are allowed in passwords.',
1153 'clientRegistryInclude' => FALSE,
1154 'setByAdminModule' => FALSE,
1155 'setBySetupModule' => TRUE,
1157 self::PASSWORD_POLICY_MIN_LENGTH => array(
1158 //_('Minimum length')
1159 'label' => 'Minimum length',
1160 //_('Minimum password length')
1161 'description' => 'Minimum password length.',
1163 'clientRegistryInclude' => TRUE,
1164 'setByAdminModule' => FALSE,
1165 'setBySetupModule' => TRUE,
1167 self::PASSWORD_POLICY_MIN_WORD_CHARS => array(
1168 //_('Minimum word chars')
1169 'label' => 'Minimum word chars',
1170 //_('Minimum word chars in password')
1171 'description' => 'Minimum word chars in password',
1173 'clientRegistryInclude' => TRUE,
1174 'setByAdminModule' => FALSE,
1175 'setBySetupModule' => TRUE,
1177 self::PASSWORD_POLICY_MIN_UPPERCASE_CHARS => array(
1178 //_('Minimum uppercase chars')
1179 'label' => 'Minimum uppercase chars',
1180 //_('Minimum uppercase chars in password')
1181 'description' => 'Minimum uppercase chars in password',
1183 'clientRegistryInclude' => TRUE,
1184 'setByAdminModule' => FALSE,
1185 'setBySetupModule' => TRUE,
1187 self::PASSWORD_POLICY_MIN_SPECIAL_CHARS => array(
1188 //_('Minimum special chars')
1189 'label' => 'Minimum special chars',
1190 //_('Minimum special chars in password')
1191 'description' => 'Minimum special chars in password',
1193 'clientRegistryInclude' => TRUE,
1194 'setByAdminModule' => FALSE,
1195 'setBySetupModule' => TRUE,
1197 self::PASSWORD_POLICY_MIN_NUMBERS => array(
1198 //_('Minimum numbers')
1199 'label' => 'Minimum numbers',
1200 //_('Minimum numbers in password')
1201 'description' => 'Minimum numbers in password',
1203 'clientRegistryInclude' => TRUE,
1204 'setByAdminModule' => FALSE,
1205 'setBySetupModule' => TRUE,
1207 self::PASSWORD_POLICY_FORBID_USERNAME => array(
1208 //_('Forbid part of username')
1209 'label' => 'Forbid part of username',
1210 //_('Forbid part of username in password')
1211 'description' => 'Forbid part of username in password',
1213 'clientRegistryInclude' => FALSE,
1214 'setByAdminModule' => FALSE,
1215 'setBySetupModule' => TRUE,
1217 self::AUTOMATIC_BUGREPORTS => array(
1218 //_('Automatic bugreports')
1219 'label' => 'Automatic bugreports',
1220 //_('Always send bugreports, even on timeouts and other exceptions / failures.')
1221 'description' => 'Always send bugreports, even on timeouts and other exceptions / failures.',
1223 'clientRegistryInclude' => TRUE,
1224 'setByAdminModule' => FALSE,
1225 'setBySetupModule' => TRUE,
1227 self::LAST_SESSIONS_CLEANUP_RUN => array(
1228 //_('Last sessions cleanup run')
1229 'label' => 'Last sessions cleanup run',
1230 //_('Stores the timestamp of the last sessions cleanup task run.')
1231 'description' => 'Stores the timestamp of the last sessions cleanup task run.',
1232 'type' => self::TYPE_DATETIME,
1233 'clientRegistryInclude' => FALSE,
1234 'setByAdminModule' => FALSE,
1235 'setBySetupModule' => FALSE,
1237 self::WARN_LOGIN_FAILURES => array(
1238 //_('Warn after X login failures')
1239 'label' => 'Warn after X login failures',
1240 //_('Maximum allowed login failures before writing warn log messages')
1241 'description' => 'Maximum allowed login failures before writing warn log messages',
1243 'clientRegistryInclude' => FALSE,
1244 'setByAdminModule' => FALSE,
1245 'setBySetupModule' => TRUE,
1248 self::ANYONE_ACCOUNT_DISABLED => array(
1249 //_('Disable Anyone Account')
1250 'label' => 'Disable Anyone Account',
1251 //_('Disallow anyone account in grant configurations')
1252 'description' => 'Disallow anyone account in grant configurations',
1254 'clientRegistryInclude' => TRUE,
1255 'setByAdminModule' => FALSE,
1256 'setBySetupModule' => TRUE,
1258 self::ALARMS_EACH_JOB => array(
1259 //_('Alarms sent each job')
1260 'label' => 'Alarms sent each job',
1261 //_('Allows to configure the maximum number of alarm notifications in each run of sendPendingAlarms (0 = no limit)')
1262 'description' => 'Allows to configure the maximum number of alarm notifications in each run of sendPendingAlarms (0 = no limit)',
1263 'type' => 'integer',
1264 'clientRegistryInclude' => FALSE,
1265 'setByAdminModule' => FALSE,
1266 'setBySetupModule' => TRUE,
1268 self::ACCOUNT_DEACTIVATION_NOTIFICATION => array(
1269 //_('Account deactivation notfication')
1270 'label' => 'Account deactivation notfication',
1271 //_('Send E-Mail to user if the account is deactivated or the user tries to login with deactivated account')
1272 'description' => 'Send E-Mail to User if the account is deactivated or the user tries to login with deactivated account',
1274 'clientRegistryInclude' => FALSE,
1275 'setByAdminModule' => FALSE,
1276 'setBySetupModule' => TRUE,
1278 self::ROLE_CHANGE_ALLOWED => array(
1279 //_('Role change allowed')
1280 'label' => 'Role change allowed',
1281 //_('Allows to configure which user is allowed to switch to another users account')
1282 'description' => 'Allows to configure which user is allowed to switch to another users account',
1283 'type' => 'Tinebase_Config_Struct',
1284 'clientRegistryInclude' => TRUE,
1285 'setByAdminModule' => FALSE,
1286 'setBySetupModule' => TRUE,
1288 self::MAX_USERNAME_LENGTH => array(
1289 //_('Max username length')
1290 'label' => 'Max username length',
1291 //_('Max username length')
1292 'description' => 'Max username length',
1295 'clientRegistryInclude' => FALSE,
1297 self::CONFD_FOLDER => array(
1298 //_('conf.d folder name')
1299 'label' => 'conf.d folder name',
1300 //_('Folder for additional config files (conf.d) - NOTE: this is only used if set in config.inc.php!')
1301 'description' => 'Folder for additional config files (conf.d) - NOTE: this is only used if set in config.inc.php!',
1304 'clientRegistryInclude' => FALSE,
1305 'setByAdminModule' => FALSE,
1306 'setBySetupModule' => FALSE,
1308 self::MAINTENANCE_MODE => array(
1309 //_('Maintenance mode enabled')
1310 'label' => 'Maintenance mode enabled',
1311 //_('Folder for additional config files (conf.d) - NOTE: this is only used if set in config.inc.php!')
1312 'description' => 'Installation is in maintenance mode. With this only users having the maintenance right can login',
1315 'clientRegistryInclude' => FALSE,
1316 'setByAdminModule' => TRUE,
1317 'setBySetupModule' => TRUE,
1319 self::VERSION_CHECK => array(
1320 //_('Version check enabled')
1321 'label' => 'Version check enabled',
1322 'description' => 'Version check enabled',
1325 'clientRegistryInclude' => true,
1326 'setByAdminModule' => false,
1327 'setBySetupModule' => false,
1329 self::FAT_CLIENT_CUSTOM_JS => array(
1330 // NOTE: it's possible to deliver customjs vom vfs by using the tine20:// streamwrapper
1331 // tine20://<applicationid>/folders/shared/<containerid>/custom.js
1332 //_('Custom Javascript includes for Fat-Client')
1333 'label' => 'Custom Javascript includes for Fat-Client',
1334 //_('An array of javascript files to include for the fat client. This files might be stored outside the docroot of the webserver.')
1335 'description' => "An array of javascript files to include for the fat client. This files might be stored outside the docroot of the webserver.",
1337 'default' => array(),
1338 'clientRegistryInclude' => FALSE,
1339 'setByAdminModule' => FALSE,
1340 'setBySetupModule' => FALSE,
1342 self::BRANDING_DESCRIPTION => array(
1343 //_('custom description')
1344 'label' => 'custom description',
1345 //_('Custom description for branding.')
1346 'description' => 'Custom description for branding.',
1349 'clientRegistryInclude' => FALSE,
1350 'setByAdminModule' => FALSE,
1351 'setBySetupModule' => FALSE,
1353 self::BRANDING_WEBURL => array(
1354 //_('custom weburl')
1355 'label' => 'custom weburl',
1356 //_('Custom weburl for branding.')
1357 'description' => 'Custom weburl for branding.',
1360 'clientRegistryInclude' => FALSE,
1361 'setByAdminModule' => FALSE,
1362 'setBySetupModule' => FALSE,
1364 self::BRANDING_TITLE => array(
1366 'label' => 'custom title',
1367 //_('Custom title for branding.')
1368 'description' => 'Custom ltitle for branding.',
1371 'clientRegistryInclude' => FALSE,
1372 'setByAdminModule' => FALSE,
1373 'setBySetupModule' => FALSE,
1375 self::BRANDING_LOGO => array(
1376 //_('custom logo path')
1377 'label' => 'custom logo path',
1378 //_('Path to custom logo.')
1379 'description' => 'Path to custom logo.',
1381 'default' => './images/tine_logo.png',
1382 'clientRegistryInclude' => FALSE,
1383 'setByAdminModule' => FALSE,
1384 'setBySetupModule' => FALSE,
1386 self::BRANDING_FAVICON => array(
1387 //_('custom favicon path')
1388 'label' => 'custom favicon path',
1389 //_('Path to custom favicon.')
1390 'description' => 'Path to custom favicon.',
1393 'clientRegistryInclude' => FALSE,
1394 'setByAdminModule' => FALSE,
1395 'setBySetupModule' => FALSE,
1397 self::USE_LOGINNAME_AS_FOLDERNAME => array(
1398 //_('Use login name instead of full name')
1399 'label' => 'Use login name instead of full name',
1400 //_('Use login name instead of full name for webdav.')
1401 'description' => 'Use login name instead of full name for webdav.',
1403 'clientRegistryInclude' => FALSE,
1404 'setByAdminModule' => FALSE,
1405 'setBySetupModule' => FALSE,
1408 self::DENY_WEBDAV_CLIENT_LIST => array(
1409 //_('List of WebDav agent strings that will be denied')
1410 'label' => 'List of WebDav agent strings that will be denied',
1411 //_('List of WebDav agent strings that will be denied.')
1412 'description' => 'List of WebDav agent strings that will be denied.',
1414 'clientRegistryInclude' => FALSE,
1415 'setByAdminModule' => FALSE,
1416 'setBySetupModule' => FALSE,
1419 self::FILESYSTEM => array(
1420 //_('Filesystem settings')
1421 'label' => 'Filesystem settings',
1422 //_('Filesystem settings.')
1423 'description' => 'Filesystem settings.',
1425 'class' => 'Tinebase_Config_Struct',
1426 'clientRegistryInclude' => TRUE,
1427 'setByAdminModule' => FALSE,
1428 'setBySetupModule' => FALSE,
1430 self::FILESYSTEM_MODLOGACTIVE => array(
1431 //_('Filesystem history')
1432 'label' => 'Filesystem history',
1433 //_('Filesystem keeps history, default is false.')
1434 'description' => 'Filesystem keeps history, default is false.',
1436 'clientRegistryInclude' => TRUE,
1437 'setByAdminModule' => FALSE,
1438 'setBySetupModule' => FALSE,
1441 self::FILESYSTEM_NUMKEEPREVISIONS => array(
1442 //_('Filesystem number of revisions')
1443 'label' => 'Filesystem number of revisions',
1444 //_('Filesystem number of revisions being kept before they are automatically deleted.')
1445 'description' => 'Filesystem number of revisions being kept before they are automatically deleted.',
1446 'type' => 'integer',
1447 'clientRegistryInclude' => TRUE,
1448 'setByAdminModule' => FALSE,
1449 'setBySetupModule' => FALSE,
1452 self::FILESYSTEM_MONTHKEEPREVISIONS => array(
1453 //_('Filesystem months of revisions')
1454 'label' => 'Filesystem months of revisions',
1455 //_('Filesystem number of months revisions being kept before they are automatically deleted.')
1456 'description' => 'Filesystem number of months revisions being kept before they are automatically deleted.',
1457 'type' => 'integer',
1458 'clientRegistryInclude' => TRUE,
1459 'setByAdminModule' => FALSE,
1460 'setBySetupModule' => FALSE,
1463 self::FILESYSTEM_INDEX_CONTENT => array(
1464 //_('Filesystem index content')
1465 'label' => 'Filesystem index content',
1466 //_('Filesystem index content.')
1467 'description' => 'Filesystem index content.',
1469 'clientRegistryInclude' => TRUE,
1470 'setByAdminModule' => FALSE,
1471 'setBySetupModule' => FALSE,
1474 self::FILESYSTEM_ENABLE_NOTIFICATIONS => array(
1475 //_('Filesystem enable notifications')
1476 'label' => 'Filesystem enable notifications',
1477 //_('Filesystem enable notifications.')
1478 'description' => 'Filesystem enable notifications.',
1480 'clientRegistryInclude' => TRUE,
1481 'setByAdminModule' => FALSE,
1482 'setBySetupModule' => FALSE,
1485 self::FILESYSTEM_CREATE_PREVIEWS => array(
1486 //_('Filesystem create previews')
1487 'label' => 'Filesystem create previews',
1488 //_('Filesystem create previews.')
1489 'description' => 'Filesystem create previews.',
1491 'clientRegistryInclude' => TRUE,
1492 'setByAdminModule' => FALSE,
1493 'setBySetupModule' => FALSE,
1496 self::FILESYSTEM_PREVIEW_SERVICE_URL => array(
1497 //_('URL of preview service')
1498 'label' => 'URL of preview service',
1499 //_('URL of preview service.')
1500 'description' => 'URL of preview service.',
1502 'clientRegistryInclude' => FALSE,
1503 'setByAdminModule' => FALSE,
1504 'setBySetupModule' => FALSE,
1508 'default' => array(),
1515 * @see tine20/Tinebase/Config/Abstract::$_appName
1517 protected $_appName = 'Tinebase';
1520 * holds the instance of the singleton
1522 * @var Tinebase_Config
1524 private static $_instance = NULL;
1531 protected static $_serverPlugins = array(
1532 'Tinebase_Server_Plugin_Json' => 80,
1533 'Tinebase_Server_Plugin_WebDAV' => 80,
1534 'Tinebase_Server_Plugin_Cli' => 90,
1535 'Tinebase_Server_Plugin_Http' => 100
1541 * don't use the constructor. use the singleton
1543 private function __construct() {}
1548 * don't use the constructor. use the singleton
1550 private function __clone() {}
1553 * Returns instance of Tinebase_Config
1555 * @return Tinebase_Config
1557 public static function getInstance()
1559 if (self::$_instance === NULL) {
1560 self::$_instance = new Tinebase_Config();
1563 return self::$_instance;
1568 * @see tine20/Tinebase/Config/Abstract::getProperties()
1570 public static function getProperties()
1572 return self::$_properties;
1576 * get config for client registry
1578 * @return Tinebase_Config_Struct
1580 public function getClientRegistryConfig()
1582 // get all config names to be included in registry
1583 $clientProperties = new Tinebase_Config_Struct(array());
1584 $userApplications = Tinebase_Core::getUser()->getApplications(TRUE);
1585 foreach ($userApplications as $application) {
1586 $config = Tinebase_Config_Abstract::factory($application->name);
1588 $clientProperties[$application->name] = new Tinebase_Config_Struct(array());
1589 $properties = $config->getProperties();
1590 foreach ((array) $properties as $name => $definition) {
1592 if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__
1593 . ' ' . print_r($definition, TRUE));
1595 if (isset($definition['clientRegistryInclude']) && $definition['clientRegistryInclude'] === TRUE)
1597 // add definition here till we have a better place
1599 $configRegistryItem = new Tinebase_Config_Struct(array(
1600 'value' => $config->{$name},
1601 'definition' => new Tinebase_Config_Struct($definition),
1602 ), null, null, array(
1603 'value' => array('type' => $definition['type']),
1604 'definition' => array('type' => Tinebase_Config_Abstract::TYPE_ARRAY, 'class' => 'Tinebase_Config_Struct')
1606 if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__
1607 . ' ' . print_r($configRegistryItem->toArray(), TRUE));
1608 $clientProperties[$application->name][$name] = $configRegistryItem;
1609 } catch (Exception $e) {
1610 Tinebase_Exception::log($e);
1614 if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__
1615 . ' Got ' . count($clientProperties[$application->name]) . ' config items for ' . $application->name . '.');
1619 return $clientProperties;
1623 * get application config
1625 * @param string $applicationName Application name
1626 * @return Tinebase_Config_Abstract $configClass
1628 public static function getAppConfig($applicationName)
1630 $configClassName = $applicationName . '_Config';
1631 if (@class_exists($configClassName)) {
1632 /** @noinspection PhpUndefinedMethodInspection */
1633 return $configClassName::getInstance();
1635 if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__
1636 . ' Application ' . $applicationName . ' has no config.');