Commit 07bb644d by Cam Hayes

v9.13.6 ready for deployment

parent ef41aacf
...@@ -45,6 +45,7 @@ procedure LoadConfig(LoadProc: TConfigLoadedProc); ...@@ -45,6 +45,7 @@ procedure LoadConfig(LoadProc: TConfigLoadedProc);
if JS.toString(Obj['ApiUrl']) <> '' then if JS.toString(Obj['ApiUrl']) <> '' then
Config.ApiUrl := JS.toString(Obj['ApiUrl']); Config.ApiUrl := JS.toString(Obj['ApiUrl']);
end; end;
finally finally
LoadProc(Config); LoadProc(Config);
......
...@@ -19,7 +19,7 @@ type ...@@ -19,7 +19,7 @@ type
FUnauthorizedAccessProc: TUnauthorizedAccessProc; FUnauthorizedAccessProc: TUnauthorizedAccessProc;
public public
const clientVersion = '0.9.13.3'; const clientVersion = '0.9.13.6';
procedure InitApp(SuccessProc: TSuccessProc; procedure InitApp(SuccessProc: TSuccessProc;
UnauthorizedAccessProc: TUnauthorizedAccessProc); UnauthorizedAccessProc: TUnauthorizedAccessProc);
procedure SetClientConfig(Callback: TVersionCheckCallback); procedure SetClientConfig(Callback: TVersionCheckCallback);
......
...@@ -6,7 +6,7 @@ uses ...@@ -6,7 +6,7 @@ uses
System.SysUtils, System.Classes, JS, Web, WEBLib.Graphics, WEBLib.Controls, System.SysUtils, System.Classes, JS, Web, WEBLib.Graphics, WEBLib.Controls,
WEBLib.Forms, WEBLib.Dialogs, WEBLib.ExtCtrls, Vcl.Controls, Vcl.StdCtrls, WEBLib.Forms, WEBLib.Dialogs, WEBLib.ExtCtrls, Vcl.Controls, Vcl.StdCtrls,
WEBLib.StdCtrls, Data.DB, XData.Web.JsonDataset, XData.Web.Dataset, WEBLib.StdCtrls, Data.DB, XData.Web.JsonDataset, XData.Web.Dataset,
App.Types, ConnectionModule, XData.Web.Client, WEBLib.Menus, Utils; App.Types, ConnectionModule, XData.Web.Client, WEBLib.Menus, Utils, System.IOUtils;
type type
TFViewMain = class(TWebForm) TFViewMain = class(TWebForm)
...@@ -81,7 +81,8 @@ uses ...@@ -81,7 +81,8 @@ uses
View.OrderEntryCorrugated, View.OrderEntryCorrugated,
View.OrderEntryCuttingDie, View.OrderEntryCuttingDie,
View.OrderEntryWeb, View.OrderEntryWeb,
View.Customers, View.Customer.Add; View.Customers,
View.Customer.Add;
{$R *.dfm} {$R *.dfm}
...@@ -176,17 +177,18 @@ begin ...@@ -176,17 +177,18 @@ begin
ShowToast('Please Save or Cancel your changes', 'danger'); ShowToast('Please Save or Cancel your changes', 'danger');
end; end;
procedure TFViewMain.lblLinkToQBClick(Sender: TObject); procedure TFViewMain.lblLinkToQBClick(Sender: TObject);
var var
qblink: string; qblink, redirectUri: string;
qbWindow: TJSWindow; qbWindow: TJSWindow;
begin begin
qblink := 'https://appcenter.intuit.com/connect/oauth2'; qblink := 'https://appcenter.intuit.com/connect/oauth2';
qblink := qblink + '?client_id=ABYqlDx1EsacZYXvHIJ7RDB7zmnQdwABU3fwQLIZPmBgU0VW1P'; qblink := qblink + '?client_id=ABYqlDx1EsacZYXvHIJ7RDB7zmnQdwABU3fwQLIZPmBgU0VW1P';
qblink := qblink + '&response_type=code'; qblink := qblink + '&response_type=code';
qblink := qblink + '&scope=com.intuit.quickbooks.accounting'; qblink := qblink + '&scope=com.intuit.quickbooks.accounting';
qblink := qblink + '&redirect_uri=http://localhost:2004/kgOrders/auth/AuthService/Authorize&state=7'; qblink := qblink + '&state=7';
redirectUri := DMConnection.AuthConnection.URL + 'AuthService/QBAuthorize';
qblink := qblink + '&redirect_uri=' + RedirectUri;
qbWindow := window.open('', '_blank'); qbWindow := window.open('', '_blank');
if Assigned(qbWindow) then if Assigned(qbWindow) then
qbWindow.location.href := qbLink; qbWindow.location.href := qbLink;
......
{ {
"AuthUrl" : "http://localhost:2004/kgOrders/auth/", "AuthUrl" : "http://localhost:2004/kgOrders/auth/",
"ApiUrl" : "http://localhost:2004/kgOrders/api/" "ApiUrl" : "http://localhost:2004/kgOrders/api/",
"RedirectUri2" : "https://webapps.em-sys.net/kgOrdersTest/auth/AuthService/Authorize",
"RedirectUri1" : "https://webapps.em-sys.net/kgOrders/auth/AuthService/Authorize",
"RedirectUri" : "http://localhost:2004/kgOrders/auth/AuthService/Authorize"
} }
...@@ -41,7 +41,7 @@ uses ...@@ -41,7 +41,7 @@ uses
System.JSON, System.JSON,
Common.Config, Common.Config,
Common.Logging, Common.Logging,
uLibrary; uLibrary, XData.Sys.Exceptions;
{%CLASSGROUP 'Vcl.Controls.TControl'} {%CLASSGROUP 'Vcl.Controls.TControl'}
...@@ -57,6 +57,7 @@ begin ...@@ -57,6 +57,7 @@ begin
on E: Exception do on E: Exception do
begin begin
Logger.Log( 1, '--TAuthDatabase.DataModuleCreate -Error connecting to database: ' + E.Message ); Logger.Log( 1, '--TAuthDatabase.DataModuleCreate -Error connecting to database: ' + E.Message );
raise EXDataHttpException.Create(500, 'Error Connecting to database! Please try again later or contact a system admin!');
end; end;
end; end;
end; end;
......
...@@ -20,7 +20,7 @@ type ...@@ -20,7 +20,7 @@ type
['{9CFD59B2-A832-4F82-82BB-9A25FC93F305}'] ['{9CFD59B2-A832-4F82-82BB-9A25FC93F305}']
function Login(const user, password: string): string; function Login(const user, password: string): string;
function VerifyVersion(clientVersion: string): TJSONObject; function VerifyVersion(clientVersion: string): TJSONObject;
[HttpGet] function Authorize(code, realmId, state: string): string; [HttpGet] function QBAuthorize(code, realmId, state: string): string;
end; end;
implementation implementation
......
...@@ -23,8 +23,8 @@ type ...@@ -23,8 +23,8 @@ type
public public
function Login(const user, password: string): string; function Login(const user, password: string): string;
function VerifyVersion(ClientVersion: string): TJSONObject; function VerifyVersion(ClientVersion: string): TJSONObject;
function Authorize(code, realmId, state: string): string; function QBAuthorize(code, realmId, state: string): string;
function ExchangeAuthCode(code: string): string; function ExchangeQBAuthCode(code: string): string;
procedure AfterConstruction; override; procedure AfterConstruction; override;
procedure BeforeDestruction; override; procedure BeforeDestruction; override;
end; end;
...@@ -189,7 +189,7 @@ begin ...@@ -189,7 +189,7 @@ begin
end; end;
end; end;
function TAuthService.Authorize(code, realmId, state: string): string; function TAuthService.QBAuthorize(code, realmId, state: string): string;
var var
iniFile: TIniFile; iniFile: TIniFile;
begin begin
...@@ -197,11 +197,11 @@ begin ...@@ -197,11 +197,11 @@ begin
iniFile := TIniFile.Create(ExtractFilePath(Application.ExeName) + 'kgOrdersServer.ini'); iniFile := TIniFile.Create(ExtractFilePath(Application.ExeName) + 'kgOrdersServer.ini');
iniFile.WriteString('Quickbooks', 'CompanyID', realmId); iniFile.WriteString('Quickbooks', 'CompanyID', realmId);
iniFile.Free; iniFile.Free;
result := ExchangeAuthCode(code); result := ExchangeQBAuthCode(code);
Logger.Log(3, 'TAuthService.Authorize - end - result: ' + result); Logger.Log(3, 'TAuthService.Authorize - end - result: ' + result);
end; end;
function TAuthService.ExchangeAuthCode(code: string): string; function TAuthService.ExchangeQBAuthCode(code: string): string;
var var
iniFile: TIniFile; iniFile: TIniFile;
restClient: TRESTClient; restClient: TRESTClient;
......
...@@ -114,11 +114,11 @@ ...@@ -114,11 +114,11 @@
<VerInfo_Locale>1033</VerInfo_Locale> <VerInfo_Locale>1033</VerInfo_Locale>
<DCC_ExeOutput>.\bin</DCC_ExeOutput> <DCC_ExeOutput>.\bin</DCC_ExeOutput>
<DCC_UnitSearchPath>C:\RADTOOLS\FastMM4;$(DCC_UnitSearchPath)</DCC_UnitSearchPath> <DCC_UnitSearchPath>C:\RADTOOLS\FastMM4;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<VerInfo_Keys>CompanyName=EM Systems;FileDescription=$(MSBuildProjectName);FileVersion=0.9.13.3;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=0.9.11;Comments=</VerInfo_Keys> <VerInfo_Keys>CompanyName=EM Systems;FileDescription=$(MSBuildProjectName);FileVersion=0.9.13.6;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProgramID=com.embarcadero.$(MSBuildProjectName);ProductName=$(MSBuildProjectName);ProductVersion=0.9.11;Comments=</VerInfo_Keys>
<VerInfo_MajorVer>0</VerInfo_MajorVer> <VerInfo_MajorVer>0</VerInfo_MajorVer>
<VerInfo_MinorVer>9</VerInfo_MinorVer> <VerInfo_MinorVer>9</VerInfo_MinorVer>
<VerInfo_Release>13</VerInfo_Release> <VerInfo_Release>13</VerInfo_Release>
<VerInfo_Build>3</VerInfo_Build> <VerInfo_Build>6</VerInfo_Build>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Cfg_1_Win64)'!=''"> <PropertyGroup Condition="'$(Cfg_1_Win64)'!=''">
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode> <AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment