Do not allow editing ATA IDENTIFY responses.

This commit is contained in:
2019-11-08 01:16:20 +00:00
parent 0ff7684370
commit 86ae22c42f
3 changed files with 1 additions and 107 deletions

View File

@@ -67,57 +67,6 @@ namespace DiscImageChef.Server.Areas.Admin.Controllers
return View(ata);
}
// GET: Admin/Atas/Edit/5
public async Task<IActionResult> Edit(int? id)
{
if (id == null)
{
return NotFound();
}
var ata = await _context.Ata.FindAsync(id);
if (ata == null)
{
return NotFound();
}
return View(ata);
}
// POST: Admin/Atas/Edit/5
// To protect from overposting attacks, please enable the specific properties you want to bind to, for
// more details see http://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost]
[ValidateAntiForgeryToken]
public async Task<IActionResult> Edit(int id, [Bind("Id,Identify")] DiscImageChef.CommonTypes.Metadata.Ata ata)
{
if (id != ata.Id)
{
return NotFound();
}
if (ModelState.IsValid)
{
try
{
_context.Update(ata);
await _context.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException)
{
if (!AtaExists(ata.Id))
{
return NotFound();
}
else
{
throw;
}
}
return RedirectToAction(nameof(Index));
}
return View(ata);
}
// GET: Admin/Atas/Delete/5
public async Task<IActionResult> Delete(int? id)
{

View File

@@ -1,54 +0,0 @@
@model DiscImageChef.CommonTypes.Metadata.Ata
@{
Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
ViewBag.Title = "DiscImageChef";
}
@{
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : Edit.cshtml
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef Server.
//
// --[ License ] --------------------------------------------------------------
//
// This library is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 2.1 of the
// License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2019 Natalia Portillo
// ****************************************************************************/
}
<h4>Ata</h4>
<hr />
<div class="row">
<div class="col-md-4">
<form asp-action="Edit">
<div asp-validation-summary="ModelOnly" class="text-danger"></div>
<input type="hidden" asp-for="Id" />
<div class="form-group">
<label asp-for="Identify" class="control-label"></label>
<input asp-for="Identify" class="form-control" />
<span asp-validation-for="Identify" class="text-danger"></span>
</div>
<div class="form-group">
<input type="submit" value="Save" class="btn btn-primary" />
<a asp-action="Index" class="btn btn-secondary">Back to List</a>
</div>
</form>
</div>
</div>

View File

@@ -52,9 +52,8 @@ ATA IDENTIFY DEVICE responses
</td>
<td>
<a asp-action="Details" asp-route-id="@item.Id" class="btn btn-primary">Details</a>
<a asp-action="Edit" asp-route-id="@item.Id" class="btn btn-secondary">Edit</a>
<a asp-action="Delete" asp-route-id="@item.Id" class="btn btn-danger">Delete</a>
</td>
</td>
</tr>
}
</tbody>