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 VERSION_CHECK = 'versionCheck';
467 const REPLICATION_MASTER = 'replicationMaster';
472 const REPLICATION_SLAVE = 'replicationSlave';
477 const REPLICATION_USER_PASSWORD = 'replicationUserPassword';
482 const MASTER_URL = 'masterURL';
487 const MASTER_USERNAME = 'masterUsername';
492 const MASTER_PASSWORD = 'masterPassword';
497 const ERROR_NOTIFICATION_LIST = 'errorNotificationList';
499 const FULLTEXT = 'fulltext';
500 const FULLTEXT_BACKEND = 'backend';
501 const FULLTEXT_JAVABIN = 'javaBin';
502 const FULLTEXT_TIKAJAR = 'tikaJar';
504 const FILESYSTEM = 'filesystem';
505 const FILESYSTEM_MODLOGACTIVE = 'modLogActive';
506 const FILESYSTEM_NUMKEEPREVISIONS = 'numKeepRevisions';
507 const FILESYSTEM_MONTHKEEPREVISIONS = 'monthKeepRevisions';
508 const FILESYSTEM_INDEX_CONTENT = 'index_content';
509 const FILESYSTEM_CREATE_PREVIEWS = 'createPreviews';
510 const FILESYSTEM_PREVIEW_SERVICE_URL = 'previewServiceUrl';
511 const FILESYSTEM_ENABLE_NOTIFICATIONS = 'enableNotifications';
515 * @see tine20/Tinebase/Config/Definition::$_properties
517 protected static $_properties = array(
521 * $_deletePersonalContainers => delete personal containers
522 * $_keepAsContact => keep "account" as contact in the addressbook
523 * $_keepOrganizerEvents => keep accounts organizer events as external events in the calendar
524 * $_keepAsContact => keep accounts calender event attendee as external attendee
526 * TODO add more options (like move to another container)
528 self::ACCOUNT_DELETION_EVENTCONFIGURATION => array(
529 //_('Account Deletion Event')
530 'label' => 'Account Deletion Event',
531 //_('Configure what should happen to data of deleted users')
532 'description' => 'Configure what should happen to data of deleted users',
534 'class' => 'Tinebase_Config_Struct',
535 'clientRegistryInclude' => FALSE,
536 'setByAdminModule' => TRUE,
537 'setBySetupModule' => TRUE,
540 * for example: array('en', 'de')
542 self::AVAILABLE_LANGUAGES => array(
543 //_('Available Languages')
544 'label' => 'Available Languages',
545 //_('Whitelist available languages that can be chosen in the GUI')
546 'description' => 'Whitelist available languages that can be chosen in the GUI',
548 'clientRegistryInclude' => TRUE,
549 'setByAdminModule' => TRUE,
550 'setBySetupModule' => TRUE,
555 self::DEFAULT_LOCALE => array(
556 //_('Default Locale')
557 'label' => 'Default Locale',
558 //_('Default locale for this installation.')
559 'description' => 'Default locale for this installation.',
562 'clientRegistryInclude' => TRUE,
563 'setByAdminModule' => FALSE,
564 'setBySetupModule' => TRUE,
567 * config keys (see Zend_Http_Client_Adapter_Proxy):
569 * 'proxy_host' => 'proxy.com',
570 * 'proxy_port' => 3128,
571 * 'proxy_user' => 'user',
572 * 'proxy_pass' => 'pass'
574 self::INTERNET_PROXY => array(
575 //_('Internet proxy config')
576 'label' => 'Internet proxy config',
577 'description' => 'Internet proxy config',
579 'default' => array(),
580 'clientRegistryInclude' => false,
581 'setByAdminModule' => true,
582 'setBySetupModule' => true,
587 * useSystemAccount (bool)
589 * useEmailAsUsername (bool)
594 * backend (string) - see Tinebase_EmailUser::$_supportedBackends
599 'label' => 'System IMAP',
600 //_('System IMAP server configuration.')
601 'description' => 'System IMAP server configuration.',
603 'class' => 'Tinebase_Config_Struct',
604 'clientRegistryInclude' => FALSE,
605 'setByAdminModule' => FALSE,
606 'setBySetupModule' => TRUE,
610 'label' => 'System SMTP',
611 //_('System SMTP server configuration.')
612 'description' => 'System SMTP server configuration.',
614 'class' => 'Tinebase_Config_Struct',
615 'clientRegistryInclude' => FALSE,
616 'setByAdminModule' => FALSE,
617 'setBySetupModule' => TRUE,
619 self::SIEVE => array(
621 'label' => 'System SIEVE',
622 //_('System SIEVE server configuration.')
623 'description' => 'System SIEVE server configuration.',
625 'class' => 'Tinebase_Config_Struct',
626 'clientRegistryInclude' => FALSE,
627 'setByAdminModule' => FALSE,
628 'setBySetupModule' => TRUE,
630 self::AUTHENTICATIONBACKENDTYPE => array(
631 //_('Authentication Backend')
632 'label' => 'Authentication Backend',
633 //_('Backend adapter for user authentication.')
634 'description' => 'Backend adapter for user authentication.',
636 'clientRegistryInclude' => FALSE,
637 'setByAdminModule' => FALSE,
638 'setBySetupModule' => TRUE,
640 self::AUTHENTICATIONBACKEND => array(
641 //_('Authentication Configuration')
642 'label' => 'Authentication Configuration',
643 //_('Authentication backend configuration.')
644 'description' => 'Authentication backend configuration.',
646 'class' => 'Tinebase_Config_Struct',
647 'clientRegistryInclude' => FALSE,
648 'setByAdminModule' => FALSE,
649 'setBySetupModule' => TRUE,
656 * 'provider' => 'PrivacyIdea',
657 * 'url' => 'https://localhost/validate/check',
658 * 'allow_self_signed' => true,
659 * 'ignorePeerName' => true,
662 self::AUTHENTICATIONSECONDFACTOR => array(
663 //_('Second Factor Authentication Configuration')
664 'label' => 'Second Factor Authentication Configuration',
665 'description' => 'Second Factor Authentication Configuration',
667 'class' => 'Tinebase_Config_Struct',
668 'clientRegistryInclude' => FALSE,
669 'setByAdminModule' => FALSE,
670 'setBySetupModule' => TRUE,
672 self::USERBACKENDTYPE => array(
674 'label' => 'User Backend',
675 //_('Backend adapter for user data.')
676 'description' => 'Backend adapter for user data.',
678 'clientRegistryInclude' => FALSE,
679 'setByAdminModule' => FALSE,
680 'setBySetupModule' => TRUE,
682 self::REPLICATION_MASTER => array(
683 //_('Replication master configuration')
684 'label' => 'Replication master configuration',
685 //_('Replication master configuration.')
686 'description' => 'Replication master configuration.',
688 'class' => 'Tinebase_Config_Struct',
689 'clientRegistryInclude' => FALSE,
690 'setByAdminModule' => FALSE,
691 'setBySetupModule' => TRUE,
693 self::REPLICATION_USER_PASSWORD => array(
694 'type' => Tinebase_Config::TYPE_STRING
698 self::REPLICATION_SLAVE => array(
699 //_('Replication slave configuration')
700 'label' => 'Replication slave configuration',
701 //_('Replication slave configuration.')
702 'description' => 'Replication slave configuration.',
704 'class' => 'Tinebase_Config_Struct',
705 'clientRegistryInclude' => FALSE,
706 'setByAdminModule' => FALSE,
707 'setBySetupModule' => TRUE,
709 self::MASTER_URL => array(
710 'type' => Tinebase_Config::TYPE_STRING,
712 self::MASTER_USERNAME => array(
713 'type' => Tinebase_Config::TYPE_STRING,
715 self::MASTER_PASSWORD => array(
716 'type' => Tinebase_Config::TYPE_STRING,
718 self::ERROR_NOTIFICATION_LIST => array(
719 'type' => Tinebase_Config::TYPE_ARRAY,
723 self::FULLTEXT => array(
724 //_('Full text configuration')
725 'label' => 'Full text configuration',
726 //_('Full text configuration.')
727 'description' => 'Full text configuration.',
729 'class' => 'Tinebase_Config_Struct',
730 'clientRegistryInclude' => FALSE,
731 'setByAdminModule' => FALSE,
732 'setBySetupModule' => TRUE,
734 self::FULLTEXT_BACKEND => array(
735 'type' => Tinebase_Config::TYPE_STRING,
738 self::FULLTEXT_JAVABIN => array(
739 'type' => Tinebase_Config::TYPE_STRING,
742 self::FULLTEXT_TIKAJAR => array(
743 'type' => Tinebase_Config::TYPE_STRING,
748 self::USERBACKEND => array(
749 //_('User Configuration')
750 'label' => 'User Configuration',
751 //_('User backend configuration.')
752 'description' => 'User backend configuration.',
754 'class' => 'Tinebase_Config_Struct',
755 'clientRegistryInclude' => FALSE,
756 'setByAdminModule' => FALSE,
757 'setBySetupModule' => TRUE,
759 Tinebase_User::DEFAULT_USER_GROUP_NAME_KEY => array(
760 'type' => Tinebase_Config::TYPE_STRING,
762 Tinebase_User::DEFAULT_ADMIN_GROUP_NAME_KEY => array(
763 'type' => Tinebase_Config::TYPE_STRING,
766 'type' => Tinebase_Config::TYPE_STRING,
769 'type' => Tinebase_Config::TYPE_INT,
772 'type' => Tinebase_Config::TYPE_BOOL,
775 'type' => Tinebase_Config::TYPE_STRING,
778 'type' => Tinebase_Config::TYPE_STRING,
780 'bindRequiresDn' => array(
781 'type' => Tinebase_Config::TYPE_BOOL,
784 'type' => Tinebase_Config::TYPE_STRING,
786 'accountCanonicalForm' => array(
787 'type' => Tinebase_Config::TYPE_STRING,
789 'accountDomainName' => array(
790 'type' => Tinebase_Config::TYPE_STRING,
792 'accountDomainNameShort' => array(
793 'type' => Tinebase_Config::TYPE_STRING,
795 'accountFilterFormat' => array(
796 'type' => Tinebase_Config::TYPE_STRING,
798 'allowEmptyPassword' => array(
799 'type' => Tinebase_Config::TYPE_STRING,
801 'useStartTls' => array(
802 'type' => Tinebase_Config::TYPE_BOOL,
804 'optReferrals' => array(
805 'type' => Tinebase_Config::TYPE_STRING,
807 'tryUsernameSplit' => array(
808 'type' => Tinebase_Config::TYPE_BOOL,
810 'groupUUIDAttribute' => array(
811 'type' => Tinebase_Config::TYPE_STRING,
814 'type' => Tinebase_Config::TYPE_STRING,
816 'useRfc2307bis' => array(
817 'type' => Tinebase_Config::TYPE_BOOL,
820 'type' => Tinebase_Config::TYPE_STRING,
822 'userFilter' => array(
823 'type' => Tinebase_Config::TYPE_STRING,
825 'userSearchScope' => array(
826 'type' => Tinebase_Config::TYPE_STRING,
828 'groupFilter' => array(
829 'type' => Tinebase_Config::TYPE_STRING,
831 'groupSearchScope' => array(
832 'type' => Tinebase_Config::TYPE_STRING,
834 'pwEncType' => array(
835 'type' => Tinebase_Config::TYPE_STRING,
837 'minUserId' => array(
838 'type' => Tinebase_Config::TYPE_INT,
840 'maxUserId' => array(
841 'type' => Tinebase_Config::TYPE_INT,
843 'minGroupId' => array(
844 'type' => Tinebase_Config::TYPE_INT,
846 'maxGroupId' => array(
847 'type' => Tinebase_Config::TYPE_INT,
849 'userUUIDAttribute' => array(
850 'type' => Tinebase_Config::TYPE_STRING,
853 'type' => Tinebase_Config::TYPE_BOOL,
855 'useRfc2307' => array(
856 'type' => Tinebase_Config::TYPE_BOOL,
858 self::SYNCOPTIONS => array(
860 'class' => 'Tinebase_Config_Struct',
862 self::SYNC_USER_CONTACT_DATA => array(
863 //_('Sync contact data from sync backend')
864 'label' => 'Sync contact data from sync backend',
865 //_('Sync user contact data from sync backend')
866 'description' => 'Sync user contact data from sync backend',
868 'clientRegistryInclude' => FALSE,
869 'setByAdminModule' => FALSE,
870 'setBySetupModule' => FALSE,
873 self::SYNC_USER_CONTACT_PHOTO => array(
874 //_('Sync contact photo from sync backend')
875 'label' => 'Sync contact photo from sync backend',
876 //_('Sync user contact photo from sync backend')
877 'description' => 'Sync user contact photo from sync backend',
879 'clientRegistryInclude' => FALSE,
880 'setByAdminModule' => FALSE,
881 'setBySetupModule' => FALSE,
884 self::SYNC_DELETED_USER => array(
885 //_('Sync deleted users from sync backend')
886 'label' => 'Sync deleted users from sync backend',
887 //_('Sync deleted users from sync backend')
888 'description' => 'Sync deleted users from sync backend',
890 'clientRegistryInclude' => FALSE,
891 'setByAdminModule' => FALSE,
892 'setBySetupModule' => FALSE,
896 'default' => array(),
900 self::ENABLED_FEATURES => array(
901 //_('Enabled Features')
902 'label' => 'Enabled Features',
903 'description' => 'Enabled Features',
905 'class' => 'Tinebase_Config_Struct',
906 'clientRegistryInclude' => TRUE,
908 self::FEATURE_SHOW_ADVANCED_SEARCH => array(
909 'label' => 'Show Advanced Search', //_('Show Advanced Search')
910 'description' => 'Show toggle button to switch on or off the advanced search for the quickfilter',
911 //_('Show toggle button to switch on or off the advanced search for the quickfilter')
913 self::FEATURE_CONTAINER_CUSTOM_SORT => array(
914 'label' => 'Container Custom Sort', //_('Container Custom Sort')
915 'description' => 'Allows to sort containers by setting the sort order in Admin/Container',
916 //_('Allows to sort containers by setting the sort order in Admin/Container')
918 self::FEATURE_SHOW_ACCOUNT_EMAIL => array(
919 'label' => 'Show Account Email Address', //_('Show Account Email Address')
920 'description' => 'Show email address in account picker and attendee grids',
921 //_('Show email address in account picker and attendee grids')
923 self::FEATURE_REMEMBER_POPUP_SIZE => array(
924 'label' => 'Remeber Popup Size', //_('Remeber Popup Size')
925 'description' => 'Save edit dialog size in state',
926 //_('Save edit dialog size in state')
928 self::FEATURE_SEARCH_PATH => array(
929 'label' => 'Search Paths',
930 'description' => 'Search Paths'
934 self::FEATURE_SHOW_ADVANCED_SEARCH => true,
935 self::FEATURE_CONTAINER_CUSTOM_SORT => true,
936 self::FEATURE_SHOW_ACCOUNT_EMAIL => true,
937 self::FEATURE_REMEMBER_POPUP_SIZE => true,
938 self::FEATURE_SEARCH_PATH => true,
942 self::CRONUSERID => array(
944 'label' => 'Cronuser ID',
945 //_('User ID of the cron user.')
946 'description' => 'User ID of the cron user.',
948 'clientRegistryInclude' => FALSE,
949 'setByAdminModule' => TRUE,
950 'setBySetupModule' => TRUE,
952 self::PAGETITLEPOSTFIX => array(
954 'label' => 'Title Postfix',
955 //_('Postfix string appended to the title of this installation.')
956 'description' => 'Postfix string appended to the title of this installation.',
958 'clientRegistryInclude' => FALSE,
959 'setByAdminModule' => TRUE,
960 'setBySetupModule' => TRUE,
962 self::REDIRECTURL => array(
964 'label' => 'Redirect URL',
965 //_('Redirect to this URL after logout.')
966 'description' => 'Redirect to this URL after logout.',
968 'clientRegistryInclude' => FALSE,
969 'setByAdminModule' => FALSE,
970 'setBySetupModule' => TRUE,
972 self::REDIRECTTOREFERRER => array(
973 //_('Redirect to Referrer')
974 'label' => 'Redirect to Referrer',
975 //_('Redirect to referrer after logout.')
976 'description' => 'Redirect to referrer after logout.',
978 'clientRegistryInclude' => FALSE,
979 'setByAdminModule' => FALSE,
980 'setBySetupModule' => TRUE,
982 self::REDIRECTALWAYS => array(
983 //_('Redirect Always')
984 'label' => 'Redirect Always',
985 //_('Redirect to configured redirect URL also for login.')
986 'description' => 'Redirect to configured redirect URL also for login.',
988 'clientRegistryInclude' => FALSE,
989 'setByAdminModule' => FALSE,
990 'setBySetupModule' => TRUE,
992 self::ALLOWEDJSONORIGINS => array(
993 //_('Allowed Origins')
994 'label' => 'Allowed Origins',
995 //_('Allowed Origins for the JSON API.')
996 'description' => 'Allowed Origins for the JSON API.',
998 'clientRegistryInclude' => FALSE,
999 'setByAdminModule' => FALSE,
1000 'setBySetupModule' => FALSE,
1002 self::ACCEPTEDTERMSVERSION => array(
1003 //_('Accepted Terms Version')
1004 'label' => 'Accepted Terms Version',
1005 //_('Accepted version number of the terms and conditions document.')
1006 'description' => 'Accepted version number of the terms and conditions document.',
1008 'clientRegistryInclude' => FALSE,
1009 'setByAdminModule' => FALSE,
1010 'setBySetupModule' => FALSE,
1012 self::MAPPANEL => array(
1013 //_('Use Geolocation Services')
1014 'label' => 'Use Geolocation Services',
1015 //_('Use of external Geolocation services is allowed.')
1016 'description' => 'Use of external Geolocation services is allowed.',
1018 'clientRegistryInclude' => true,
1019 'setByAdminModule' => false,
1020 'setBySetupModule' => true,
1023 // TODO should this be added to LDAP config array/struct?
1024 self::LDAP_DISABLE_TLSREQCERT => array(
1025 //_('Disable LDAP TLS Certificate Check')
1026 'label' => 'Disable LDAP TLS Certificate Check',
1027 //_('LDAP TLS Certificate should not be checked')
1028 'description' => 'LDAP TLS Certificate should not be checked',
1030 'clientRegistryInclude' => false,
1031 'setByAdminModule' => false,
1032 'setBySetupModule' => true,
1035 // TODO should this be added to LDAP config array/struct?
1036 // TODO does this depend on LDAP readonly option?
1037 self::LDAP_OVERWRITE_CONTACT_FIELDS => array(
1038 //_('Contact fields overwritten by LDAP')
1039 'label' => 'Contact fields overwritten by LDAP',
1040 //_('These fields are overwritten during LDAP sync if empty')
1041 'description' => 'These fields are overwritten during LDAP sync if empty',
1043 'clientRegistryInclude' => false,
1044 'setByAdminModule' => false,
1045 'setBySetupModule' => true,
1046 'default' => array()
1048 self::SYNC_USER_HOOK_CLASS => array(
1049 //_('Configure hook class for user sync')
1050 'label' => 'Configure hook class for user sync',
1051 //_('Allows to change data after fetching user from sync backend')
1052 'description' => 'Allows to change data after fetching user from sync backend',
1054 'clientRegistryInclude' => false,
1055 'setByAdminModule' => false,
1056 'setBySetupModule' => true,
1058 self::SYNC_USER_CONTACT_DATA => array(
1059 //_('Sync contact data from sync backend')
1060 'label' => 'Sync contact data from sync backend',
1061 //_('Sync user contact data from sync backend')
1062 'description' => 'Sync user contact data from sync backend',
1064 'clientRegistryInclude' => FALSE,
1065 'setByAdminModule' => FALSE,
1066 'setBySetupModule' => FALSE,
1069 self::SYNC_USER_DELETE_AFTER => array(
1070 //_('Sync user: delete after X months)
1071 'label' => 'Sync user: delete after X months',
1072 //_('Removed users should be deleted after X months')
1073 'description' => 'Removed users should be deleted after X months',
1074 'type' => 'integer',
1075 'clientRegistryInclude' => FALSE,
1076 'setByAdminModule' => FALSE,
1077 'setBySetupModule' => FALSE,
1080 self::SESSIONIPVALIDATION => array(
1081 //_('IP Session Validator')
1082 'label' => 'IP Session Validator',
1083 //_('Destroy session if the users IP changes.')
1084 'description' => 'Destroy session if the users IP changes.',
1086 'clientRegistryInclude' => FALSE,
1087 'setByAdminModule' => FALSE,
1088 'setBySetupModule' => TRUE,
1090 self::SESSIONUSERAGENTVALIDATION => array(
1091 //_('UA Session Validator')
1092 'label' => 'UA Session Validator',
1093 //_('Destroy session if the users user agent string changes.')
1094 'description' => 'Destroy session if the users user agent string changes.',
1096 'clientRegistryInclude' => FALSE,
1097 'setByAdminModule' => FALSE,
1098 'setBySetupModule' => TRUE,
1100 // TODO move to FILESYSTEM
1101 self::FILESDIR => array(
1102 //_('Files Directory')
1103 'label' => 'Files Directory',
1104 //_('Directory with web server write access for user files.')
1105 'description' => 'Directory with web server write access for user files.',
1107 'clientRegistryInclude' => FALSE,
1108 'setByAdminModule' => FALSE,
1109 'setBySetupModule' => TRUE,
1111 self::REUSEUSERNAME_SAVEUSERNAME => array(
1112 //_('Reuse last username logged')
1113 'label' => 'Reuse last username logged',
1114 //_('Reuse last username logged')
1115 'description' => 'Reuse last username logged',
1117 'clientRegistryInclude' => FALSE,
1118 'setByAdminModule' => FALSE,
1119 'setBySetupModule' => TRUE,
1121 self::PASSWORD_CHANGE => array(
1122 //_('User may change password')
1123 'label' => 'User may change password',
1124 //_('User may change password')
1125 'description' => 'User may change password',
1127 'clientRegistryInclude' => TRUE,
1128 'setByAdminModule' => FALSE,
1129 'setBySetupModule' => TRUE,
1132 self::PASSWORD_POLICY_ACTIVE => array(
1133 //_('Enable password policy')
1134 'label' => 'Enable password policy',
1135 //_('Enable password policy')
1136 'description' => 'Enable password policy',
1138 'clientRegistryInclude' => TRUE,
1139 'setByAdminModule' => FALSE,
1140 'setBySetupModule' => TRUE,
1142 self::PASSWORD_POLICY_ONLYASCII => array(
1144 'label' => 'Only ASCII',
1145 //_('Only ASCII characters are allowed in passwords.')
1146 'description' => 'Only ASCII characters are allowed in passwords.',
1148 'clientRegistryInclude' => FALSE,
1149 'setByAdminModule' => FALSE,
1150 'setBySetupModule' => TRUE,
1152 self::PASSWORD_POLICY_MIN_LENGTH => array(
1153 //_('Minimum length')
1154 'label' => 'Minimum length',
1155 //_('Minimum password length')
1156 'description' => 'Minimum password length.',
1158 'clientRegistryInclude' => TRUE,
1159 'setByAdminModule' => FALSE,
1160 'setBySetupModule' => TRUE,
1162 self::PASSWORD_POLICY_MIN_WORD_CHARS => array(
1163 //_('Minimum word chars')
1164 'label' => 'Minimum word chars',
1165 //_('Minimum word chars in password')
1166 'description' => 'Minimum word chars in password',
1168 'clientRegistryInclude' => TRUE,
1169 'setByAdminModule' => FALSE,
1170 'setBySetupModule' => TRUE,
1172 self::PASSWORD_POLICY_MIN_UPPERCASE_CHARS => array(
1173 //_('Minimum uppercase chars')
1174 'label' => 'Minimum uppercase chars',
1175 //_('Minimum uppercase chars in password')
1176 'description' => 'Minimum uppercase chars in password',
1178 'clientRegistryInclude' => TRUE,
1179 'setByAdminModule' => FALSE,
1180 'setBySetupModule' => TRUE,
1182 self::PASSWORD_POLICY_MIN_SPECIAL_CHARS => array(
1183 //_('Minimum special chars')
1184 'label' => 'Minimum special chars',
1185 //_('Minimum special chars in password')
1186 'description' => 'Minimum special chars in password',
1188 'clientRegistryInclude' => TRUE,
1189 'setByAdminModule' => FALSE,
1190 'setBySetupModule' => TRUE,
1192 self::PASSWORD_POLICY_MIN_NUMBERS => array(
1193 //_('Minimum numbers')
1194 'label' => 'Minimum numbers',
1195 //_('Minimum numbers in password')
1196 'description' => 'Minimum numbers in password',
1198 'clientRegistryInclude' => TRUE,
1199 'setByAdminModule' => FALSE,
1200 'setBySetupModule' => TRUE,
1202 self::PASSWORD_POLICY_FORBID_USERNAME => array(
1203 //_('Forbid part of username')
1204 'label' => 'Forbid part of username',
1205 //_('Forbid part of username in password')
1206 'description' => 'Forbid part of username in password',
1208 'clientRegistryInclude' => FALSE,
1209 'setByAdminModule' => FALSE,
1210 'setBySetupModule' => TRUE,
1212 self::AUTOMATIC_BUGREPORTS => array(
1213 //_('Automatic bugreports')
1214 'label' => 'Automatic bugreports',
1215 //_('Always send bugreports, even on timeouts and other exceptions / failures.')
1216 'description' => 'Always send bugreports, even on timeouts and other exceptions / failures.',
1218 'clientRegistryInclude' => TRUE,
1219 'setByAdminModule' => FALSE,
1220 'setBySetupModule' => TRUE,
1222 self::LAST_SESSIONS_CLEANUP_RUN => array(
1223 //_('Last sessions cleanup run')
1224 'label' => 'Last sessions cleanup run',
1225 //_('Stores the timestamp of the last sessions cleanup task run.')
1226 'description' => 'Stores the timestamp of the last sessions cleanup task run.',
1227 'type' => self::TYPE_DATETIME,
1228 'clientRegistryInclude' => FALSE,
1229 'setByAdminModule' => FALSE,
1230 'setBySetupModule' => FALSE,
1232 self::WARN_LOGIN_FAILURES => array(
1233 //_('Warn after X login failures')
1234 'label' => 'Warn after X login failures',
1235 //_('Maximum allowed login failures before writing warn log messages')
1236 'description' => 'Maximum allowed login failures before writing warn log messages',
1238 'clientRegistryInclude' => FALSE,
1239 'setByAdminModule' => FALSE,
1240 'setBySetupModule' => TRUE,
1243 self::ANYONE_ACCOUNT_DISABLED => array(
1244 //_('Disable Anyone Account')
1245 'label' => 'Disable Anyone Account',
1246 //_('Disallow anyone account in grant configurations')
1247 'description' => 'Disallow anyone account in grant configurations',
1249 'clientRegistryInclude' => TRUE,
1250 'setByAdminModule' => FALSE,
1251 'setBySetupModule' => TRUE,
1253 self::ALARMS_EACH_JOB => array(
1254 //_('Alarms sent each job')
1255 'label' => 'Alarms sent each job',
1256 //_('Allows to configure the maximum number of alarm notifications in each run of sendPendingAlarms (0 = no limit)')
1257 'description' => 'Allows to configure the maximum number of alarm notifications in each run of sendPendingAlarms (0 = no limit)',
1258 'type' => 'integer',
1259 'clientRegistryInclude' => FALSE,
1260 'setByAdminModule' => FALSE,
1261 'setBySetupModule' => TRUE,
1263 self::ACCOUNT_DEACTIVATION_NOTIFICATION => array(
1264 //_('Account deactivation notfication')
1265 'label' => 'Account deactivation notfication',
1266 //_('Send E-Mail to user if the account is deactivated or the user tries to login with deactivated account')
1267 'description' => 'Send E-Mail to User if the account is deactivated or the user tries to login with deactivated account',
1269 'clientRegistryInclude' => FALSE,
1270 'setByAdminModule' => FALSE,
1271 'setBySetupModule' => TRUE,
1273 self::ROLE_CHANGE_ALLOWED => array(
1274 //_('Role change allowed')
1275 'label' => 'Role change allowed',
1276 //_('Allows to configure which user is allowed to switch to another users account')
1277 'description' => 'Allows to configure which user is allowed to switch to another users account',
1278 'type' => 'Tinebase_Config_Struct',
1279 'clientRegistryInclude' => TRUE,
1280 'setByAdminModule' => FALSE,
1281 'setBySetupModule' => TRUE,
1283 self::MAX_USERNAME_LENGTH => array(
1284 //_('Max username length')
1285 'label' => 'Max username length',
1286 //_('Max username length')
1287 'description' => 'Max username length',
1290 'clientRegistryInclude' => FALSE,
1292 self::CONFD_FOLDER => array(
1293 //_('conf.d folder name')
1294 'label' => 'conf.d folder name',
1295 //_('Folder for additional config files (conf.d) - NOTE: this is only used if set in config.inc.php!')
1296 'description' => 'Folder for additional config files (conf.d) - NOTE: this is only used if set in config.inc.php!',
1299 'clientRegistryInclude' => FALSE,
1300 'setByAdminModule' => FALSE,
1301 'setBySetupModule' => FALSE,
1303 self::MAINTENANCE_MODE => array(
1304 //_('Maintenance mode enabled')
1305 'label' => 'Maintenance mode enabled',
1306 //_('Folder for additional config files (conf.d) - NOTE: this is only used if set in config.inc.php!')
1307 'description' => 'Installation is in maintenance mode. With this only users having the maintenance right can login',
1310 'clientRegistryInclude' => FALSE,
1311 'setByAdminModule' => TRUE,
1312 'setBySetupModule' => TRUE,
1314 self::VERSION_CHECK => array(
1315 //_('Version check enabled')
1316 'label' => 'Version check enabled',
1317 'description' => 'Version check enabled',
1320 'clientRegistryInclude' => true,
1321 'setByAdminModule' => false,
1322 'setBySetupModule' => false,
1324 self::FAT_CLIENT_CUSTOM_JS => array(
1325 // NOTE: it's possible to deliver customjs vom vfs by using the tine20:// streamwrapper
1326 // tine20://<applicationid>/folders/shared/<containerid>/custom.js
1327 //_('Custom Javascript includes for Fat-Client')
1328 'label' => 'Custom Javascript includes for Fat-Client',
1329 //_('An array of javascript files to include for the fat client. This files might be stored outside the docroot of the webserver.')
1330 'description' => "An array of javascript files to include for the fat client. This files might be stored outside the docroot of the webserver.",
1332 'default' => array(),
1333 'clientRegistryInclude' => FALSE,
1334 'setByAdminModule' => FALSE,
1335 'setBySetupModule' => FALSE,
1337 self::BRANDING_DESCRIPTION => array(
1338 //_('custom description')
1339 'label' => 'custom description',
1340 //_('Custom description for branding.')
1341 'description' => 'Custom description for branding.',
1344 'clientRegistryInclude' => FALSE,
1345 'setByAdminModule' => FALSE,
1346 'setBySetupModule' => FALSE,
1348 self::BRANDING_WEBURL => array(
1349 //_('custom weburl')
1350 'label' => 'custom weburl',
1351 //_('Custom weburl for branding.')
1352 'description' => 'Custom weburl for branding.',
1355 'clientRegistryInclude' => FALSE,
1356 'setByAdminModule' => FALSE,
1357 'setBySetupModule' => FALSE,
1359 self::BRANDING_TITLE => array(
1361 'label' => 'custom title',
1362 //_('Custom title for branding.')
1363 'description' => 'Custom ltitle for branding.',
1366 'clientRegistryInclude' => FALSE,
1367 'setByAdminModule' => FALSE,
1368 'setBySetupModule' => FALSE,
1370 self::BRANDING_LOGO => array(
1371 //_('custom logo path')
1372 'label' => 'custom logo path',
1373 //_('Path to custom logo.')
1374 'description' => 'Path to custom logo.',
1376 'default' => './images/tine_logo.png',
1377 'clientRegistryInclude' => FALSE,
1378 'setByAdminModule' => FALSE,
1379 'setBySetupModule' => FALSE,
1381 self::BRANDING_FAVICON => array(
1382 //_('custom favicon path')
1383 'label' => 'custom favicon path',
1384 //_('Path to custom favicon.')
1385 'description' => 'Path to custom favicon.',
1388 'clientRegistryInclude' => FALSE,
1389 'setByAdminModule' => FALSE,
1390 'setBySetupModule' => FALSE,
1392 self::USE_LOGINNAME_AS_FOLDERNAME => array(
1393 //_('Use login name instead of full name')
1394 'label' => 'Use login name instead of full name',
1395 //_('Use login name instead of full name for webdav.')
1396 'description' => 'Use login name instead of full name for webdav.',
1398 'clientRegistryInclude' => FALSE,
1399 'setByAdminModule' => FALSE,
1400 'setBySetupModule' => FALSE,
1403 self::FILESYSTEM => array(
1404 //_('Filesystem settings')
1405 'label' => 'Filesystem settings',
1406 //_('Filesystem settings.')
1407 'description' => 'Filesystem settings.',
1409 'class' => 'Tinebase_Config_Struct',
1410 'clientRegistryInclude' => TRUE,
1411 'setByAdminModule' => FALSE,
1412 'setBySetupModule' => FALSE,
1414 self::FILESYSTEM_MODLOGACTIVE => array(
1415 //_('Filesystem history')
1416 'label' => 'Filesystem history',
1417 //_('Filesystem keeps history, default is false.')
1418 'description' => 'Filesystem keeps history, default is false.',
1420 'clientRegistryInclude' => TRUE,
1421 'setByAdminModule' => FALSE,
1422 'setBySetupModule' => FALSE,
1425 self::FILESYSTEM_NUMKEEPREVISIONS => array(
1426 //_('Filesystem number of revisions')
1427 'label' => 'Filesystem number of revisions',
1428 //_('Filesystem number of revisions being kept before they are automatically deleted.')
1429 'description' => 'Filesystem number of revisions being kept before they are automatically deleted.',
1430 'type' => 'integer',
1431 'clientRegistryInclude' => TRUE,
1432 'setByAdminModule' => FALSE,
1433 'setBySetupModule' => FALSE,
1436 self::FILESYSTEM_MONTHKEEPREVISIONS => array(
1437 //_('Filesystem months of revisions')
1438 'label' => 'Filesystem months of revisions',
1439 //_('Filesystem number of months revisions being kept before they are automatically deleted.')
1440 'description' => 'Filesystem number of months revisions being kept before they are automatically deleted.',
1441 'type' => 'integer',
1442 'clientRegistryInclude' => TRUE,
1443 'setByAdminModule' => FALSE,
1444 'setBySetupModule' => FALSE,
1447 self::FILESYSTEM_INDEX_CONTENT => array(
1448 //_('Filesystem index content')
1449 'label' => 'Filesystem index content',
1450 //_('Filesystem index content.')
1451 'description' => 'Filesystem index content.',
1453 'clientRegistryInclude' => TRUE,
1454 'setByAdminModule' => FALSE,
1455 'setBySetupModule' => FALSE,
1458 self::FILESYSTEM_ENABLE_NOTIFICATIONS => array(
1459 //_('Filesystem enable notifications')
1460 'label' => 'Filesystem enable notifications',
1461 //_('Filesystem enable notifications.')
1462 'description' => 'Filesystem enable notifications.',
1464 'clientRegistryInclude' => TRUE,
1465 'setByAdminModule' => FALSE,
1466 'setBySetupModule' => FALSE,
1469 self::FILESYSTEM_CREATE_PREVIEWS => array(
1470 //_('Filesystem create previews')
1471 'label' => 'Filesystem create previews',
1472 //_('Filesystem create previews.')
1473 'description' => 'Filesystem create previews.',
1475 'clientRegistryInclude' => TRUE,
1476 'setByAdminModule' => FALSE,
1477 'setBySetupModule' => FALSE,
1480 self::FILESYSTEM_PREVIEW_SERVICE_URL => array(
1481 //_('URL of preview service')
1482 'label' => 'URL of preview service',
1483 //_('URL of preview service.')
1484 'description' => 'URL of preview service.',
1486 'clientRegistryInclude' => FALSE,
1487 'setByAdminModule' => FALSE,
1488 'setBySetupModule' => FALSE,
1492 'default' => array(),
1499 * @see tine20/Tinebase/Config/Abstract::$_appName
1501 protected $_appName = 'Tinebase';
1504 * holds the instance of the singleton
1506 * @var Tinebase_Config
1508 private static $_instance = NULL;
1515 protected static $_serverPlugins = array(
1516 'Tinebase_Server_Plugin_Json' => 80,
1517 'Tinebase_Server_Plugin_WebDAV' => 80,
1518 'Tinebase_Server_Plugin_Cli' => 90,
1519 'Tinebase_Server_Plugin_Http' => 100
1525 * don't use the constructor. use the singleton
1527 private function __construct() {}
1532 * don't use the constructor. use the singleton
1534 private function __clone() {}
1537 * Returns instance of Tinebase_Config
1539 * @return Tinebase_Config
1541 public static function getInstance()
1543 if (self::$_instance === NULL) {
1544 self::$_instance = new Tinebase_Config();
1547 return self::$_instance;
1552 * @see tine20/Tinebase/Config/Abstract::getProperties()
1554 public static function getProperties()
1556 return self::$_properties;
1560 * get config for client registry
1562 * @return Tinebase_Config_Struct
1564 public function getClientRegistryConfig()
1566 // get all config names to be included in registry
1567 $clientProperties = new Tinebase_Config_Struct(array());
1568 $userApplications = Tinebase_Core::getUser()->getApplications(TRUE);
1569 foreach ($userApplications as $application) {
1570 $config = Tinebase_Config_Abstract::factory($application->name);
1572 $clientProperties[$application->name] = new Tinebase_Config_Struct(array());
1573 $properties = $config->getProperties();
1574 foreach ((array) $properties as $name => $definition) {
1576 if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__
1577 . ' ' . print_r($definition, TRUE));
1579 if (isset($definition['clientRegistryInclude']) && $definition['clientRegistryInclude'] === TRUE)
1581 // add definition here till we have a better place
1583 $configRegistryItem = new Tinebase_Config_Struct(array(
1584 'value' => $config->{$name},
1585 'definition' => new Tinebase_Config_Struct($definition),
1586 ), null, null, array(
1587 'value' => array('type' => $definition['type']),
1588 'definition' => array('type' => Tinebase_Config_Abstract::TYPE_ARRAY, 'class' => 'Tinebase_Config_Struct')
1590 if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__
1591 . ' ' . print_r($configRegistryItem->toArray(), TRUE));
1592 $clientProperties[$application->name][$name] = $configRegistryItem;
1593 } catch (Exception $e) {
1594 Tinebase_Exception::log($e);
1598 if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__
1599 . ' Got ' . count($clientProperties[$application->name]) . ' config items for ' . $application->name . '.');
1603 return $clientProperties;
1607 * get application config
1609 * @param string $applicationName Application name
1610 * @return Tinebase_Config_Abstract $configClass
1612 public static function getAppConfig($applicationName)
1614 $configClassName = $applicationName . '_Config';
1615 if (@class_exists($configClassName)) {
1616 /** @noinspection PhpUndefinedMethodInspection */
1617 return $configClassName::getInstance();
1619 if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__
1620 . ' Application ' . $applicationName . ' has no config.');