@@ -117,10 +117,12 @@ public static function processMassiveActionsForOneItemtype(MassiveAction $ma, Co
117117 if ($ ma ->getAction () === "uninstall " ) {
118118 $ itemtype = $ ma ->getItemtype (false );
119119 foreach ($ ids as $ id ) {
120- if ($ item ->getFromDB ($ id )) {
120+ if ($ item ->getFromDB ($ id ) && $ item -> can ( $ id , UPDATE ) ) {
121121 //Session::addMessageAfterRedirect(sprintf(__s('Form duplicated: %s', 'formcreator'), $item->getName()));
122122 $ _SESSION ['glpi_uninstalllist ' ][$ itemtype ][$ id ] = $ id ;
123123 $ ma ->itemDone ($ item ->getType (), $ id , MassiveAction::ACTION_OK );
124+ } else {
125+ $ ma ->itemDone ($ item ->getType (), $ id , MassiveAction::ACTION_NORIGHT );
124126 }
125127 }
126128
@@ -373,7 +375,9 @@ public static function uninstall($type, $model_id, $tab_ids, $location)
373375 $ count ++;
374376 if (class_exists ($ type ) && is_a ($ type , CommonDBTM::class, true )) {
375377 $ item = new $ type ();
376- $ item ->getFromDB ($ id );
378+ if (!$ item ->getFromDB ($ id ) || !$ item ->can ($ id , UPDATE )) {
379+ continue ;
380+ }
377381
378382 self ::doOneUninstall ($ model , $ transfer , $ item , [
379383 'type ' => $ type ,
@@ -476,6 +480,7 @@ public static function deleteComputerInOCS($ocs_id, $ocs_server_id)
476480 global $ DB ;
477481 if (class_exists ('PluginOcsinventoryngOcsServer ' )) {
478482 $ DBocs = PluginOcsinventoryngOcsServer::getDBocs ($ ocs_server_id )->getDB ();
483+ $ ocs_id = (int ) $ ocs_id ;
479484
480485 //First try to remove all the network ports
481486 $ query = "DELETE
0 commit comments