fix: auth URL not working

This commit is contained in:
Massimo Melina 2020-05-20 17:57:35 +02:00
parent 455e8be673
commit b44270c214

View File

@ -17,7 +17,7 @@ This file is part of HFS ~ HTTP File Server.
along with HFS; if not, write to the Free Software along with HFS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
} }
{$A+,B-,C+,E-,F-,G+,H+,I-,J-,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,X+,Y+,Z1} {$A+,B-,C+,E-,F-,G+,H+,I-,J+,K-,L+,M-,N+,O+,P+,Q-,R-,S-,T-,U-,V+,X+,Y+,Z1}
{$INCLUDE defs.inc } {$INCLUDE defs.inc }
unit main; unit main;
@ -868,7 +868,6 @@ type
procedure Disable1Click(Sender: TObject); procedure Disable1Click(Sender: TObject);
procedure saveNewFingerprintsChkClick(Sender: TObject); procedure saveNewFingerprintsChkClick(Sender: TObject);
procedure Createfingerprintonaddition1Click(Sender: TObject); procedure Createfingerprintonaddition1Click(Sender: TObject);
procedure pwdInPagesChkClick(Sender: TObject);
procedure Howto1Click(Sender: TObject); procedure Howto1Click(Sender: TObject);
procedure Name1Click(Sender: TObject); procedure Name1Click(Sender: TObject);
procedure Size1Click(Sender: TObject); procedure Size1Click(Sender: TObject);
@ -2764,8 +2763,8 @@ s:=copy( s, length(f.resource)+2, length(s) );
result:=result+replaceStr(s, '\','/'); result:=result+replaceStr(s, '\','/');
end; // getFolder end; // getFolder
var userPwdHashCache:Tstr2str;
function Tfile.fullURL(ip, user, pwd:string):string; function Tfile.fullURL(ip, user, pwd:string):string;
const userPwdHashCache:Tstr2str = NIL;
var s,k,base: string; var s,k,base: string;
begin begin
if userPwdHashCache = NIL then if userPwdHashCache = NIL then
@ -5239,7 +5238,7 @@ var
// parameters: u(username), e(?expiration_UTC), s2(sha256(rest+pwd)) // parameters: u(username), e(?expiration_UTC), s2(sha256(rest+pwd))
function urlAuth():string; function urlAuth():string;
var var
s, sign: string; s, sign: string;
begin begin
result:=''; result:='';
if mode <> 'auth' then if mode <> 'auth' then
@ -5259,6 +5258,8 @@ var
exit('expired'); exit('expired');
data.account:=acc; data.account:=acc;
data.session.user:=acc.user; data.session.user:=acc.user;
data.user:=acc.user;
data.pwd:=acc.pwd;
data.session.redirect:=getAccountRedirect(acc); data.session.redirect:=getAccountRedirect(acc);
end; //urlAuth end; //urlAuth
@ -12423,20 +12424,6 @@ try setAutoFingerprint(strToUInt(s))
except msgDlg(MSG_INVALID_VALUE, MB_ICONERROR) end; except msgDlg(MSG_INVALID_VALUE, MB_ICONERROR) end;
end; end;
procedure TmainFrm.pwdInPagesChkClick(Sender: TObject);
resourcestring
MSG = 'This feature is INCOMPATIBLE with Internet Explorer.';
begin
if pwdInPagesChk.Checked
and (msgDlg(MSG, MB_ICONWARNING+MB_OKCANCEL) = IDOK) then
begin
msgDlg(MSG_ENABLED);
exit;
end;
pwdInPagesChk.checked:=FALSE;
msgDlg(MSG_DISABLED)
end;
procedure TmainFrm.Howto1Click(Sender: TObject); procedure TmainFrm.Howto1Click(Sender: TObject);
begin msgDLg(getRes('uploadHowTo')) end; begin msgDLg(getRes('uploadHowTo')) end;