Skip to content

Commit

Permalink
warn if login doesn't contains domain part
Browse files Browse the repository at this point in the history
  • Loading branch information
yar229 committed Apr 18, 2017
1 parent cc5dbd2 commit 71d8228
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions WebDavMailRuCloudStore/Cloud.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ namespace YaR.WebDavMailRu.CloudStore
{
public static class Cloud
{
private static readonly log4net.ILog Logger = log4net.LogManager.GetLogger(typeof(SplittedCloud));

public static void Init(string userAgent = "")
{
if (!string.IsNullOrEmpty(userAgent))
Expand All @@ -31,6 +33,9 @@ public static MailRuCloud Instance(IHttpContext context)
return cloud;
}

if (!identity.Name.Contains("@mail."))
Logger.Warn("Missing domain part (@mail.*) in login, file and folder deleting will be denied");

cloud = new SplittedCloud(identity.Name, identity.Password);
if (!CloudCache.TryAdd(key, cloud))
CloudCache.TryGetValue(key, out cloud);
Expand Down

0 comments on commit 71d8228

Please sign in to comment.