Identity reloaded

This commit is contained in:
Paul Schneider 2026-07-05 23:56:10 +01:00
commit 333b066e66
33 changed files with 195 additions and 180 deletions

View file

@ -17,7 +17,7 @@ namespace Yavsc.Controllers
// GET: GeneralSettings
public async Task<IActionResult> Index()
{
return View(await _context.GeneralSettings.ToListAsync());
return View(await _context.MusicLoverSettings.ToListAsync());
}
// GET: GeneralSettings/Details/5
@ -28,7 +28,7 @@ namespace Yavsc.Controllers
return NotFound();
}
MusicLoverSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id);
MusicLoverSettings generalSettings = await _context.MusicLoverSettings.SingleAsync(m => m.UserId == id);
if (generalSettings == null)
{
return NotFound();
@ -50,7 +50,7 @@ namespace Yavsc.Controllers
{
if (ModelState.IsValid)
{
_context.GeneralSettings.Add(generalSettings);
_context.MusicLoverSettings.Add(generalSettings);
await _context.SaveChangesAsync();
return RedirectToAction("Index");
}
@ -65,7 +65,7 @@ namespace Yavsc.Controllers
return NotFound();
}
MusicLoverSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id);
MusicLoverSettings generalSettings = await _context.MusicLoverSettings.SingleAsync(m => m.UserId == id);
if (generalSettings == null)
{
return NotFound();
@ -96,7 +96,7 @@ namespace Yavsc.Controllers
return NotFound();
}
MusicLoverSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id);
MusicLoverSettings generalSettings = await _context.MusicLoverSettings.SingleAsync(m => m.UserId == id);
if (generalSettings == null)
{
return NotFound();
@ -110,8 +110,8 @@ namespace Yavsc.Controllers
[ValidateAntiForgeryToken]
public async Task<IActionResult> DeleteConfirmed(string id)
{
MusicLoverSettings generalSettings = await _context.GeneralSettings.SingleAsync(m => m.UserId == id);
_context.GeneralSettings.Remove(generalSettings);
MusicLoverSettings generalSettings = await _context.MusicLoverSettings.SingleAsync(m => m.UserId == id);
_context.MusicLoverSettings.Remove(generalSettings);
await _context.SaveChangesAsync();
return RedirectToAction("Index");
}

View file

@ -49,7 +49,7 @@ namespace Yavsc.Controllers
this.haircutLocalizer = haircutLocalizer;
}
private async Task<HairCutQuery> GetQuery(long id)
{
var query = await _context.HairCutQueries
@ -58,7 +58,7 @@ namespace Yavsc.Controllers
.Include(x => x.Prestation)
.Include(x => x.PerformerProfile.Performer)
.Include(x => x.PerformerProfile.Performer.DeviceDeclaration)
.Include(x => x.Regularisation)
.Include(x => x.Regularization)
.SingleAsync(m => m.Id == id);
query.SelectedProfile = await _context.BrusherProfile.SingleAsync(b => b.UserId == query.PerformerId);
return query;
@ -82,11 +82,11 @@ namespace Yavsc.Controllers
}
var paymentInfo = await _context.ConfirmPayment(User.GetUserId(), PayerID, token);
ViewBag.paymentinfo = paymentInfo;
command.Regularisation = paymentInfo.DbContent;
command.Regularization = paymentInfo.DbContent;
command.PaymentId = token;
bool paymentOk = false;
if (paymentInfo.DetailsFromPayPal != null)
if (paymentInfo.DetailsFromPayPal.Ack == AckCodeType.SUCCESS)
if (paymentInfo.DetailsFromPayPal.Ack == AckCodeType.SUCCESS)
{
// FIXME Assert (command.ValidationDate == null)
if (command.ValidationDate == null) {
@ -174,7 +174,7 @@ namespace Yavsc.Controllers
.Include(x => x.PerformerProfile)
.Include(x => x.Prestation)
.Include(x => x.PerformerProfile.Performer)
.Include(x => x.Regularisation)
.Include(x => x.Regularization)
.SingleOrDefaultAsync(m => m.Id == id);
if (command == null)
{
@ -224,7 +224,7 @@ namespace Yavsc.Controllers
.FirstOrDefault(
x => x.PerformerId == model.PerformerId
);
if (taintIds != null)
{

View file

@ -18,7 +18,7 @@ namespace Yavsc.Controllers
private readonly ApplicationDbContext _context;
readonly IStringLocalizer<ProjectController> _localizer;
readonly IStringLocalizer<BugController> _bugLocalizer;
public ProjectController(ApplicationDbContext context,
IStringLocalizer<ProjectController> localizer,
IStringLocalizer<BugController> bugLocalizer
@ -32,7 +32,7 @@ namespace Yavsc.Controllers
// GET: Project
public async Task<IActionResult> Index()
{
var applicationDbContext = _context.Project.Include(p => p.Client).Include(p => p.Context).Include(p => p.PerformerProfile).Include(p => p.Regularisation).Include(p => p.Repository);
var applicationDbContext = _context.Project.Include(p => p.Client).Include(p => p.Context).Include(p => p.PerformerProfile).Include(p => p.Regularization).Include(p => p.Repository);
return View(await applicationDbContext.ToListAsync());
}

View file

@ -4,14 +4,14 @@
<!-- Yavsc.Org-specific versions -->
<ItemGroup>
<PackageVersion Include="AsciiDocSharp" Version="0.2.0" />
<PackageVersion Include="AsciiDocSharp.Converters.Html" Version="0.2.0" />
<PackageVersion Include="AsciiDocSharp" Version="0.1.0" />
<PackageVersion Include="AsciiDocSharp.Converters.Html" Version="0.1.0" />
<PackageVersion Include="BouncyCastle.Cryptography" Version="2.6.2" />
<PackageVersion Include="Google.Apis.Compute.v1" Version="1.74.0.4138" />
<PackageVersion Include="HigginsSoft.IdentityServer8.AspNetIdentity" Version="8.0.5-preview-net9" />
<PackageVersion Include="HigginsSoft.IdentityServer8.EntityFramework.Storage" Version="8.0.5-preview-net9" />
<PackageVersion Include="HigginsSoft.IdentityServer8.Security" Version="8.0.5-preview-net9" />
<PackageVersion Include="HigginsSoft.IdentityServer8.Storage" Version="8.0.5-preview-net9" />
<PackageVersion Include="HigginsSoft.IdentityServer8.AspNetIdentity" Version="8.1.0-alpha.171" />
<PackageVersion Include="HigginsSoft.IdentityServer8.EntityFramework.Storage" Version="8.1.0-alpha.171" />
<PackageVersion Include="HigginsSoft.IdentityServer8.Security" Version="8.1.0-alpha.171" />
<PackageVersion Include="HigginsSoft.IdentityServer8.Storage" Version="8.1.0-alpha.171" />
<PackageVersion Include="Microsoft.AspNetCore.Antiforgery" Version="2.3.11" />
<PackageVersion Include="Microsoft.AspNetCore.Authentication.Google" Version="10.0.9" />
<PackageVersion Include="Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore" Version="10.0.9" />

View file

@ -17,11 +17,11 @@ namespace Yavsc.Helpers
{
Sender = query.ClientId,
Reason = query.Reason,
Client = new ClientProviderInfo { 
Client = new ClientProviderInfo {
UserName = query.Client.UserName ,
UserId = query.ClientId,
Avatar = query.Client.Avatar } ,
Previsional = query.Previsional,
Previsional = query.Provisional,
EventDate = query.EventDate,
Location = query.Location,
Id = query.Id,
@ -44,7 +44,7 @@ namespace Yavsc.Helpers
var yaev = query.CreateEvent("NewHairCutQuery",
string.Format(SR["HairCutQueryValidation"],query.Client.UserName),
$"{query.Client.Id}");
return yaev;
}
@ -58,12 +58,12 @@ namespace Yavsc.Helpers
var yaev = new HairCutQueryEvent("newCommand")
{
Sender = query.ClientId,
Client = new ClientProviderInfo { 
Client = new ClientProviderInfo {
UserName = query.Client.UserName ,
UserId = query.ClientId,
Avatar = query.Client.Avatar } ,
Previsional = query.Previsional,
Previsional = query.Provisional,
EventDate = query.EventDate,
Location = query.Location,
Id = query.Id,

View file

@ -54,7 +54,7 @@
<dt> @Html.DisplayNameFor(m => m.Location)
</dt>
<dd>@if (Model.Location == null) {
<p>Pas de lieu convenu ...</p>
<p>Pas de lieu convenu ...</p>
} else {
<label for="Location">Location</label>
@Html.DisplayFor(m => m.Location)
@ -62,7 +62,7 @@
</dd>
<dt>Notification
</dt>
<dd>@if (ViewBag.GooglePayload !=null)
<dd>@if (ViewBag.GooglePayload !=null)
{
@if (ViewBag.GooglePayload.success>0) {
<h4>GCM Notifications sent</h4>
@ -85,10 +85,10 @@
</dt>
<dd>@await Component.InvokeAsync("Bill", Model)
</dd>
<dt>@Html.DisplayNameFor(m=>m.Regularisation)</dt>
<dt>@Html.DisplayNameFor(m=>m.Regularization)</dt>
<dd> @await Component.InvokeAsync("PayPalButton", Model)
</dd>
</dl>
</div>

View file

@ -21,9 +21,9 @@
<div class="form-group">
<label asp-for="ActivityCode" class="col-md-2 control-label"></label>
<div class="col-md-10">
<select asp-for="ActivityCode" class ="form-control" asp-items="@ViewBag.ActivityCodeItems" ></select>
<select asp-for="ActivityCode" class ="form-control" asp-items="@ViewBag.ActivityCodeItems" ></select>
</div>
</div>
</div>
<div class="form-group">
<label asp-for="ClientId" class="col-md-2 control-label"></label>
<div class="col-md-10">
@ -57,12 +57,12 @@
<div class="col-md-10">
<select asp-for="PerformerId" class ="form-control" asp-items="@ViewBag.PerformerIdItems"></select>
</div>
</div>
</div>
<div class="form-group">
<label asp-for="Previsional" class="col-md-2 control-label"></label>
<label asp-for="Provisional" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="Previsional" class="form-control" />
<span asp-validation-for="Previsional" class="text-danger" ></span>
<input asp-for="Provisional" class="form-control" />
<span asp-validation-for="Provisional" class="text-danger" ></span>
</div>
</div>
<div class="form-group">

View file

@ -48,10 +48,10 @@
@Html.DisplayFor(model => model.OwnerId)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Previsional)
@Html.DisplayNameFor(model => model.Provisional)
</dt>
<dd>
@Html.DisplayFor(model => model.Previsional)
@Html.DisplayFor(model => model.Provisional)
</dd>
<dt>
@Html.DisplayNameFor(model => model.DateModified)

View file

@ -53,10 +53,10 @@
@Html.DisplayFor(model => model.OwnerId)
</dd>
<dt>
@Html.DisplayNameFor(model => model.Previsional)
@Html.DisplayNameFor(model => model.Provisional)
</dt>
<dd>
@Html.DisplayFor(model => model.Previsional)
@Html.DisplayFor(model => model.Provisional)
</dd>
<dt>
@Html.DisplayNameFor(model => model.DateModified)

View file

@ -36,10 +36,10 @@
</div>
</div>
<div class="form-group">
<label asp-for="Previsional" class="col-md-2 control-label">Prévisionel</label>
<label asp-for="Provisional" class="col-md-2 control-label">Prévisionel</label>
<div class="col-md-10">
<input asp-for="Previsional" class="form-control" />
<span asp-validation-for="Previsional" class="text-danger" ></span>
<input asp-for="Provisional" class="form-control" />
<span asp-validation-for="Provisional" class="text-danger" ></span>
</div>
</div>
<div class="form-group">

View file

@ -30,7 +30,7 @@
@Html.DisplayNameFor(model => model.OwnerId)
</th>
<th>
@Html.DisplayNameFor(model => model.Previsional)
@Html.DisplayNameFor(model => model.Provisional)
</th>
<th>
@Html.DisplayNameFor(model => model.DateModified)
@ -74,7 +74,7 @@
@Html.DisplayFor(modelItem => item.OwnerId)
</td>
<td>
@Html.DisplayFor(modelItem => item.Previsional)
@Html.DisplayFor(modelItem => item.Provisional)
</td>
<td>
@Html.DisplayFor(modelItem => item.DateModified)

View file

@ -1,25 +1,25 @@
@model NominativeServiceCommand
@if (Model!=null && Model.PaymentId!=null) {
@if (Model.Regularisation.Executor.Id == User.GetUserId()) {
@if (Model.Regularization.Executor.Id == User.GetUserId()) {
<text>
Votre paiment
</text>
} else {
<text>
Le paiment de @Html.DisplayFor(m=>m.Regularisation.Executor.UserName)
Le paiment de @Html.DisplayFor(m=>m.Regularization.Executor.UserName)
</text>
}
<text> :
<text> :
</text>
<label>@Model.GetIsAcquitted()
<input type="checkbox" checked="@Model.GetIsAcquitted()" disabled/>
<a asp-controller="Manage" asp-action="PaymentInfo" asp-route-id="@Model.Regularisation.CreationToken">@Model.Regularisation.CreationToken</a>
<input type="checkbox" checked="@Model.GetIsAcquitted()" disabled/>
<a asp-controller="Manage" asp-action="PaymentInfo" asp-route-id="@Model.Regularization.CreationToken">@Model.Regularization.CreationToken</a>
</label>
}
}
@if (!Model.GetIsAcquitted()) {
<div id="paypalzone"></div>

View file

@ -24,8 +24,8 @@
</dt>
<dd>@await Component.InvokeAsync("Bill", Model)
</dd>
<dt>@Html.DisplayNameFor(m=>m.Regularisation)</dt>
<dd>
<dt>@Html.DisplayNameFor(m=>m.Regularization)</dt>
<dd>
@await Component.InvokeAsync("PayPalButton", Model)
</dd>
</dl>