go($sqlRiferimento,[":codice"=>$sourceID]); if ($riferimento->rowCount() > 0) { $idGara = $riferimento->fetch(PDO::FETCH_ASSOC)["codice_gara"]; if ($_SESSION["utente"]->gerarchia < 100) { $tmp = gara::init($idGara); if ($tmp !== false) { $return = true; if (isset($operation) && ($operation == "DELETE" || $operation == "SWITCH") && !empty($allegato)) { $tmp->addToLog($operation,__("Allegato") . " #{$allegato["codice"]}: {$allegato["name"]}"); } } } else if (isset($operation) && $operation == "LIST") { $tmp = publicGara::init($idGara); if ($tmp !== false) { if ($sourceType == "gare-invitati" && $tmp->hasInvito()) { $return = true; } else if (($sourceType == "gare-accessoatti" && $tmp->canAccessAccessoAttiAutomatico()) || ($sourceType == "gare-accessoatti-lotto" && $tmp->canAccessAccessoAttiAutomatico($sourceID))) { $return = true; } } } } } } ?>