diff --git a/typo3/sysext/backend/Classes/Backend/ToolbarItems/ShortcutToolbarItem.php b/typo3/sysext/backend/Classes/Backend/ToolbarItems/ShortcutToolbarItem.php index 2a4cbeca4244d32e44abd4f02af4211e424ec52f..034a4506d32bf3b2574977ce0cf330475226f1dc 100644 --- a/typo3/sysext/backend/Classes/Backend/ToolbarItems/ShortcutToolbarItem.php +++ b/typo3/sysext/backend/Classes/Backend/ToolbarItems/ShortcutToolbarItem.php @@ -573,23 +573,21 @@ class ShortcutToolbarItem implements ToolbarItemInterface { $shortcutId = (int)GeneralUtility::_POST('shortcutId'); $shortcutName = strip_tags(GeneralUtility::_POST('shortcutTitle')); $shortcutGroupId = (int)GeneralUtility::_POST('shortcutGroup'); - if ($shortcutGroupId > 0 || $backendUser->isAdmin()) { - // Users can delete only their own shortcuts (except admins) - $addUserWhere = !$backendUser->isAdmin() ? ' AND userid=' . (int)$backendUser->user['uid'] : ''; - $fieldValues = array( - 'description' => $shortcutName, - 'sc_group' => $shortcutGroupId - ); - if ($fieldValues['sc_group'] < 0 && !$backendUser->isAdmin()) { - $fieldValues['sc_group'] = 0; - } - $databaseConnection->exec_UPDATEquery('sys_be_shortcuts', 'uid=' . $shortcutId . $addUserWhere, $fieldValues); - $affectedRows = $databaseConnection->sql_affected_rows(); - if ($affectedRows == 1) { - $ajaxObj->addContent('shortcut', $shortcutName); - } else { - $ajaxObj->addContent('shortcut', 'failed'); - } + // Users can only modify their own shortcuts (except admins) + $addUserWhere = !$backendUser->isAdmin() ? ' AND userid=' . (int)$backendUser->user['uid'] : ''; + $fieldValues = array( + 'description' => $shortcutName, + 'sc_group' => $shortcutGroupId + ); + if ($fieldValues['sc_group'] < 0 && !$backendUser->isAdmin()) { + $fieldValues['sc_group'] = 0; + } + $databaseConnection->exec_UPDATEquery('sys_be_shortcuts', 'uid=' . $shortcutId . $addUserWhere, $fieldValues); + $affectedRows = $databaseConnection->sql_affected_rows(); + if ($affectedRows == 1) { + $ajaxObj->addContent('shortcut', $shortcutName); + } else { + $ajaxObj->addContent('shortcut', 'failed'); } $ajaxObj->setContentFormat('plain'); }