mirror of
https://github.com/rejetto/hfs2.git
synced 2025-12-19 10:03:56 +01:00
trigger 'unauthorized' event for new login and url-auth. Also added 'login' event in case of success.
This commit is contained in:
parent
efa99e7cbc
commit
9220d33aa4
8
main.pas
8
main.pas
@ -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;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user