feat(licence): Settings affiche le porteur de la licence
Porteur, courriel, date d'emission et Installation ID, lus dans la charge utile deja verifiee. Rempli une fois au demarrage sur les deux chemins (deja licencie, activation reussie) : rien n'y change pendant une session. Section masquee hors navigateur hote. Les champs sont echappes avant interpolation dans ExecuteJavaScript bien qu'ils viennent d'une charge utile signee — signee ne veut pas dire inoffensive. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1352,14 +1352,27 @@ begin
|
||||
LLicOk := PM.Licence.IsLicensed;
|
||||
LLicInfo := PM.Licence.LicenceInfo;
|
||||
end;
|
||||
var LHolder := LLicInfo.Holder;
|
||||
if LHolder = '' then LHolder := LLicInfo.Email;
|
||||
LHolder := StringReplace(LHolder, '\', '\\', [rfReplaceAll]);
|
||||
LHolder := StringReplace(LHolder, '"', '\"', [rfReplaceAll]);
|
||||
// Le nom, le courriel et la date viennent d'une charge utile QUE NOUS AVONS
|
||||
// SIGNEE, mais ils sont interpoles dans du JavaScript : on les echappe
|
||||
// comme n'importe quelle chaine etrangere. Signee ne veut pas dire
|
||||
// inoffensive — c'est nous qui les avons tapes au moment d'emettre.
|
||||
var LFields := TArray<string>.Create(
|
||||
LLicInfo.Holder, LLicInfo.Email, LLicInfo.IssuedOn);
|
||||
for var LI := 0 to High(LFields) do
|
||||
begin
|
||||
LFields[LI] := StringReplace(LFields[LI], '\', '\\', [rfReplaceAll]);
|
||||
LFields[LI] := StringReplace(LFields[LI], '"', '\"', [rfReplaceAll]);
|
||||
LFields[LI] := StringReplace(LFields[LI], #13, '\r', [rfReplaceAll]);
|
||||
LFields[LI] := StringReplace(LFields[LI], #10, '\n', [rfReplaceAll]);
|
||||
end;
|
||||
|
||||
WebBrowser.ExecuteJavaScript(
|
||||
'if(window.Bridge&&Bridge.onLicenceResult)' +
|
||||
'Bridge.onLicenceResult(' + BoolToStr(LLicOk, True).ToLower +
|
||||
',"' + LHolder + '","' + PM.Licence.ThisMachineId + '")');
|
||||
',"' + LFields[0] +
|
||||
'","' + PM.Licence.ThisMachineId +
|
||||
'","' + LFields[1] +
|
||||
'","' + LFields[2] + '")');
|
||||
end
|
||||
|
||||
// ---- Start with Windows (HKCU Run registry) --------------------------
|
||||
|
||||
Reference in New Issue
Block a user