Permalink
Browse files

Use unsecured heidisql.com url in donor check if secure one did not w…

…ork. Closes #65
  • Loading branch information...
ansgarbecker committed Jan 2, 2018
1 parent 5aabc00 commit 36c5d90d39fd294bde1ef803d08ab527c1f3aa57
Showing with 24 additions and 26 deletions.
  1. +3 −3 source/about.pas
  2. +1 −1 source/const.inc
  3. +1 −1 source/exportgrid.pas
  4. +1 −12 source/helpers.pas
  5. +14 −5 source/main.pas
  6. +1 −1 source/sqlhelp.pas
  7. +3 −3 source/updatecheck.pas
View
@@ -122,9 +122,9 @@ procedure TAboutBox.FormShow(Sender: TObject);
lblAppName.Caption := APPNAME;
lblAppVersion.Caption := _('Version') + ' ' + Mainform.AppVersion + ' (' + IntToStr(GetExecutableBits) + ' Bit)';
lblAppCompiled.Caption := _('Compiled on:') + ' ' + DateTimeToStr(GetImageLinkTimeStamp(Application.ExeName));
lblAppWebpage.Caption := GetAppWebsite(True);
lblAppWebpage.Hint := GetAppWebsite(True)+'?place='+EncodeURLParam(lblAppWebpage.Name);
ImageHeidisql.Hint := GetAppWebsite(True)+'?place='+EncodeURLParam(ImageHeidisql.Name);
lblAppWebpage.Caption := APPDOMAIN;
lblAppWebpage.Hint := APPDOMAIN+'?place='+EncodeURLParam(lblAppWebpage.Name);
ImageHeidisql.Hint := APPDOMAIN+'?place='+EncodeURLParam(ImageHeidisql.Name);
Screen.Cursor := crDefault;
end;
View
@@ -12,7 +12,7 @@ const
// General things
APPNAME = 'HeidiSQL';
APPDOMAIN = 'www.heidisql.com';
APPDOMAIN = 'https://www.heidisql.com/';
REGKEY_SESSIONS = 'Servers';
REGKEY_QUERYHISTORY = 'QueryHistory';
REGKEY_RECENTFILTERS = 'RecentFilters';
View
@@ -926,7 +926,7 @@ procedure TfrmExportGrid.btnOKClick(Sender: TObject);
' </table>' + CRLF + CRLF +
' <p>' + CRLF +
' <em>generated ' + DateToStr(now) + ' ' + TimeToStr(now) +
' by <a href="'+GetAppWebsite(True)+'">' + APPNAME + ' ' + Mainform.AppVersion + '</a></em>' + CRLF +
' by <a href="'+APPDOMAIN+'">' + APPNAME + ' ' + Mainform.AppVersion + '</a></em>' + CRLF +
' </p>' + CRLF + CRLF +
' </body>' + CRLF +
'</html>' + CRLF;
View
@@ -337,7 +337,6 @@ TAppSettings = class(TObject)
procedure Help(Sender: TObject; Anchor: String);
function PortOpen(Port: Word): Boolean;
function IsValidFilePath(FilePath: String): Boolean;
function GetAppWebsite(Secure: Boolean): String;
var
@@ -2771,7 +2770,7 @@ procedure Help(Sender: TObject; Anchor: String);
Place := 'unhandled-'+Sender.ClassName;
if IsNotEmpty(Anchor) then
Anchor := '#'+Anchor;
ShellExec(GetAppWebsite(True)+'help.php?place='+EncodeURLParam(Place)+Anchor);
ShellExec(APPDOMAIN+'help.php?place='+EncodeURLParam(Place)+Anchor);
end;
@@ -2814,16 +2813,6 @@ function IsValidFilePath(FilePath: String): Boolean;
end;
function GetAppWebsite(Secure: Boolean): String;
begin
// Get project web url, with or without ssl
if Secure then
Result := 'https://' + APPDOMAIN + '/'
else
Result := 'http://' + APPDOMAIN + '/';
end;
{ Threading stuff }
View
@@ -1997,7 +1997,7 @@ procedure TMainForm.AfterFormCreate;
if DaysBetween(Now, LastStatsCall) >= 30 then begin
// Report used SVN revision
StatsCall := THttpDownload.Create(Self);
StatsCall.URL := GetAppWebsite(True) + 'savestats.php?c=' + IntToStr(FAppVerRevision) + '&bits=' + IntToStr(GetExecutableBits);
StatsCall.URL := APPDOMAIN + 'savestats.php?c=' + IntToStr(FAppVerRevision) + '&bits=' + IntToStr(GetExecutableBits);
// Enumerate actively used server versions
for i:=0 to SessionPaths.Count-1 do begin
AppSettings.SessionPath := SessionPaths[i];
@@ -2509,7 +2509,7 @@ procedure TMainForm.DonateClick(Sender: TObject);
ErrorDialog(f_('Could not determine parent form of this %s', [Sender.ClassName]))
else begin
place := LowerCase(Dialog.UnitName);
ShellExec(GetAppWebsite(True) + 'donatebutton.php?place=' + EncodeURLParam(place));
ShellExec(APPDOMAIN + 'donatebutton.php?place=' + EncodeURLParam(place));
end;
end;
@@ -12156,17 +12156,26 @@ function TMainForm.HasDonated(ForceCheck: Boolean): TThreeStateBoolean;
FHasDonatedDatabaseCheck := nbFalse;
end else begin
// Check heidisql.com/hasdonated.php?email=...
// HasDonatedDatabaseCheck
// FHasDonatedDatabaseCheck
// = 0 : No check yet done
// = 1 : Not a donor
// = 2 : Valid donor
rx := TRegExpr.Create;
CheckWebpage := THttpDownload.Create(MainForm);
CheckWebpage.URL := GetAppWebsite(True) + 'hasdonated.php?email='+EncodeURLParam(Email);
CheckWebpage.URL := APPDOMAIN + 'hasdonated.php?email='+EncodeURLParam(Email);
CheckWebpage.TimeOut := 3;
TempFileName := GetTempDir + '\' + APPNAME + '_hasdonated_check.tmp';
try
CheckWebpage.SendRequest(TempFileName);
try
CheckWebpage.SendRequest(TempFileName);
except
on E:Exception do begin
// Try again without SSL. See issue #65
MainForm.LogSQL(E.Message, lcError);
CheckWebpage.URL := ReplaceRegExpr('^https:', CheckWebpage.URL, 'http:');
CheckWebpage.SendRequest(TempFileName);
end;
end;
CheckResult := ReadTextFile(TempFileName, TEncoding.Default);
SysUtils.DeleteFile(TempFileName);
rx.Expression := '^\d+$';
View
@@ -278,7 +278,7 @@ procedure TfrmSQLhelp.FormShow(Sender: TObject);
procedure TfrmSQLhelp.ButtonOnlinehelpClick(Sender: TObject);
begin
// Link/redirect to mysql.com for further help
ShellExec(GetAppWebsite(True) + 'sqlhelp.php?mysqlversion='+inttostr(MainForm.ActiveConnection.ServerVersionInt)+
ShellExec(APPDOMAIN + 'sqlhelp.php?mysqlversion='+inttostr(MainForm.ActiveConnection.ServerVersionInt)+
'&keyword='+EncodeURLParam(keyword));
end;
View
@@ -119,7 +119,7 @@ procedure TfrmUpdateCheck.ReadCheckFile;
// Prepare download
CheckfileDownload := THttpDownload.Create(Self);
CheckfileDownload.TimeOut := 5;
CheckfileDownload.URL := GetAppWebsite(True)+'updatecheck.php?r='+IntToStr(Mainform.AppVerRevision)+'&bits='+IntToStr(GetExecutableBits)+'&t='+DateTimeToStr(Now);
CheckfileDownload.URL := APPDOMAIN+'updatecheck.php?r='+IntToStr(Mainform.AppVerRevision)+'&bits='+IntToStr(GetExecutableBits)+'&t='+DateTimeToStr(Now);
CheckFilename := GetTempDir + APPNAME + '_updatecheck.ini';
// Download the check file
@@ -177,13 +177,13 @@ procedure TfrmUpdateCheck.ReadCheckFile;
}
procedure TfrmUpdateCheck.btnReleaseClick(Sender: TObject);
begin
ShellExec(GetAppWebsite(True)+'download.php?download=installer');
ShellExec(APPDOMAIN+'download.php?download=installer');
end;
procedure TfrmUpdateCheck.btnChangelogClick(Sender: TObject);
begin
ShellExec(GetAppWebsite(True)+'download.php?place='+EncodeURLParam(TButton(Sender).Name)+'#nightlybuilds');
ShellExec(APPDOMAIN+'download.php?place='+EncodeURLParam(TButton(Sender).Name)+'#nightlybuilds');
end;

0 comments on commit 36c5d90

Please sign in to comment.