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)
|
||||
|
||||
This file is part of HFS ~ HTTP File Server.
|
||||
@ -5350,6 +5350,7 @@ var
|
||||
data.user:=acc.user;
|
||||
data.pwd:=acc.pwd;
|
||||
data.session.redirect:='.';
|
||||
runEventScript('login')
|
||||
end; //urlAuth
|
||||
|
||||
var
|
||||
@ -5463,12 +5464,17 @@ var
|
||||
end
|
||||
else
|
||||
s:='bad password'; //TODO shouldn't this change http code?
|
||||
if s='ok' then
|
||||
runEventScript('login')
|
||||
else
|
||||
runEventScript('unauthorized');
|
||||
replyWithString(s);
|
||||
exit;
|
||||
end;
|
||||
s:=urlAuth();
|
||||
if s > '' then
|
||||
begin
|
||||
runEventScript('unauthorized');
|
||||
conn.reply.mode:=HRM_DENY;
|
||||
replyWithString(s);
|
||||
exit;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user