7 * @license http://www.gnu.org/licenses/agpl.html AGPL Version 3
8 * @copyright Copyright (c) 2007-2014 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
42 const SIEVE = 'sieve';
45 * authentication backend config
49 const AUTHENTICATIONBACKEND = 'Tinebase_Authentication_BackendConfiguration';
52 * authentication backend type config
56 const AUTHENTICATIONBACKENDTYPE = 'Tinebase_Authentication_BackendType';
59 * save automatic alarms when creating new record
63 const AUTOMATICALARM = 'automaticalarm';
70 const USERBACKEND = 'Tinebase_User_BackendConfiguration';
73 * user backend type config
77 const USERBACKENDTYPE = 'Tinebase_User_BackendType';
84 const CRONUSERID = 'cronuserid';
91 const SETUPUSERID = 'setupuserid';
94 * FEATURE_SHOW_ADVANCED_SEARCH
98 const FEATURE_SHOW_ADVANCED_SEARCH = 'featureShowAdvancedSearch';
101 * FEATURE_CONTAINER_CUSTOM_SORT
105 const FEATURE_CONTAINER_CUSTOM_SORT = 'featureContainerCustomSort';
108 * FEATURE_SHOW_ACCOUNT_EMAIL
112 const FEATURE_SHOW_ACCOUNT_EMAIL = 'featureShowAccountEmail';
115 * FEATURE_REMEMBER_POPUP_SIZE
119 const FEATURE_REMEMBER_POPUP_SIZE = 'featureRememberPopupSize';
122 * user defined page title postfix for browser page title
126 const PAGETITLEPOSTFIX = 'pagetitlepostfix';
129 * logout redirect url
133 const REDIRECTURL = 'redirectUrl';
140 const REDIRECTALWAYS = 'redirectAlways';
143 * Config key for Setting "Redirect to referring site if exists?"
147 const REDIRECTTOREFERRER = 'redirectToReferrer';
150 * Config key for configuring allowed origins of the json frontend
154 const ALLOWEDJSONORIGINS = 'allowedJsonOrigins';
157 * Config key for acceptedTermsVersion
160 const ACCEPTEDTERMSVERSION = 'acceptedTermsVersion';
163 * Config key for map panel in addressbook / include geoext code
166 const MAPPANEL = 'mapPanel';
169 * disable ldap certificate check
173 const LDAP_DISABLE_TLSREQCERT = 'ldapDisableTlsReqCert';
176 * overwritten ldap fields
180 const LDAP_OVERWRITE_CONTACT_FIELDS = 'ldapOverwriteContactFields';
183 * configure hook class for user sync
187 const SYNC_USER_HOOK_CLASS = 'syncUserHookClass';
190 * configure if user contact data should be synced from sync backend
194 const SYNC_USER_CONTACT_DATA = 'syncUserContactData';
197 * Config key for session ip validation -> if this is set to FALSE no Zend_Session_Validator_IpAddress is registered
201 const SESSIONIPVALIDATION = 'sessionIpValidation';
204 * Config key for session user agent validation -> if this is set to FALSE no Zend_Session_Validator_HttpUserAgent is registered
208 const SESSIONUSERAGENTVALIDATION = 'sessionUserAgentValidation';
211 * filestore directory
215 const FILESDIR = 'filesdir';
220 * @deprecated move to app config
223 const XLSEXPORTCONFIG = 'xlsexportconfig';
228 * @deprecated move to app and split
231 const APPDEFAULTS = 'appdefaults';
234 * REUSEUSERNAME_SAVEUSERNAME
238 const REUSEUSERNAME_SAVEUSERNAME = 'saveusername';
245 const PASSWORD_CHANGE = 'changepw';
248 * PASSWORD_POLICY_ACTIVE
252 const PASSWORD_POLICY_ACTIVE = 'pwPolicyActive';
255 * PASSWORD_POLICY_ONLYASCII
259 const PASSWORD_POLICY_ONLYASCII = 'pwPolicyOnlyASCII';
262 * PASSWORD_POLICY_MIN_LENGTH
266 const PASSWORD_POLICY_MIN_LENGTH = 'pwPolicyMinLength';
269 * PASSWORD_POLICY_MIN_WORD_CHARS
273 const PASSWORD_POLICY_MIN_WORD_CHARS = 'pwPolicyMinWordChars';
276 * PASSWORD_POLICY_MIN_UPPERCASE_CHARS
280 const PASSWORD_POLICY_MIN_UPPERCASE_CHARS = 'pwPolicyMinUppercaseChars';
283 * PASSWORD_POLICY_MIN_SPECIAL_CHARS
287 const PASSWORD_POLICY_MIN_SPECIAL_CHARS = 'pwPolicyMinSpecialChars';
290 * PASSWORD_POLICY_MIN_NUMBERS
294 const PASSWORD_POLICY_MIN_NUMBERS = 'pwPolicyMinNumbers';
297 * PASSWORD_POLICY_FORBID_USERNAME
301 const PASSWORD_POLICY_FORBID_USERNAME = 'pwPolicyForbidUsername';
304 * AUTOMATIC_BUGREPORTS
308 const AUTOMATIC_BUGREPORTS = 'automaticBugreports';
311 * LAST_SESSIONS_CLEANUP_RUN
315 const LAST_SESSIONS_CLEANUP_RUN = 'lastSessionsCleanupRun';
318 * WARN_LOGIN_FAILURES
322 const WARN_LOGIN_FAILURES = 'warnLoginFailures';
325 * ANYONE_ACCOUNT_DISABLED
329 const ANYONE_ACCOUNT_DISABLED = 'anyoneAccountDisabled';
336 const ALARMS_EACH_JOB = 'alarmsEachJob';
339 * ACCOUNT_DEACTIVATION_NOTIFICATION
343 const ACCOUNT_DEACTIVATION_NOTIFICATION = 'accountDeactivationNotification';
346 * ACCOUNT_DELETION_EVENTCONFIGURATION
350 const ACCOUNT_DELETION_EVENTCONFIGURATION = 'accountDeletionEventConfiguration';
357 const ROLE_CHANGE_ALLOWED = 'roleChangeAllowed';
360 * max username length
364 const MAX_USERNAME_LENGTH = 'max_username_length';
371 const CONFD_FOLDER = 'confdfolder';
378 const MAINTENANCE_MODE = 'maintenanceMode';
383 const FAT_CLIENT_CUSTOM_JS = 'fatClientCustomJS';
385 const BRANDING_LOGO = 'branding_logo';
386 const BRANDING_FAVICON = 'branding_favicon';
387 const BRANDING_TITLE = 'branding_title';
388 const BRANDING_WEBURL = 'branding_weburl';
389 const BRANDING_DESCRIPTION = 'branding_description';
394 const USE_LOGINNAME_AS_FOLDERNAME = 'useLoginnameAsFoldername';
399 const VERSION_CHECK = 'versionCheck';
403 * @see tine20/Tinebase/Config/Definition::$_properties
405 protected static $_properties = array(
409 * $_deletePersonalContainers => delete personal containers
410 * $_keepAsContact => keep "account" as contact in the addressbook
411 * $_keepOrganizerEvents => keep accounts organizer events as external events in the calendar
412 * $_keepAsContact => keep accounts calender event attendee as external attendee
414 * TODO add more options (like move to another container)
416 self::ACCOUNT_DELETION_EVENTCONFIGURATION => array(
417 //_('Account Deletion Event')
418 'label' => 'Account Deletion Event',
419 //_('Configure what should happen to data of deleted users')
420 'description' => 'Configure what should happen to data of deleted users',
422 'class' => 'Tinebase_Config_Struct',
423 'clientRegistryInclude' => FALSE,
424 'setByAdminModule' => TRUE,
425 'setBySetupModule' => TRUE,
429 'label' => 'System IMAP',
430 //_('System IMAP server configuration.')
431 'description' => 'System IMAP server configuration.',
433 'class' => 'Tinebase_Config_Struct',
434 'clientRegistryInclude' => FALSE,
435 'setByAdminModule' => FALSE,
436 'setBySetupModule' => TRUE,
440 'label' => 'System SMTP',
441 //_('System SMTP server configuration.')
442 'description' => 'System SMTP server configuration.',
444 'class' => 'Tinebase_Config_Struct',
445 'clientRegistryInclude' => FALSE,
446 'setByAdminModule' => FALSE,
447 'setBySetupModule' => TRUE,
449 self::SIEVE => array(
451 'label' => 'System SIEVE',
452 //_('System SIEVE server configuration.')
453 'description' => 'System SIEVE server configuration.',
455 'class' => 'Tinebase_Config_Struct',
456 'clientRegistryInclude' => FALSE,
457 'setByAdminModule' => FALSE,
458 'setBySetupModule' => TRUE,
460 self::AUTHENTICATIONBACKENDTYPE => array(
461 //_('Authentication Backend')
462 'label' => 'Authentication Backend',
463 //_('Backend adapter for user authentication.')
464 'description' => 'Backend adapter for user authentication.',
466 'clientRegistryInclude' => FALSE,
467 'setByAdminModule' => FALSE,
468 'setBySetupModule' => TRUE,
470 self::AUTHENTICATIONBACKEND => array(
471 //_('Authentication Configuration')
472 'label' => 'Authentication Configuration',
473 //_('Authentication backend configuration.')
474 'description' => 'Authentication backend configuration.',
476 'class' => 'Tinebase_Config_Struct',
477 'clientRegistryInclude' => FALSE,
478 'setByAdminModule' => FALSE,
479 'setBySetupModule' => TRUE,
481 self::USERBACKENDTYPE => array(
483 'label' => 'User Backend',
484 //_('Backend adapter for user data.')
485 'description' => 'Backend adapter for user data.',
487 'clientRegistryInclude' => FALSE,
488 'setByAdminModule' => FALSE,
489 'setBySetupModule' => TRUE,
491 self::USERBACKEND => array(
492 //_('User Configuration')
493 'label' => 'User Configuration',
494 //_('User backend configuration.')
495 'description' => 'User backend configuration.',
497 'class' => 'Tinebase_Config_Struct',
498 'clientRegistryInclude' => FALSE,
499 'setByAdminModule' => FALSE,
500 'setBySetupModule' => TRUE,
502 self::ENABLED_FEATURES => array(
503 //_('Enabled Features')
504 'label' => 'Enabled Features',
505 'description' => 'Enabled Features',
507 'class' => 'Tinebase_Config_Struct',
508 'clientRegistryInclude' => TRUE,
510 self::FEATURE_SHOW_ADVANCED_SEARCH => array(
511 'label' => 'Show Advanced Search', //_('Show Advanced Search')
512 'description' => 'Show toggle button to switch on or off the advanced search for the quickfilter',
513 //_('Show toggle button to switch on or off the advanced search for the quickfilter')
515 self::FEATURE_CONTAINER_CUSTOM_SORT => array(
516 'label' => 'Container Custom Sort', //_('Container Custom Sort')
517 'description' => 'Allows to sort containers by setting the sort order in Admin/Container',
518 //_('Allows to sort containers by setting the sort order in Admin/Container')
520 self::FEATURE_SHOW_ACCOUNT_EMAIL => array(
521 'label' => 'Show Account Email Address', //_('Show Account Email Address')
522 'description' => 'Show email address in account picker and attendee grids',
523 //_('Show email address in account picker and attendee grids')
525 self::FEATURE_REMEMBER_POPUP_SIZE => array(
526 'label' => 'Remeber Popup Size', //_('Remeber Popup Size')
527 'description' => 'Save edit dialog size in state',
528 //_('Save edit dialog size in state')
532 self::FEATURE_SHOW_ADVANCED_SEARCH => true,
533 self::FEATURE_CONTAINER_CUSTOM_SORT => true,
534 self::FEATURE_SHOW_ACCOUNT_EMAIL => true,
535 self::FEATURE_REMEMBER_POPUP_SIZE => true,
538 self::CRONUSERID => array(
540 'label' => 'Cronuser ID',
541 //_('User ID of the cron user.')
542 'description' => 'User ID of the cron user.',
544 'clientRegistryInclude' => FALSE,
545 'setByAdminModule' => TRUE,
546 'setBySetupModule' => TRUE,
548 self::PAGETITLEPOSTFIX => array(
550 'label' => 'Title Postfix',
551 //_('Postfix string appended to the title of this installation.')
552 'description' => 'Postfix string appended to the title of this installation.',
554 'clientRegistryInclude' => FALSE,
555 'setByAdminModule' => TRUE,
556 'setBySetupModule' => TRUE,
558 self::REDIRECTURL => array(
560 'label' => 'Redirect URL',
561 //_('Redirect to this URL after logout.')
562 'description' => 'Redirect to this URL after logout.',
564 'clientRegistryInclude' => FALSE,
565 'setByAdminModule' => FALSE,
566 'setBySetupModule' => TRUE,
568 self::REDIRECTTOREFERRER => array(
569 //_('Redirect to Referrer')
570 'label' => 'Redirect to Referrer',
571 //_('Redirect to referrer after logout.')
572 'description' => 'Redirect to referrer after logout.',
574 'clientRegistryInclude' => FALSE,
575 'setByAdminModule' => FALSE,
576 'setBySetupModule' => TRUE,
578 self::REDIRECTALWAYS => array(
579 //_('Redirect Always')
580 'label' => 'Redirect Always',
581 //_('Redirect to configured redirect URL also for login.')
582 'description' => 'Redirect to configured redirect URL also for login.',
584 'clientRegistryInclude' => FALSE,
585 'setByAdminModule' => FALSE,
586 'setBySetupModule' => TRUE,
588 self::ALLOWEDJSONORIGINS => array(
589 //_('Allowed Origins')
590 'label' => 'Allowed Origins',
591 //_('Allowed Origins for the JSON API.')
592 'description' => 'Allowed Origins for the JSON API.',
594 'clientRegistryInclude' => FALSE,
595 'setByAdminModule' => FALSE,
596 'setBySetupModule' => FALSE,
598 self::ACCEPTEDTERMSVERSION => array(
599 //_('Accepted Terms Version')
600 'label' => 'Accepted Terms Version',
601 //_('Accepted version number of the terms and conditions document.')
602 'description' => 'Accepted version number of the terms and conditions document.',
604 'clientRegistryInclude' => FALSE,
605 'setByAdminModule' => FALSE,
606 'setBySetupModule' => FALSE,
608 self::MAPPANEL => array(
609 //_('Use Geolocation Services')
610 'label' => 'Use Geolocation Services',
611 //_('Use of external Geolocation services is allowed.')
612 'description' => 'Use of external Geolocation services is allowed.',
614 'clientRegistryInclude' => TRUE,
615 'setByAdminModule' => FALSE,
616 'setBySetupModule' => TRUE,
618 self::LDAP_DISABLE_TLSREQCERT => array(
619 //_('Disable LDAP TLS Certificate Check')
620 'label' => 'Disable LDAP TLS Certificate Check',
621 //_('LDAP TLS Certificate should not be checked')
622 'description' => 'LDAP TLS Certificate should not be checked',
624 'clientRegistryInclude' => false,
625 'setByAdminModule' => false,
626 'setBySetupModule' => true,
629 // TODO should this be added to LDAP config array/struct?
630 // TODO does this depend on LDAP readonly option?
631 self::LDAP_OVERWRITE_CONTACT_FIELDS => array(
632 //_('Contact fields overwritten by LDAP')
633 'label' => 'Contact fields overwritten by LDAP',
634 //_('These fields are overwritten during LDAP sync if empty')
635 'description' => 'These fields are overwritten during LDAP sync if empty',
637 'clientRegistryInclude' => false,
638 'setByAdminModule' => false,
639 'setBySetupModule' => true,
642 self::SYNC_USER_HOOK_CLASS => array(
643 //_('Configure hook class for user sync')
644 'label' => 'Configure hook class for user sync',
645 //_('Allows to change data after fetching user from sync backend')
646 'description' => 'Allows to change data after fetching user from sync backend',
648 'clientRegistryInclude' => false,
649 'setByAdminModule' => false,
650 'setBySetupModule' => true,
652 self::SYNC_USER_CONTACT_DATA => array(
653 //_('Sync contact data from sync backend')
654 'label' => 'Sync contact data from sync backend',
655 //_('Sync user contact data from sync backend')
656 'description' => 'Sync user contact data from sync backend',
658 'clientRegistryInclude' => FALSE,
659 'setByAdminModule' => FALSE,
660 'setBySetupModule' => FALSE,
663 self::SESSIONIPVALIDATION => array(
664 //_('IP Session Validator')
665 'label' => 'IP Session Validator',
666 //_('Destroy session if the users IP changes.')
667 'description' => 'Destroy session if the users IP changes.',
669 'clientRegistryInclude' => FALSE,
670 'setByAdminModule' => FALSE,
671 'setBySetupModule' => TRUE,
673 self::SESSIONUSERAGENTVALIDATION => array(
674 //_('UA Session Validator')
675 'label' => 'UA Session Validator',
676 //_('Destroy session if the users user agent string changes.')
677 'description' => 'Destroy session if the users user agent string changes.',
679 'clientRegistryInclude' => FALSE,
680 'setByAdminModule' => FALSE,
681 'setBySetupModule' => TRUE,
683 self::FILESDIR => array(
684 //_('Files Directory')
685 'label' => 'Files Directory',
686 //_('Directory with web server write access for user files.')
687 'description' => 'Directory with web server write access for user files.',
689 'clientRegistryInclude' => FALSE,
690 'setByAdminModule' => FALSE,
691 'setBySetupModule' => TRUE,
693 self::REUSEUSERNAME_SAVEUSERNAME => array(
694 //_('Reuse last username logged')
695 'label' => 'Reuse last username logged',
696 //_('Reuse last username logged')
697 'description' => 'Reuse last username logged',
699 'clientRegistryInclude' => FALSE,
700 'setByAdminModule' => FALSE,
701 'setBySetupModule' => TRUE,
703 self::PASSWORD_CHANGE => array(
704 //_('User may change password')
705 'label' => 'User may change password',
706 //_('User may change password')
707 'description' => 'User may change password',
709 'clientRegistryInclude' => TRUE,
710 'setByAdminModule' => FALSE,
711 'setBySetupModule' => TRUE,
714 self::PASSWORD_POLICY_ACTIVE => array(
715 //_('Enable password policy')
716 'label' => 'Enable password policy',
717 //_('Enable password policy')
718 'description' => 'Enable password policy',
720 'clientRegistryInclude' => FALSE,
721 'setByAdminModule' => FALSE,
722 'setBySetupModule' => TRUE,
724 self::PASSWORD_POLICY_ONLYASCII => array(
726 'label' => 'Only ASCII',
727 //_('Only ASCII characters are allowed in passwords.')
728 'description' => 'Only ASCII characters are allowed in passwords.',
730 'clientRegistryInclude' => FALSE,
731 'setByAdminModule' => FALSE,
732 'setBySetupModule' => TRUE,
734 self::PASSWORD_POLICY_MIN_LENGTH => array(
735 //_('Minimum length')
736 'label' => 'Minimum length',
737 //_('Minimum password length')
738 'description' => 'Minimum password length.',
740 'clientRegistryInclude' => FALSE,
741 'setByAdminModule' => FALSE,
742 'setBySetupModule' => TRUE,
744 self::PASSWORD_POLICY_MIN_WORD_CHARS => array(
745 //_('Minimum word chars')
746 'label' => 'Minimum word chars',
747 //_('Minimum word chars in password')
748 'description' => 'Minimum word chars in password',
750 'clientRegistryInclude' => FALSE,
751 'setByAdminModule' => FALSE,
752 'setBySetupModule' => TRUE,
754 self::PASSWORD_POLICY_MIN_UPPERCASE_CHARS => array(
755 //_('Minimum uppercase chars')
756 'label' => 'Minimum uppercase chars',
757 //_('Minimum uppercase chars in password')
758 'description' => 'Minimum uppercase chars in password',
760 'clientRegistryInclude' => FALSE,
761 'setByAdminModule' => FALSE,
762 'setBySetupModule' => TRUE,
764 self::PASSWORD_POLICY_MIN_SPECIAL_CHARS => array(
765 //_('Minimum special chars')
766 'label' => 'Minimum special chars',
767 //_('Minimum special chars in password')
768 'description' => 'Minimum special chars in password',
770 'clientRegistryInclude' => FALSE,
771 'setByAdminModule' => FALSE,
772 'setBySetupModule' => TRUE,
774 self::PASSWORD_POLICY_MIN_NUMBERS => array(
775 //_('Minimum numbers')
776 'label' => 'Minimum numbers',
777 //_('Minimum numbers in password')
778 'description' => 'Minimum numbers in password',
780 'clientRegistryInclude' => FALSE,
781 'setByAdminModule' => FALSE,
782 'setBySetupModule' => TRUE,
784 self::PASSWORD_POLICY_FORBID_USERNAME => array(
785 //_('Forbid part of username')
786 'label' => 'Forbid part of username',
787 //_('Forbid part of username in password')
788 'description' => 'Forbid part of username in password',
790 'clientRegistryInclude' => FALSE,
791 'setByAdminModule' => FALSE,
792 'setBySetupModule' => TRUE,
794 self::AUTOMATIC_BUGREPORTS => array(
795 //_('Automatic bugreports')
796 'label' => 'Automatic bugreports',
797 //_('Always send bugreports, even on timeouts and other exceptions / failures.')
798 'description' => 'Always send bugreports, even on timeouts and other exceptions / failures.',
800 'clientRegistryInclude' => TRUE,
801 'setByAdminModule' => FALSE,
802 'setBySetupModule' => TRUE,
804 self::LAST_SESSIONS_CLEANUP_RUN => array(
805 //_('Last sessions cleanup run')
806 'label' => 'Last sessions cleanup run',
807 //_('Stores the timestamp of the last sessions cleanup task run.')
808 'description' => 'Stores the timestamp of the last sessions cleanup task run.',
809 'type' => self::TYPE_DATETIME,
810 'clientRegistryInclude' => FALSE,
811 'setByAdminModule' => FALSE,
812 'setBySetupModule' => FALSE,
814 self::WARN_LOGIN_FAILURES => array(
815 //_('Warn after X login failures')
816 'label' => 'Warn after X login failures',
817 //_('Maximum allowed login failures before writing warn log messages')
818 'description' => 'Maximum allowed login failures before writing warn log messages',
820 'clientRegistryInclude' => FALSE,
821 'setByAdminModule' => FALSE,
822 'setBySetupModule' => TRUE,
825 self::ANYONE_ACCOUNT_DISABLED => array(
826 //_('Disable Anyone Account')
827 'label' => 'Disable Anyone Account',
828 //_('Disallow anyone account in grant configurations')
829 'description' => 'Disallow anyone account in grant configurations',
831 'clientRegistryInclude' => TRUE,
832 'setByAdminModule' => FALSE,
833 'setBySetupModule' => TRUE,
835 self::ALARMS_EACH_JOB => array(
836 //_('Alarms sent each job')
837 'label' => 'Alarms sent each job',
838 //_('Allows to configure the maximum number of alarm notifications in each run of sendPendingAlarms (0 = no limit)')
839 'description' => 'Allows to configure the maximum number of alarm notifications in each run of sendPendingAlarms (0 = no limit)',
841 'clientRegistryInclude' => FALSE,
842 'setByAdminModule' => FALSE,
843 'setBySetupModule' => TRUE,
845 self::ACCOUNT_DEACTIVATION_NOTIFICATION => array(
846 //_('Account deactivation notfication')
847 'label' => 'Account deactivation notfication',
848 //_('Send E-Mail to user if the account is deactivated or the user tries to login with deactivated account')
849 'description' => 'Send E-Mail to User if the account is deactivated or the user tries to login with deactivated account',
851 'clientRegistryInclude' => FALSE,
852 'setByAdminModule' => FALSE,
853 'setBySetupModule' => TRUE,
855 self::ROLE_CHANGE_ALLOWED => array(
856 //_('Role change allowed')
857 'label' => 'Role change allowed',
858 //_('Allows to configure which user is allowed to switch to another users account')
859 'description' => 'Allows to configure which user is allowed to switch to another users account',
860 'type' => 'Tinebase_Config_Struct',
861 'clientRegistryInclude' => TRUE,
862 'setByAdminModule' => FALSE,
863 'setBySetupModule' => TRUE,
865 self::MAX_USERNAME_LENGTH => array(
866 //_('Max username length')
867 'label' => 'Max username length',
868 //_('Max username length')
869 'description' => 'Max username length',
872 'clientRegistryInclude' => FALSE,
874 self::CONFD_FOLDER => array(
875 //_('conf.d folder name')
876 'label' => 'conf.d folder name',
877 //_('Folder for additional config files (conf.d) - NOTE: this is only used if set in config.inc.php!')
878 'description' => 'Folder for additional config files (conf.d) - NOTE: this is only used if set in config.inc.php!',
881 'clientRegistryInclude' => FALSE,
882 'setByAdminModule' => FALSE,
883 'setBySetupModule' => FALSE,
885 self::MAINTENANCE_MODE => array(
886 //_('Maintenance mode enabled')
887 'label' => 'Maintenance mode enabled',
888 //_('Folder for additional config files (conf.d) - NOTE: this is only used if set in config.inc.php!')
889 'description' => 'Installation is in maintenance mode. With this only users having the maintenance right can login',
892 'clientRegistryInclude' => FALSE,
893 'setByAdminModule' => TRUE,
894 'setBySetupModule' => TRUE,
896 self::VERSION_CHECK => array(
897 //_('Version check enabled')
898 'label' => 'Version check enabled',
899 'description' => 'Version check enabled',
902 'clientRegistryInclude' => true,
903 'setByAdminModule' => false,
904 'setBySetupModule' => false,
906 self::FAT_CLIENT_CUSTOM_JS => array(
907 // NOTE: it's possible to deliver customjs vom vfs by using the tine20:// streamwrapper
908 // tine20://<applicationid>/folders/shared/<containerid>/custom.js
909 //_('Custom Javascript includes for Fat-Client')
910 'label' => 'Custom Javascript includes for Fat-Client',
911 //_('An array of javascript files to include for the fat client. This files might be stored outside the docroot of the webserver.')
912 'description' => "An array of javascript files to include for the fat client. This files might be stored outside the docroot of the webserver.",
914 'default' => array(),
915 'clientRegistryInclude' => FALSE,
916 'setByAdminModule' => FALSE,
917 'setBySetupModule' => FALSE,
919 self::BRANDING_DESCRIPTION => array(
920 //_('custom description')
921 'label' => 'custom description',
922 //_('Custom description for branding.')
923 'description' => 'Custom description for branding.',
926 'clientRegistryInclude' => FALSE,
927 'setByAdminModule' => FALSE,
928 'setBySetupModule' => FALSE,
930 self::BRANDING_WEBURL => array(
932 'label' => 'custom weburl',
933 //_('Custom weburl for branding.')
934 'description' => 'Custom weburl for branding.',
937 'clientRegistryInclude' => FALSE,
938 'setByAdminModule' => FALSE,
939 'setBySetupModule' => FALSE,
941 self::BRANDING_TITLE => array(
943 'label' => 'custom title',
944 //_('Custom title for branding.')
945 'description' => 'Custom ltitle for branding.',
948 'clientRegistryInclude' => FALSE,
949 'setByAdminModule' => FALSE,
950 'setBySetupModule' => FALSE,
952 self::BRANDING_LOGO => array(
953 //_('custom logo path')
954 'label' => 'custom logo path',
955 //_('Path to custom logo.')
956 'description' => 'Path to custom logo.',
959 'clientRegistryInclude' => FALSE,
960 'setByAdminModule' => FALSE,
961 'setBySetupModule' => FALSE,
963 self::BRANDING_FAVICON => array(
964 //_('custom favicon path')
965 'label' => 'custom favicon path',
966 //_('Path to custom favicon.')
967 'description' => 'Path to custom favicon.',
970 'clientRegistryInclude' => FALSE,
971 'setByAdminModule' => FALSE,
972 'setBySetupModule' => FALSE,
974 self::USE_LOGINNAME_AS_FOLDERNAME => array(
975 //_('Use login name instead of full name')
976 'label' => 'Use login name instead of full name',
977 //_('Use login name instead of full name for webdav.')
978 'description' => 'Use login name instead of full name for webdav.',
980 'clientRegistryInclude' => FALSE,
981 'setByAdminModule' => FALSE,
982 'setBySetupModule' => FALSE,
989 * @see tine20/Tinebase/Config/Abstract::$_appName
991 protected $_appName = 'Tinebase';
994 * holds the instance of the singleton
996 * @var Tinebase_Config
998 private static $_instance = NULL;
1005 protected static $_serverPlugins = array(
1006 'Tinebase_Server_Plugin_Json' => 80,
1007 'Tinebase_Server_Plugin_WebDAV' => 80,
1008 'Tinebase_Server_Plugin_Cli' => 90,
1009 'Tinebase_Server_Plugin_Http' => 100
1015 * don't use the constructor. use the singleton
1017 private function __construct() {}
1022 * don't use the constructor. use the singleton
1024 private function __clone() {}
1027 * Returns instance of Tinebase_Config
1029 * @return Tinebase_Config
1031 public static function getInstance()
1033 if (self::$_instance === NULL) {
1034 self::$_instance = new Tinebase_Config();
1037 return self::$_instance;
1042 * @see tine20/Tinebase/Config/Abstract::getProperties()
1044 public static function getProperties()
1046 return self::$_properties;
1050 * get config for client registry
1052 * @return Tinebase_Config_Struct
1054 public function getClientRegistryConfig()
1056 // get all config names to be included in registry
1057 $clientProperties = new Tinebase_Config_Struct(array());
1058 $userApplications = Tinebase_Core::getUser()->getApplications(TRUE);
1059 foreach ($userApplications as $application) {
1060 $config = Tinebase_Config_Abstract::factory($application->name);
1062 $clientProperties[$application->name] = new Tinebase_Config_Struct(array());
1063 $properties = $config->getProperties();
1064 foreach ((array) $properties as $name => $definition) {
1066 if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__
1067 . ' ' . print_r($definition, TRUE));
1069 if ((isset($definition['clientRegistryInclude']) || array_key_exists('clientRegistryInclude', $definition))
1070 && $definition['clientRegistryInclude'] === TRUE)
1072 // add definition here till we have a better place
1074 $configRegistryItem = new Tinebase_Config_Struct(array(
1075 'value' => $config->{$name},
1076 'definition' => new Tinebase_Config_Struct($definition),
1078 if (Tinebase_Core::isLogLevel(Zend_Log::TRACE)) Tinebase_Core::getLogger()->trace(__METHOD__ . '::' . __LINE__
1079 . ' ' . print_r($configRegistryItem->toArray(), TRUE));
1080 $clientProperties[$application->name][$name] = $configRegistryItem;
1081 } catch (Exception $e) {
1082 Tinebase_Exception::log($e);
1086 if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__
1087 . ' Got ' . count($clientProperties[$application->name]) . ' config items for ' . $application->name . '.');
1091 return $clientProperties;
1095 * get application config
1097 * @param string $applicationName Application name
1098 * @return Tinebase_Config_Abstract $configClass
1100 public static function getAppConfig($applicationName)
1102 $configClassName = $applicationName . '_Config';
1103 if (@class_exists($configClassName)) {
1104 return $configClassName::getInstance();
1106 if (Tinebase_Core::isLogLevel(Zend_Log::INFO)) Tinebase_Core::getLogger()->info(__METHOD__ . '::' . __LINE__
1107 . ' Application ' . $applicationName . ' has no config.');
1113 * get option setting string
1116 * @param Tinebase_Record_Interface $_record
1117 * @param string $_id
1118 * @param string $_label
1121 public static function getOptionString($_record, $_label)
1123 $controller = Tinebase_Core::getApplicationInstance($_record->getApplication());
1124 $settings = $controller->getConfigSettings();
1125 $idField = $_label . '_id';
1127 $option = $settings->getOptionById($_record->{$idField}, $_label . 's');
1129 $result = (isset($option[$_label])) ? $option[$_label] : '';