Skip to content

Commit

Permalink
Merge pull request #516 from ONLYOFFICE/bugfix/U2U1100
Browse files Browse the repository at this point in the history
Bugfix/u2u1100
  • Loading branch information
pavelbannov authored Feb 9, 2022
2 parents b1be995 + 147377a commit b6d98a8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions common/ASC.Core.Common/Context/Impl/CoreConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,14 @@ public bool Personal
get
{
//TODO:if (CustomMode && HttpContext.Current != null && HttpContext.Current.Request.SailfishApp()) return true;
return personal ?? (bool)(personal = Configuration["core:personal"].Equals("true", StringComparison.OrdinalIgnoreCase));
return personal ?? (bool)(personal = string.Equals(Configuration["core:personal"], "true", StringComparison.OrdinalIgnoreCase));
}
}

public bool CustomMode
{
get { return customMode ?? (bool)(customMode = Configuration["core:custom-mode"].Equals("true", StringComparison.OrdinalIgnoreCase)); }
get { return customMode ?? (bool)(customMode = string.Equals(Configuration["core:custom-mode"], "true", StringComparison.OrdinalIgnoreCase));}

}
}

Expand Down
4 changes: 2 additions & 2 deletions common/ASC.Core.Common/Context/Impl/UserManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,13 @@ public UserInfo GetUserByUserName(string username)
public UserInfo GetUserBySid(string sid)
{
return GetUsersInternal()
.FirstOrDefault(u => u.Sid != null && u.Sid.Equals(sid, StringComparison.CurrentCultureIgnoreCase)) ?? Constants.LostUser;
.FirstOrDefault(u => u.Sid != null && string.Equals(u.Sid , sid, StringComparison.CurrentCultureIgnoreCase)) ?? Constants.LostUser;
}

public UserInfo GetSsoUserByNameId(string nameId)
{
return GetUsersInternal()
.FirstOrDefault(u => !string.IsNullOrEmpty(u.SsoNameId) && u.SsoNameId.Equals(nameId, StringComparison.CurrentCultureIgnoreCase)) ?? Constants.LostUser;
.FirstOrDefault(u => !string.IsNullOrEmpty(u.SsoNameId) && string.Equals(u.SsoNameId, nameId, StringComparison.CurrentCultureIgnoreCase)) ?? Constants.LostUser;
}
public bool IsUserNameExists(string username)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ private ValidationResult ValidateEmailKeyInternal(string email, string key, Time

var hash = GetMashineHashedData(BitConverter.GetBytes(ms), Encoding.ASCII.GetBytes(email));
var key2 = DoStringFromBytes(hash);
var key2_good = parts[1].Equals(key2, StringComparison.OrdinalIgnoreCase);
var key2_good = string.Equals(parts[1], key2, StringComparison.OrdinalIgnoreCase);
if (!key2_good) return ValidationResult.Invalid;
var ms_current = (long)(DateTime.UtcNow - _from).TotalMilliseconds;
return validInterval >= TimeSpan.FromMilliseconds(ms_current - ms) ? ValidationResult.Ok : ValidationResult.Expired;
Expand Down

0 comments on commit b6d98a8

Please sign in to comment.