Browse Source

Fixed pass checking for simple, raw, and download

pull/29/head
Teknikode 7 years ago
parent
commit
4b6f81153b
  1. 2
      Teknik/Areas/Paste/Controllers/PasteController.cs
  2. 2
      Teknik/Areas/Paste/ViewModels/PasswordViewModel.cs
  3. 3
      Teknik/Areas/Paste/Views/Paste/PasswordNeeded.cshtml

2
Teknik/Areas/Paste/Controllers/PasteController.cs

@ -63,7 +63,7 @@ namespace Teknik.Areas.Paste.Controllers @@ -63,7 +63,7 @@ namespace Teknik.Areas.Paste.Controllers
{
PasswordViewModel passModel = new PasswordViewModel();
passModel.Url = url;
passModel.CallingAction = Url.SubRouteUrl("paste", "Paste.View", new { type = type });
passModel.Type = type;
// Redirect them to the password request page
return View("~/Areas/Paste/Views/Paste/PasswordNeeded.cshtml", passModel);
}

2
Teknik/Areas/Paste/ViewModels/PasswordViewModel.cs

@ -11,6 +11,6 @@ namespace Teknik.Areas.Paste.ViewModels @@ -11,6 +11,6 @@ namespace Teknik.Areas.Paste.ViewModels
{
public string Url { get; set; }
public string CallingAction { get; set; }
public string Type { get; set; }
}
}

3
Teknik/Areas/Paste/Views/Paste/PasswordNeeded.cshtml

@ -3,8 +3,9 @@ @@ -3,8 +3,9 @@
<div class="container">
<div class="row text-center">
<div class="col-sm-6 col-sm-offset-3">
<form class="form-inline" method="post" action="@Model.CallingAction">
<form class="form-inline" method="post" action="@Url.SubRouteUrl("paste", "Paste.View")">
<h3><span class="glyphicon glyphicon-warning-sign"></span> This paste is password protected.</h3>
<input type="hidden" name="type" value="@Model.Type">
<input type="hidden" name="url" value="@Model.Url">
<div class="well no-padding">
<div class="form-group">

Loading…
Cancel
Save