Skip to content

Commit

Permalink
Use unsecure project web url for donor checks, as the ssl certificate…
Browse files Browse the repository at this point in the history
… seems not accepted on some Wine systems.
  • Loading branch information
ansgarbecker committed Mar 5, 2017
1 parent c75054b commit 31dc8f3
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 13 deletions.
6 changes: 3 additions & 3 deletions source/about.pas
Expand Up @@ -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 := AppDomain;
lblAppWebpage.Hint := AppDomain+'?place='+EncodeURLParam(lblAppWebpage.Name);
ImageHeidisql.Hint := AppDomain+'?place='+EncodeURLParam(ImageHeidisql.Name);
lblAppWebpage.Caption := GetAppWebsite(True);
lblAppWebpage.Hint := GetAppWebsite(True)+'?place='+EncodeURLParam(lblAppWebpage.Name);
ImageHeidisql.Hint := GetAppWebsite(True)+'?place='+EncodeURLParam(ImageHeidisql.Name);

Screen.Cursor := crDefault;
end;
Expand Down
2 changes: 1 addition & 1 deletion source/const.inc
Expand Up @@ -12,7 +12,7 @@ const

// General things
APPNAME = 'HeidiSQL';
APPDOMAIN = 'https://www.heidisql.com/';
APPDOMAIN = 'www.heidisql.com';
REGKEY_SESSIONS = 'Servers';
REGKEY_QUERYHISTORY = 'QueryHistory';
REGKEY_RECENTFILTERS = 'RecentFilters';
Expand Down
2 changes: 1 addition & 1 deletion source/exportgrid.pas
Expand Up @@ -890,7 +890,7 @@ procedure TfrmExportGrid.btnOKClick(Sender: TObject);
' </table>' + CRLF + CRLF +
' <p>' + CRLF +
' <em>generated ' + DateToStr(now) + ' ' + TimeToStr(now) +
' by <a href="'+APPDOMAIN+'">' + APPNAME + ' ' + Mainform.AppVersion + '</a></em>' + CRLF +
' by <a href="'+GetAppWebsite(True)+'">' + APPNAME + ' ' + Mainform.AppVersion + '</a></em>' + CRLF +
' </p>' + CRLF + CRLF +
' </body>' + CRLF +
'</html>' + CRLF;
Expand Down
12 changes: 11 additions & 1 deletion source/helpers.pas
Expand Up @@ -331,6 +331,7 @@ 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
Expand Down Expand Up @@ -2742,7 +2743,7 @@ procedure Help(Sender: TObject; Anchor: String);
Place := 'unhandled-'+Sender.ClassName;
if IsNotEmpty(Anchor) then
Anchor := '#'+Anchor;
ShellExec(APPDOMAIN+'help.php?place='+EncodeURLParam(Place)+Anchor);
ShellExec(GetAppWebsite(True)+'help.php?place='+EncodeURLParam(Place)+Anchor);
end;


Expand Down Expand Up @@ -2785,6 +2786,15 @@ 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 }
Expand Down
6 changes: 3 additions & 3 deletions source/main.pas
Expand Up @@ -1990,7 +1990,7 @@ procedure TMainForm.AfterFormCreate;
if DaysBetween(Now, LastStatsCall) >= 30 then begin
// Report used SVN revision
StatsCall := THttpDownload.Create(Self);
StatsCall.URL := APPDOMAIN + 'savestats.php?c=' + IntToStr(FAppVerRevision) + '&bits=' + IntToStr(GetExecutableBits);
StatsCall.URL := GetAppWebsite(True) + '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];
Expand Down Expand Up @@ -2498,7 +2498,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(APPDOMAIN + 'donatebutton.php?place=' + EncodeURLParam(place));
ShellExec(GetAppWebsite(True) + 'donatebutton.php?place=' + EncodeURLParam(place));
end;
end;

Expand Down Expand Up @@ -12100,7 +12100,7 @@ function TMainForm.HasDonated(ForceCheck: Boolean): TThreeStateBoolean;
// = 2 : Valid donor
rx := TRegExpr.Create;
CheckWebpage := THttpDownload.Create(MainForm);
CheckWebpage.URL := APPDOMAIN + 'hasdonated.php?email='+EncodeURLParam(Email);
CheckWebpage.URL := GetAppWebsite(False) + 'hasdonated.php?email='+EncodeURLParam(Email);
CheckWebpage.TimeOut := 3;
TempFileName := GetTempDir + '\' + APPNAME + '_hasdonated_check.tmp';
try
Expand Down
2 changes: 1 addition & 1 deletion source/sqlhelp.pas
Expand Up @@ -278,7 +278,7 @@ procedure TfrmSQLhelp.FormShow(Sender: TObject);
procedure TfrmSQLhelp.ButtonOnlinehelpClick(Sender: TObject);
begin
// Link/redirect to mysql.com for further help
ShellExec( APPDOMAIN + 'sqlhelp.php?mysqlversion='+inttostr(MainForm.ActiveConnection.ServerVersionInt)+
ShellExec(GetAppWebsite(True) + 'sqlhelp.php?mysqlversion='+inttostr(MainForm.ActiveConnection.ServerVersionInt)+
'&keyword='+EncodeURLParam(keyword));
end;

Expand Down
6 changes: 3 additions & 3 deletions source/updatecheck.pas
Expand Up @@ -119,7 +119,7 @@ procedure TfrmUpdateCheck.ReadCheckFile;
// Prepare download
CheckfileDownload := THttpDownload.Create(Self);
CheckfileDownload.TimeOut := 5;
CheckfileDownload.URL := APPDOMAIN+'updatecheck.php?r='+IntToStr(Mainform.AppVerRevision)+'&bits='+IntToStr(GetExecutableBits)+'&t='+DateTimeToStr(Now);
CheckfileDownload.URL := GetAppWebsite(True)+'updatecheck.php?r='+IntToStr(Mainform.AppVerRevision)+'&bits='+IntToStr(GetExecutableBits)+'&t='+DateTimeToStr(Now);
CheckFilename := GetTempDir + APPNAME + '_updatecheck.ini';

// Download the check file
Expand Down Expand Up @@ -177,13 +177,13 @@ procedure TfrmUpdateCheck.ReadCheckFile;
}
procedure TfrmUpdateCheck.btnReleaseClick(Sender: TObject);
begin
ShellExec(APPDOMAIN+'download.php?download=installer');
ShellExec(GetAppWebsite(True)+'download.php?download=installer');
end;


procedure TfrmUpdateCheck.btnChangelogClick(Sender: TObject);
begin
ShellExec(APPDOMAIN+'download.php?place='+EncodeURLParam(TButton(Sender).Name)+'#nightlybuilds');
ShellExec(GetAppWebsite(True)+'download.php?place='+EncodeURLParam(TButton(Sender).Name)+'#nightlybuilds');
end;


Expand Down

0 comments on commit 31dc8f3

Please sign in to comment.