Get IP address from OWIN
This commit is contained in:
@@ -33,12 +33,12 @@ namespace Umbraco.Core.Auditing
|
||||
/// <returns></returns>
|
||||
protected string GetCurrentRequestIpAddress()
|
||||
{
|
||||
var httpContext = HttpContext.Current == null ? (HttpContextBase)null : new HttpContextWrapper(HttpContext.Current);
|
||||
return httpContext.GetCurrentRequestIpAddress();
|
||||
var owinContext = HttpContext.Current.GetOwinContext();
|
||||
return owinContext == null ? string.Empty : owinContext.Request.RemoteIpAddress;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the current request IP address for logging if there is one
|
||||
/// Returns the current logged in backoffice user's Id logging if there is one
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected int GetCurrentRequestBackofficeUserId()
|
||||
|
||||
Reference in New Issue
Block a user