[reorg]
This commit is contained in:
7
src/Yavsc.Abstract/Chat/ChatRoomAccessLevel.cs
Normal file
7
src/Yavsc.Abstract/Chat/ChatRoomAccessLevel.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace Yavsc.Abstract.Chat
|
||||
{
|
||||
public enum ChatRoomAccessLevel: int {
|
||||
Op=1,
|
||||
HalfOp=2
|
||||
}
|
||||
}
|
16
src/Yavsc.Abstract/Chat/IChatRoom.cs
Normal file
16
src/Yavsc.Abstract/Chat/IChatRoom.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace Yavsc.Abstract.Chat
|
||||
{
|
||||
public interface IChatRoom<TMod> where TMod : IChatRoomAccess
|
||||
{
|
||||
[RegularExpression(@"^#?[a-zA-Z0-9'-']{3,10}$", ErrorMessage = "chan name cannot be validated.")]
|
||||
string Name { get; }
|
||||
|
||||
[RegularExpression(@"^#?[a-zA-Z0-9'-']{3,10}$", ErrorMessage = "topic cannot be validated.")]
|
||||
string Topic { get ; set; }
|
||||
|
||||
List<TMod> Administration { get; }
|
||||
}
|
||||
}
|
12
src/Yavsc.Abstract/Chat/IChatRoomAccess.cs
Normal file
12
src/Yavsc.Abstract/Chat/IChatRoomAccess.cs
Normal file
@ -0,0 +1,12 @@
|
||||
namespace Yavsc.Abstract.Chat
|
||||
{
|
||||
|
||||
public interface IChatRoomAccess
|
||||
{
|
||||
long Id { get; }
|
||||
|
||||
ChatRoomAccessLevel Level { get; set; }
|
||||
|
||||
string UserId { get; }
|
||||
}
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
namespace Yavsc.Abstract.Streaming
|
||||
namespace Yavsc.Abstract.Chat
|
||||
{
|
||||
public interface IConnection
|
||||
{
|
@ -4,8 +4,9 @@ using System.Reflection;
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyCopyright("Copyright © 2014-2018")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCopyright("Copyright © Paul Schneider 2014-2019")]
|
||||
[assembly: AssemblyTrademark("Yavsc")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: NeutralResourcesLanguage("fr")]
|
||||
|
||||
[assembly: AssemblyVersion("1.0.6.1")]
|
@ -1,8 +0,0 @@
|
||||
namespace Yavsc.Abstract.Streaming
|
||||
{
|
||||
public enum ChatRoomUsageLevel: int {
|
||||
User=0,
|
||||
HalfOp,
|
||||
Op
|
||||
}
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Yavsc.Abstract.Streaming
|
||||
{
|
||||
public interface IChatConnection<T> : IConnection where T: IChatRoomUsage
|
||||
{
|
||||
List<T> Rooms { get; }
|
||||
|
||||
}
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Yavsc.Abstract.Streaming
|
||||
{
|
||||
public interface IChatRoom<TUsage> where TUsage : IChatRoomUsage
|
||||
{
|
||||
string Name { get; set; }
|
||||
string Topic { get ; set; }
|
||||
List<TUsage> UserList { get; }
|
||||
}
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
namespace Yavsc.Abstract.Streaming
|
||||
{
|
||||
|
||||
public interface IChatRoomUsage {
|
||||
|
||||
string ChannelName { get; set; }
|
||||
|
||||
string ChatUserConnectionId { get; set; }
|
||||
|
||||
ChatRoomUsageLevel Level { get; set; }
|
||||
}
|
||||
}
|
@ -26,9 +26,9 @@ using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Chat
|
||||
{
|
||||
public class ChatConnection : Abstract.Streaming.IChatConnection<ChatRoomPresence>
|
||||
public class ChatConnection
|
||||
{
|
||||
[JsonIgnore,Required]
|
||||
[Required]
|
||||
public string ApplicationUserId { get; set; }
|
||||
|
||||
[ForeignKey("ApplicationUserId"),JsonIgnore]
|
||||
|
@ -12,6 +12,12 @@ namespace Yavsc.Models.Relationship
|
||||
[Required()]
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
public string Name { get; set; }
|
||||
public string EMail { get; set; }
|
||||
|
||||
public PostalAddress PostalAddress { get; set; }
|
||||
|
||||
|
||||
[ForeignKeyAttribute("OwnerId"),NotMapped]
|
||||
public virtual ApplicationUser Owner { get; set; }
|
||||
|
||||
|
@ -2,13 +2,8 @@ using Yavsc.Models.Relationship;
|
||||
|
||||
namespace Yavsc
|
||||
{
|
||||
public class Contact
|
||||
public class OupsContact
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public string EMail { get; set; }
|
||||
|
||||
public PostalAddress PostalAddress { get; set; }
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,3 +1,5 @@
|
||||
using Yavsc.Models.Relationship;
|
||||
|
||||
namespace Yavsc
|
||||
{
|
||||
public class SiteSettings
|
||||
|
@ -24,7 +24,7 @@ namespace Yavsc.Controllers
|
||||
[HttpGet]
|
||||
public IEnumerable<HyperLink> GetLinks()
|
||||
{
|
||||
return _context.Links;
|
||||
return _context.HyperLink;
|
||||
}
|
||||
|
||||
// GET: api/HyperLinkApi/5
|
||||
@ -36,7 +36,7 @@ namespace Yavsc.Controllers
|
||||
return HttpBadRequest(ModelState);
|
||||
}
|
||||
|
||||
HyperLink hyperLink = await _context.Links.SingleAsync(m => m.HRef == id);
|
||||
HyperLink hyperLink = await _context.HyperLink.SingleAsync(m => m.HRef == id);
|
||||
|
||||
if (hyperLink == null)
|
||||
{
|
||||
@ -90,7 +90,7 @@ namespace Yavsc.Controllers
|
||||
return HttpBadRequest(ModelState);
|
||||
}
|
||||
|
||||
_context.Links.Add(hyperLink);
|
||||
_context.HyperLink.Add(hyperLink);
|
||||
try
|
||||
{
|
||||
await _context.SaveChangesAsync();
|
||||
@ -119,13 +119,13 @@ namespace Yavsc.Controllers
|
||||
return HttpBadRequest(ModelState);
|
||||
}
|
||||
|
||||
HyperLink hyperLink = await _context.Links.SingleAsync(m => m.HRef == id);
|
||||
HyperLink hyperLink = await _context.HyperLink.SingleAsync(m => m.HRef == id);
|
||||
if (hyperLink == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
_context.Links.Remove(hyperLink);
|
||||
_context.HyperLink.Remove(hyperLink);
|
||||
await _context.SaveChangesAsync();
|
||||
|
||||
return Ok(hyperLink);
|
||||
@ -142,7 +142,7 @@ namespace Yavsc.Controllers
|
||||
|
||||
private bool HyperLinkExists(string id)
|
||||
{
|
||||
return _context.Links.Count(e => e.HRef == id) > 0;
|
||||
return _context.HyperLink.Count(e => e.HRef == id) > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ namespace Yavsc.Controllers
|
||||
[HttpGet]
|
||||
public IEnumerable<MusicalPreference> GetMusicalPreferences()
|
||||
{
|
||||
return _context.MusicalPreferences;
|
||||
return _context.MusicalPreference;
|
||||
}
|
||||
|
||||
// GET: api/MusicalPreferencesApi/5
|
||||
@ -36,7 +36,7 @@ namespace Yavsc.Controllers
|
||||
return HttpBadRequest(ModelState);
|
||||
}
|
||||
|
||||
MusicalPreference musicalPreference = _context.MusicalPreferences.Single(m => m.OwnerProfileId == id);
|
||||
MusicalPreference musicalPreference = _context.MusicalPreference.Single(m => m.OwnerProfileId == id);
|
||||
|
||||
if (musicalPreference == null)
|
||||
{
|
||||
@ -89,7 +89,7 @@ namespace Yavsc.Controllers
|
||||
return HttpBadRequest(ModelState);
|
||||
}
|
||||
|
||||
_context.MusicalPreferences.Add(musicalPreference);
|
||||
_context.MusicalPreference.Add(musicalPreference);
|
||||
try
|
||||
{
|
||||
_context.SaveChanges(User.GetUserId());
|
||||
@ -118,13 +118,13 @@ namespace Yavsc.Controllers
|
||||
return HttpBadRequest(ModelState);
|
||||
}
|
||||
|
||||
MusicalPreference musicalPreference = _context.MusicalPreferences.Single(m => m.OwnerProfileId == id);
|
||||
MusicalPreference musicalPreference = _context.MusicalPreference.Single(m => m.OwnerProfileId == id);
|
||||
if (musicalPreference == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
_context.MusicalPreferences.Remove(musicalPreference);
|
||||
_context.MusicalPreference.Remove(musicalPreference);
|
||||
_context.SaveChanges(User.GetUserId());
|
||||
|
||||
return Ok(musicalPreference);
|
||||
@ -141,7 +141,7 @@ namespace Yavsc.Controllers
|
||||
|
||||
private bool MusicalPreferenceExists(string id)
|
||||
{
|
||||
return _context.MusicalPreferences.Count(e => e.OwnerProfileId == id) > 0;
|
||||
return _context.MusicalPreference.Count(e => e.OwnerProfileId == id) > 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ namespace Yavsc.Controllers
|
||||
[HttpGet]
|
||||
public IEnumerable<CircleAuthorizationToBlogPost> GetBlogACL()
|
||||
{
|
||||
return _context.BlogACL;
|
||||
return _context.CircleAuthorizationToBlogPost;
|
||||
}
|
||||
|
||||
// GET: api/BlogAclApi/5
|
||||
@ -37,7 +37,7 @@ namespace Yavsc.Controllers
|
||||
return HttpBadRequest(ModelState);
|
||||
}
|
||||
var uid = User.GetUserId();
|
||||
CircleAuthorizationToBlogPost circleAuthorizationToBlogPost = await _context.BlogACL.SingleAsync(
|
||||
CircleAuthorizationToBlogPost circleAuthorizationToBlogPost = await _context.CircleAuthorizationToBlogPost.SingleAsync(
|
||||
m => m.CircleId == id && m.Allowed.OwnerId == uid );
|
||||
|
||||
if (circleAuthorizationToBlogPost == null)
|
||||
@ -106,7 +106,7 @@ namespace Yavsc.Controllers
|
||||
{
|
||||
return new ChallengeResult();
|
||||
}
|
||||
_context.BlogACL.Add(circleAuthorizationToBlogPost);
|
||||
_context.CircleAuthorizationToBlogPost.Add(circleAuthorizationToBlogPost);
|
||||
try
|
||||
{
|
||||
await _context.SaveChangesAsync(User.GetUserId());
|
||||
@ -136,7 +136,7 @@ namespace Yavsc.Controllers
|
||||
}
|
||||
var uid = User.GetUserId();
|
||||
|
||||
CircleAuthorizationToBlogPost circleAuthorizationToBlogPost = await _context.BlogACL.Include(
|
||||
CircleAuthorizationToBlogPost circleAuthorizationToBlogPost = await _context.CircleAuthorizationToBlogPost.Include(
|
||||
a=>a.Allowed
|
||||
).SingleAsync(m => m.CircleId == id
|
||||
&& m.Allowed.OwnerId == uid);
|
||||
@ -144,7 +144,7 @@ namespace Yavsc.Controllers
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
_context.BlogACL.Remove(circleAuthorizationToBlogPost);
|
||||
_context.CircleAuthorizationToBlogPost.Remove(circleAuthorizationToBlogPost);
|
||||
await _context.SaveChangesAsync(User.GetUserId());
|
||||
|
||||
return Ok(circleAuthorizationToBlogPost);
|
||||
@ -161,7 +161,7 @@ namespace Yavsc.Controllers
|
||||
|
||||
private bool CircleAuthorizationToBlogPostExists(long id)
|
||||
{
|
||||
return _context.BlogACL.Count(e => e.CircleId == id) > 0;
|
||||
return _context.CircleAuthorizationToBlogPost.Count(e => e.CircleId == id) > 0;
|
||||
}
|
||||
}
|
||||
}
|
@ -25,7 +25,7 @@ namespace Yavsc.Controllers
|
||||
public IEnumerable<ChatUserInfo> GetUserList()
|
||||
{
|
||||
List<ChatUserInfo> result = new List<ChatUserInfo>();
|
||||
var cxsQuery = dbContext.Connections?.Include(c=>c.Owner).GroupBy( c => c.ApplicationUserId );
|
||||
var cxsQuery = dbContext.ChatConnection?.Include(c=>c.Owner).GroupBy( c => c.ApplicationUserId );
|
||||
|
||||
// List<ChatUserInfo> result = new List<ChatUserInfo>();
|
||||
if (cxsQuery!=null)
|
||||
|
@ -25,7 +25,7 @@ namespace Yavsc.AuthorizationHandlers
|
||||
context.Fail();
|
||||
else if (destUserId == uid)
|
||||
context.Succeed(requirement);
|
||||
else if (_dbContext.Banlist.Any(b=>b.TargetId == uid)) context.Fail();
|
||||
else if (_dbContext.Ban.Any(b=>b.TargetId == uid)) context.Fail();
|
||||
else if (_dbContext.BlackListed.Any(b=>b.OwnerId == destUserId && b.UserId == uid)) context.Fail();
|
||||
else context.Succeed(requirement);
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ namespace Yavsc.Controllers
|
||||
// GET: CoWorking
|
||||
public async Task<IActionResult> Index()
|
||||
{
|
||||
var applicationDbContext = _context.WorkflowProviders.Include(c => c.Performer).Include(c => c.WorkingFor);
|
||||
var applicationDbContext = _context.CoWorking.Include(c => c.Performer).Include(c => c.WorkingFor);
|
||||
return View(await applicationDbContext.ToListAsync());
|
||||
}
|
||||
|
||||
@ -33,7 +33,7 @@ namespace Yavsc.Controllers
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
CoWorking coWorking = await _context.WorkflowProviders.SingleAsync(m => m.Id == id);
|
||||
CoWorking coWorking = await _context.CoWorking.SingleAsync(m => m.Id == id);
|
||||
if (coWorking == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
@ -57,7 +57,7 @@ namespace Yavsc.Controllers
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.WorkflowProviders.Add(coWorking);
|
||||
_context.CoWorking.Add(coWorking);
|
||||
await _context.SaveChangesAsync(User.GetUserId());
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
@ -74,7 +74,7 @@ namespace Yavsc.Controllers
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
CoWorking coWorking = await _context.WorkflowProviders.SingleAsync(m => m.Id == id);
|
||||
CoWorking coWorking = await _context.CoWorking.SingleAsync(m => m.Id == id);
|
||||
if (coWorking == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
@ -109,7 +109,7 @@ namespace Yavsc.Controllers
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
CoWorking coWorking = await _context.WorkflowProviders.SingleAsync(m => m.Id == id);
|
||||
CoWorking coWorking = await _context.CoWorking.SingleAsync(m => m.Id == id);
|
||||
if (coWorking == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
@ -123,8 +123,8 @@ namespace Yavsc.Controllers
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> DeleteConfirmed(long id)
|
||||
{
|
||||
CoWorking coWorking = await _context.WorkflowProviders.SingleAsync(m => m.Id == id);
|
||||
_context.WorkflowProviders.Remove(coWorking);
|
||||
CoWorking coWorking = await _context.CoWorking.SingleAsync(m => m.Id == id);
|
||||
_context.CoWorking.Remove(coWorking);
|
||||
await _context.SaveChangesAsync(User.GetUserId());
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ namespace Yavsc.Controllers
|
||||
// GET: HyperLink
|
||||
public async Task<IActionResult> Index()
|
||||
{
|
||||
return View(await _context.Links.ToListAsync());
|
||||
return View(await _context.HyperLink.ToListAsync());
|
||||
}
|
||||
|
||||
// GET: HyperLink/Details/5
|
||||
@ -29,7 +29,7 @@ namespace Yavsc.Controllers
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
HyperLink hyperLink = await _context.Links.SingleAsync(m => m.HRef == id);
|
||||
HyperLink hyperLink = await _context.HyperLink.SingleAsync(m => m.HRef == id);
|
||||
if (hyperLink == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
@ -51,7 +51,7 @@ namespace Yavsc.Controllers
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.Links.Add(hyperLink);
|
||||
_context.HyperLink.Add(hyperLink);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
@ -66,7 +66,7 @@ namespace Yavsc.Controllers
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
HyperLink hyperLink = await _context.Links.SingleAsync(m => m.HRef == id);
|
||||
HyperLink hyperLink = await _context.HyperLink.SingleAsync(m => m.HRef == id);
|
||||
if (hyperLink == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
@ -97,7 +97,7 @@ namespace Yavsc.Controllers
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
HyperLink hyperLink = await _context.Links.SingleAsync(m => m.HRef == id);
|
||||
HyperLink hyperLink = await _context.HyperLink.SingleAsync(m => m.HRef == id);
|
||||
if (hyperLink == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
@ -111,8 +111,8 @@ namespace Yavsc.Controllers
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> DeleteConfirmed(string id)
|
||||
{
|
||||
HyperLink hyperLink = await _context.Links.SingleAsync(m => m.HRef == id);
|
||||
_context.Links.Remove(hyperLink);
|
||||
HyperLink hyperLink = await _context.HyperLink.SingleAsync(m => m.HRef == id);
|
||||
_context.HyperLink.Remove(hyperLink);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ namespace Yavsc.Controllers
|
||||
// GET: Project
|
||||
public async Task<IActionResult> Index()
|
||||
{
|
||||
var applicationDbContext = _context.Projects.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.Regularisation).Include(p => p.Repository);
|
||||
return View(await applicationDbContext.ToListAsync());
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ namespace Yavsc.Controllers
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
Project project = await _context.Projects.SingleAsync(m => m.Id == id);
|
||||
Project project = await _context.Project.SingleAsync(m => m.Id == id);
|
||||
if (project == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
@ -66,7 +66,7 @@ namespace Yavsc.Controllers
|
||||
ViewBag.ActivityCodeItems = _context.Activities.CreateSelectListItems<Activity>(
|
||||
a => a.Code, a => a.Name);
|
||||
ViewBag.PerformerIdItems = _context.Performers.Include(p=>p.Performer).CreateSelectListItems<PerformerProfile>(p => p.PerformerId, p => p.Performer.UserName);
|
||||
ViewBag.PaymentIdItems = _context.PayPalPayments.CreateSelectListItems<PayPalPayment>
|
||||
ViewBag.PaymentIdItems = _context.PayPalPayment.CreateSelectListItems<PayPalPayment>
|
||||
(p => p.OrderReference, p => $"{p.Executor.UserName} {p.PaypalPayerId} {p.OrderReference}");
|
||||
|
||||
ViewBag.Status = typeof(Yavsc.QueryStatus).CreateSelectListItems(null);
|
||||
@ -83,7 +83,7 @@ namespace Yavsc.Controllers
|
||||
{
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.Projects.Add(project);
|
||||
_context.Project.Add(project);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
@ -94,7 +94,7 @@ namespace Yavsc.Controllers
|
||||
ViewBag.ActivityCodeItems = _context.Activities.CreateSelectListItems<Activity>(
|
||||
a => a.Code, a => a.Name, project.ActivityCode);
|
||||
ViewBag.PerformerIdItems = _context.Performers.Include(p=>p.Performer).CreateSelectListItems<PerformerProfile>(p => p.PerformerId, p => p.Performer.UserName, project.PerformerId);
|
||||
ViewBag.PaymentIdItems = _context.PayPalPayments.CreateSelectListItems<PayPalPayment>
|
||||
ViewBag.PaymentIdItems = _context.PayPalPayment.CreateSelectListItems<PayPalPayment>
|
||||
(p => p.OrderReference, p => $"{p.Executor.UserName} {p.PaypalPayerId} {p.OrderReference}", project.PaymentId);
|
||||
return View(project);
|
||||
}
|
||||
@ -107,7 +107,7 @@ namespace Yavsc.Controllers
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
Project project = await _context.Projects.SingleAsync(m => m.Id == id);
|
||||
Project project = await _context.Project.SingleAsync(m => m.Id == id);
|
||||
if (project == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
@ -146,7 +146,7 @@ namespace Yavsc.Controllers
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
Project project = await _context.Projects.SingleAsync(m => m.Id == id);
|
||||
Project project = await _context.Project.SingleAsync(m => m.Id == id);
|
||||
if (project == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
@ -160,8 +160,8 @@ namespace Yavsc.Controllers
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> DeleteConfirmed(long id)
|
||||
{
|
||||
Project project = await _context.Projects.SingleAsync(m => m.Id == id);
|
||||
_context.Projects.Remove(project);
|
||||
Project project = await _context.Project.SingleAsync(m => m.Id == id);
|
||||
_context.Project.Remove(project);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
|
@ -134,7 +134,7 @@ namespace Yavsc.Helpers
|
||||
string token)
|
||||
{
|
||||
var details = GetExpressCheckoutDetails(token);
|
||||
var payment = await context.PayPalPayments.SingleOrDefaultAsync(p=>p.CreationToken == token);
|
||||
var payment = await context.PayPalPayment.SingleOrDefaultAsync(p=>p.CreationToken == token);
|
||||
if (payment == null)
|
||||
{
|
||||
payment = new PayPalPayment{
|
||||
@ -146,7 +146,7 @@ namespace Yavsc.Helpers
|
||||
State = details.Ack.ToString()
|
||||
};
|
||||
|
||||
context.PayPalPayments.Add(payment);
|
||||
context.PayPalPayment.Add(payment);
|
||||
}
|
||||
else {
|
||||
payment.ExecutorId = userId;
|
||||
@ -162,7 +162,7 @@ namespace Yavsc.Helpers
|
||||
string token, GetExpressCheckoutDetailsResponseType fromPayPal)
|
||||
{
|
||||
return new PaymentInfo {
|
||||
DbContent = await context.PayPalPayments
|
||||
DbContent = await context.PayPalPayment
|
||||
.Include(p=>p.Executor)
|
||||
.SingleOrDefaultAsync(
|
||||
p=>p.CreationToken==token),
|
||||
|
@ -95,7 +95,7 @@ namespace Yavsc
|
||||
if (userName != null)
|
||||
{
|
||||
using (var db = new ApplicationDbContext()) {
|
||||
var cx = db.Connections.SingleOrDefault(c => c.ConnectionId == Context.ConnectionId);
|
||||
var cx = db.ChatConnection.SingleOrDefault(c => c.ConnectionId == Context.ConnectionId);
|
||||
if (cx != null)
|
||||
{
|
||||
if (stopCalled)
|
||||
@ -179,7 +179,7 @@ namespace Yavsc
|
||||
string senderId = (await _dbContext.ChatConnection.SingleAsync (c=>c.ConnectionId == Context.ConnectionId)).ApplicationUserId;
|
||||
|
||||
|
||||
if (_dbContext.Banlist.Any(b=>b.TargetId == senderId)) return false;
|
||||
if (_dbContext.Ban.Any(b=>b.TargetId == senderId)) return false;
|
||||
var destChatUser = await _dbContext.ChatConnection.SingleAsync (c=>c.ConnectionId == destConnectionId);
|
||||
|
||||
if (_dbContext.BlackListed.Any(b=>b.OwnerId == destChatUser.ApplicationUserId && b.UserId == senderId)) return false;
|
||||
@ -200,9 +200,9 @@ namespace Yavsc
|
||||
|
||||
public void Abort()
|
||||
{
|
||||
var cx = _dbContext .Connections.SingleOrDefault(c=>c.ConnectionId == Context.ConnectionId);
|
||||
var cx = _dbContext .ChatConnection.SingleOrDefault(c=>c.ConnectionId == Context.ConnectionId);
|
||||
if (cx!=null) {
|
||||
_dbContext.Connections.Remove(cx);
|
||||
_dbContext.ChatConnection.Remove(cx);
|
||||
_dbContext.SaveChanges();
|
||||
}
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ namespace Yavsc.Models
|
||||
// Customize the ASP.NET Identity model and override the defaults if needed.
|
||||
// For example, you can rename the ASP.NET Identity table names and more.
|
||||
// Add your customizations after calling base.OnModelCreating(builder);
|
||||
builder.Entity<Relationship.Contact>().HasKey(x => new { x.OwnerId, x.UserId });
|
||||
builder.Entity<Contact>().HasKey(x => new { x.OwnerId, x.UserId });
|
||||
builder.Entity<GoogleCloudMobileDeclaration>().Property(x => x.DeclarationDate).HasDefaultValueSql("LOCALTIMESTAMP");
|
||||
builder.Entity<BlogTag>().HasKey(x => new { x.PostId, x.TagId });
|
||||
builder.Entity<ApplicationUser>().HasMany<ChatConnection>(c => c.Connections);
|
||||
@ -157,15 +157,13 @@ namespace Yavsc.Models
|
||||
|
||||
public DbSet<EstimateTemplate> EstimateTemplates { get; set; }
|
||||
|
||||
public DbSet<Relationship.Contact> Contacts { get; set; }
|
||||
public DbSet<Contact> Contacts { get; set; }
|
||||
|
||||
public DbSet<ClientProviderInfo> ClientProviderInfo { get; set; }
|
||||
|
||||
public DbSet<ChatConnection> Connections { get; set; }
|
||||
|
||||
public DbSet<BlackListed> BlackListed { get; set; }
|
||||
|
||||
public DbSet<MusicalPreference> MusicalPreferences { get; set; }
|
||||
public DbSet<MusicalPreference> MusicalPreference { get; set; }
|
||||
|
||||
public DbSet<MusicalTendency> MusicalTendency { get; set; }
|
||||
|
||||
@ -182,7 +180,7 @@ namespace Yavsc.Models
|
||||
|
||||
[ActivitySettings]
|
||||
public DbSet<GeneralSettings> GeneralSettings { get; set; }
|
||||
public DbSet<CoWorking> WorkflowProviders { get; set; }
|
||||
public DbSet<CoWorking> CoWorking { get; set; }
|
||||
|
||||
private void AddTimestamps(string currentUsername)
|
||||
{
|
||||
@ -218,13 +216,13 @@ namespace Yavsc.Models
|
||||
|
||||
public DbSet<Circle> Circle { get; set; }
|
||||
|
||||
public DbSet<CircleAuthorizationToBlogPost> BlogACL { get; set; }
|
||||
public DbSet<CircleAuthorizationToBlogPost> CircleAuthorizationToBlogPost { get; set; }
|
||||
|
||||
public DbSet<CommandForm> CommandForm { get; set; }
|
||||
|
||||
public DbSet<Form> Form { get; set; }
|
||||
|
||||
public DbSet<Ban> Banlist { get; set; }
|
||||
public DbSet<Ban> Ban { get; set; }
|
||||
|
||||
public DbSet<HairTaint> HairTaint { get; set; }
|
||||
|
||||
@ -240,13 +238,13 @@ namespace Yavsc.Models
|
||||
|
||||
public DbSet<BankIdentity> BankIdentity { get; set; }
|
||||
|
||||
public DbSet<PayPalPayment> PayPalPayments { get; set; }
|
||||
public DbSet<PayPalPayment> PayPalPayment { get; set; }
|
||||
|
||||
public DbSet<HyperLink> Links { get; set; }
|
||||
public DbSet<HyperLink> HyperLink { get; set; }
|
||||
|
||||
public DbSet<Period> Period { get; set; }
|
||||
|
||||
public DbSet<BlogTag> BlogTags { get; set; }
|
||||
public DbSet<BlogTag> BlogTag { get; set; }
|
||||
|
||||
public DbSet<ApplicationUser> ApplicationUser { get; set; }
|
||||
|
||||
@ -266,7 +264,7 @@ namespace Yavsc.Models
|
||||
|
||||
public DbSet<GitRepositoryReference> GitRepositoryReference { get; set; }
|
||||
|
||||
public DbSet<Project> Projects { get; set; }
|
||||
public DbSet<Project> Project { get; set; }
|
||||
|
||||
public DbSet<BlogTrad> BlogTrad { get; set; }
|
||||
|
||||
|
@ -91,10 +91,11 @@ namespace Yavsc {
|
||||
SiteSettings settingsOptions, ILogger logger) {
|
||||
|
||||
app.UseIdentity ();
|
||||
app.UseWhen (context => context.Request.Path.StartsWithSegments ("/api")
|
||||
|| context.Request.Path.StartsWithSegments ("/live"),
|
||||
branch => {
|
||||
branch.UseJwtBearerAuthentication (
|
||||
app.UseWhen ( context => context.Request.Path.StartsWithSegments ("/api")
|
||||
|| context.Request.Path.StartsWithSegments ("/live") ,
|
||||
branchLiveOrApi =>
|
||||
{
|
||||
branchLiveOrApi.UseJwtBearerAuthentication (
|
||||
options => {
|
||||
options.AuthenticationScheme = JwtBearerDefaults.AuthenticationScheme;
|
||||
options.AutomaticAuthenticate = true;
|
||||
@ -104,8 +105,9 @@ namespace Yavsc {
|
||||
));
|
||||
options.Events = new JwtBearerEvents
|
||||
{
|
||||
OnReceivingToken = async context =>
|
||||
OnReceivingToken = context =>
|
||||
{
|
||||
return Task.Run( () => {
|
||||
var signalRTokenHeader = context.Request.Query["signalRTokenHeader"];
|
||||
|
||||
if (!string.IsNullOrEmpty(signalRTokenHeader) &&
|
||||
@ -113,11 +115,10 @@ namespace Yavsc {
|
||||
{
|
||||
context.Token = context.Request.Query["signalRTokenHeader"];
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
};
|
||||
});
|
||||
});
|
||||
app.UseWhen (context => !context.Request.Path.StartsWithSegments ("/api") && !context.Request.Path.StartsWithSegments ("/live"),
|
||||
branch => {
|
||||
|
Reference in New Issue
Block a user