|
|
|
@ -44,9 +44,9 @@ namespace FLocal.IISHandler.handlers.request { |
|
|
|
|
string userInfo = ShallerGateway.getUserInfoAsString(account.user.name); |
|
|
|
|
Regex regex = new Regex("\\(fhn\\:([a-z0-9]+)\\)", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.Singleline); |
|
|
|
|
Match match = regex.Match(userInfo); |
|
|
|
|
if(!match.Success) throw new FLocalException("not found"); |
|
|
|
|
if(!match.Success) throw new FLocalException("key (fhn:***) not found on user info page"); |
|
|
|
|
string check = Util.md5(match.Groups[1].Value + " " + Config.instance.SaltMigration + " " + account.id); |
|
|
|
|
if(check != context.httprequest["check"]) throw new FLocalException("Wrong key '" + match.Groups[1].Value + "'"); |
|
|
|
|
if(check != context.httprequest["check"]) throw new FLocalException("Wrong key (fhn:" + match.Groups[1].Value + ")"); |
|
|
|
|
if(context.httprequest.Form["password"] != context.httprequest.Form["password2"]) throw new FLocalException("Passwords mismatch"); |
|
|
|
|
account.migrate(context.httprequest.Form["password2"]); |
|
|
|
|
return new XElement[0]; |
|
|
|
|