diff --git a/application/shortcut.class.inc.php b/application/shortcut.class.inc.php index 7867b5d59f..c356e7c7ea 100644 --- a/application/shortcut.class.inc.php +++ b/application/shortcut.class.inc.php @@ -109,10 +109,18 @@ $('#shortcut_rename_dlg').dialog({ modal: true, title: '$sDialogTitle', buttons: [ - { text: "$sOkButtonLabel", click: ShortcutRenameOK}, - { text: "$sCancelButtonLabel", click: function() { - $(this).dialog( "close" ); $(this).remove(); - } }, + { + text: "$sCancelButtonLabel", + click: function() { + $(this).dialog( "close" ); $(this).remove(); + }, + 'class': 'ibo-button ibo-is-alternative ibo-is-neutral action cancel' + }, + { + text: "$sOkButtonLabel", + click: ShortcutRenameOK, + 'class': 'ibo-is-regular ibo-is-primary' + }, ], close: function() { $(this).remove(); } }); diff --git a/pages/ajax.render.php b/pages/ajax.render.php index 2b9bc00583..d0dce4f7a4 100644 --- a/pages/ajax.render.php +++ b/pages/ajax.render.php @@ -1239,13 +1239,31 @@ JS $oSearch = new DBObjectSearch('Shortcut'); $aShortcuts = utils::ReadMultipleSelection($oSearch); $iShortcut = $aShortcuts[0]; - $oShortcut = MetaModel::GetObject('Shortcut', $iShortcut); + $oShortcutSearch = new DBObjectSearch('Shortcut'); + $oShortcutSearch->AddCondition('user_id', UserRights::GetUserId(), '='); + $oShortcutSearch->AddCondition('id', $iShortcut, '='); + $oShortcutSet = new CMDBObjectSet($oShortcutSearch); + if ($oShortcutSet->Count() === 0) { + throw new SecurityException(Dict::S('UI:ObjectDoesNotExist')); + } + + $oShortcut = $oShortcutSet->Fetch(); + $oShortcut->StartRenameDialog($oPage); break; case 'shortcut_rename_go': $iShortcut = utils::ReadParam('id', 0); - $oShortcut = MetaModel::GetObject('Shortcut', $iShortcut); + + $oShortcutSearch = new DBObjectSearch('Shortcut'); + $oShortcutSearch->AddCondition('user_id', UserRights::GetUserId(), '='); + $oShortcutSearch->AddCondition('id', $iShortcut, '='); + $oShortcutSet = new CMDBObjectSet($oShortcutSearch); + if ($oShortcutSet->Count() === 0) { + throw new SecurityException(Dict::S('UI:ObjectDoesNotExist')); + } + + $oShortcut = $oShortcutSet->Fetch(); $sName = utils::ReadParam('attr_name', '', false, 'raw_data'); if (strlen($sName) > 0) { diff --git a/pages/preferences.php b/pages/preferences.php index 0f69190a6b..d984abc170 100644 --- a/pages/preferences.php +++ b/pages/preferences.php @@ -243,7 +243,7 @@ JS ); $oShortcutsToolBar->AddSubBlock($oShortcutsRenameButton); // - Delete button - $oShortcutsDeleteButton = ButtonUIBlockFactory::MakeForSecondaryAction( + $oShortcutsDeleteButton = ButtonUIBlockFactory::MakeForDestructiveAction( Dict::S('UI:Button:Delete'), null, null,