From: Rupert Germann Date: Thu, 3 Sep 2009 16:49:44 +0000 (+0000) Subject: Added feature #0011773: Integrate an option to deactivate shortcuts completely ... X-Git-Tag: TYPO3_4-3-0beta1~184 X-Git-Url: http://git.typo3.org/Packages/TYPO3.CMS.git/commitdiff_plain/b3e124cad2bb75e0cf4c8c1837ecaf6ccbeb639b Added feature #0011773: Integrate an option to deactivate shortcuts completely (thanks to Christopher Stelmaszyk) git-svn-id: https://svn.typo3.org/TYPO3v4/Core/trunk@5885 709f56b5-9817-0410-a4d7-c38de5d9e867 --- diff --git a/ChangeLog b/ChangeLog index 9c29053b54b7..e8bff1d6b7db 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-09-03 Rupert Germann + + * Added feature #0011773: Integrate an option to deactivate shortcuts completely (thanks to Christopher Stelmaszyk) + 2009-09-03 Stanislas Rolland * Updated htmlArea RTE version to 1.8.3 for TYPO3 4.3beta1 diff --git a/t3lib/class.t3lib_userauthgroup.php b/t3lib/class.t3lib_userauthgroup.php index 87b9419fda57..ccbbcc0bb8e9 100644 --- a/t3lib/class.t3lib_userauthgroup.php +++ b/t3lib/class.t3lib_userauthgroup.php @@ -656,7 +656,19 @@ class t3lib_userAuthGroup extends t3lib_userAuth { * @return boolean */ function mayMakeShortcut() { - return $this->getTSConfigVal('options.shortcutFrame') && !$this->getTSConfigVal('options.mayNotCreateEditShortcuts'); + // If the old BE is used (maybe with some parameters), + // check for options.enableShortcuts and options.shortcutFrame being set. + if (substr($this->getTSConfigVal('auth.BE.redirectToURL'), 0, 12) == 'alt_main.php') { + return $this->getTSConfigVal('options.enableShortcuts') && + $this->getTSConfigVal('options.shortcutFrame') && + !$this->getTSConfigVal('options.mayNotCreateEditShortcuts'); + } + // If the new BE is used, don't check options.shortcutFrame, + // because this is not used there anymore. + else { + return $this->getTSConfigVal('options.enableShortcuts') && + !$this->getTSConfigVal('options.mayNotCreateEditShortcuts'); + } } /** diff --git a/t3lib/config_default.php b/t3lib/config_default.php index 192e1cefeafc..77f47da837ed 100644 --- a/t3lib/config_default.php +++ b/t3lib/config_default.php @@ -203,7 +203,8 @@ $TYPO3_CONF_VARS = Array( 'forceCharset' => '', // String. Normally the charset of the backend users language selection is used. If you set this value to a charset found in t3lib/csconvtbl/ (or "utf-8") the backend (and database) will ALWAYS use this charset. Always use a lowercase value. 'installToolPassword' => '', // String. This is the md5-hashed password for the Install Tool. Set this to '' and access will be totally denied. PLEASE consider to externally password protect the typo3/install/ folder, eg. with a .htaccess file. 'trackBeUser' => 0, // Boolean. If set, every invokation of a backend script is logged in sys_trackbeuser. This is used to get a view of the backend users behaviour. Mostly for debugging, support and user interaction analysis. Requires 'beuser_tracking' extension. - 'defaultUserTSconfig' => 'options.shortcutFrame=1', // String. Enter lines of default backend user/group TSconfig. + 'defaultUserTSconfig' => 'options.shortcutFrame=1 + options.enableShortcuts=1', // String. Enter lines of default backend user/group TSconfig. 'defaultPageTSconfig' => '', // Enter lines of default Page TSconfig. 'defaultPermissions' => array ( // Default permissions set for new pages in t3lib/tce_main.php. Keys are 'show,edit,delete,new,editcontent'. Enter as comma-list // 'user' => '', // default in tce_main is 'show,edit,delete,new,editcontent'. If this is set (uncomment), this value is used instead. diff --git a/typo3/alt_shortcut.php b/typo3/alt_shortcut.php index d982debf4afe..65422eca2225 100644 --- a/typo3/alt_shortcut.php +++ b/typo3/alt_shortcut.php @@ -426,8 +426,12 @@ class SC_alt_shortcut { --> - '.implode(' - ',$this->lines).$editIdCode.' + '; + if ($GLOBALS['BE_USER']->getTSConfigVal('options.enableShortcuts')) { + $this->content .= implode(' + ', $this->lines); + } + $this->content .= $editIdCode . '
diff --git a/typo3/classes/class.shortcutmenu.php b/typo3/classes/class.shortcutmenu.php index ab0dd4444e73..ad2cc39a7f3c 100644 --- a/typo3/classes/class.shortcutmenu.php +++ b/typo3/classes/class.shortcutmenu.php @@ -99,8 +99,10 @@ class ShortcutMenu implements backend_toolbarItem { * @return boolean true if user has access, false if not */ public function checkAccess() { - // Shortcut module is enabled for everybody - return true; + if ($GLOBALS['BE_USER']->getTSConfigVal('options.enableShortcuts')) { + return true; + } + return false; } /**