trigger 'unauthorized' event for new login and url-auth. Also added 'login' event in case of success.

This commit is contained in:
Massimo Melina 2020-06-16 00:36:34 +02:00
parent efa99e7cbc
commit 9220d33aa4

View File

@ -1,4 +1,4 @@
{ {
Copyright (C) 2002-2020 Massimo Melina (www.rejetto.com) Copyright (C) 2002-2020 Massimo Melina (www.rejetto.com)
This file is part of HFS ~ HTTP File Server. This file is part of HFS ~ HTTP File Server.
@ -5350,6 +5350,7 @@ var
data.user:=acc.user; data.user:=acc.user;
data.pwd:=acc.pwd; data.pwd:=acc.pwd;
data.session.redirect:='.'; data.session.redirect:='.';
runEventScript('login')
end; //urlAuth end; //urlAuth
var var
@ -5463,12 +5464,17 @@ var
end end
else else
s:='bad password'; //TODO shouldn't this change http code? s:='bad password'; //TODO shouldn't this change http code?
if s='ok' then
runEventScript('login')
else
runEventScript('unauthorized');
replyWithString(s); replyWithString(s);
exit; exit;
end; end;
s:=urlAuth(); s:=urlAuth();
if s > '' then if s > '' then
begin begin
runEventScript('unauthorized');
conn.reply.mode:=HRM_DENY; conn.reply.mode:=HRM_DENY;
replyWithString(s); replyWithString(s);
exit; exit;