From 9220d33aa4d1263518312df5ec0035798145f189 Mon Sep 17 00:00:00 2001 From: Massimo Melina Date: Tue, 16 Jun 2020 00:36:34 +0200 Subject: [PATCH] trigger 'unauthorized' event for new login and url-auth. Also added 'login' event in case of success. --- main.pas | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/main.pas b/main.pas index 22adc2e..eca8c79 100644 --- a/main.pas +++ b/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;