diff --git a/bazaar/ProtectClientDemo/ProtectClientDemo.cpp b/bazaar/ProtectClientDemo/ProtectClientDemo.cpp index 0e091ba91..b47140ec2 100644 --- a/bazaar/ProtectClientDemo/ProtectClientDemo.cpp +++ b/bazaar/ProtectClientDemo/ProtectClientDemo.cpp @@ -31,6 +31,7 @@ ProtectClientDemo::ProtectClientDemo() disconnectButton <<= THISBACK1(onAction, PROTECT_DISCONNECT); getKeyButton <<= THISBACK1(onAction, PROTECT_GETKEY); getInfoButton <<= THISBACK1(onAction, PROTECT_GETLICENSEINFO); + setInfoButton <<= THISBACK1(onAction, PROTECT_UPDATEUSERDATA); quitButton <<= Breaker(); @@ -47,8 +48,8 @@ void ProtectClientDemo::onAction(int reason) responseText <<= ""; // setup client url and key - client.SetURL("localhost/scgi/testing"); -// client.SetURL("www.timberstruct.it/scgi/testing"); +// client.SetURL("localhost/scgi/testing"); + client.SetURL("timberstruct.it/scgi/testing"); client.SetKey(ScanHexString("aabbccddeeff00112233445566778899")); // sets user data @@ -91,7 +92,21 @@ void ProtectClientDemo::onAction(int reason) case PROTECT_GETLICENSEINFO : // gets info about license (name, expiration date, app version....) if(!client.GetLicenseInfo()) res += "GETLICENSEINFO ERROR\n"; + else + { + nameEdit <<= client.GetUserName(); + addressEdit <<= client.GetUserAddress(); + countryEdit <<= client.GetUserCountry(); + zipEdit <<= client.GetUserZip(); + phoneEdit <<= client.GetUserPhone(); + faxEdit <<= client.GetUserFax(); + cellEdit <<= client.GetUserCell(); + emailEdit <<= client.GetUserEMail(); + } break; + case PROTECT_UPDATEUSERDATA : + if(!client.UpdateUserData()) + res += "UPDATEUSERDATA ERROR\n"; default: break; } diff --git a/bazaar/ProtectClientDemo/ProtectClientDemo.lay b/bazaar/ProtectClientDemo/ProtectClientDemo.lay index b0ee6e1c4..d76f2c44a 100644 --- a/bazaar/ProtectClientDemo/ProtectClientDemo.lay +++ b/bazaar/ProtectClientDemo/ProtectClientDemo.lay @@ -16,13 +16,14 @@ LAYOUT(ProtectClientDemoLayout, 552, 456) ITEM(EditString, faxEdit, LeftPosZ(228, 108).TopPosZ(76, 19)) ITEM(EditString, cellEdit, LeftPosZ(400, 148).TopPosZ(76, 19)) ITEM(EditString, emailEdit, LeftPosZ(56, 200).TopPosZ(100, 19)) - ITEM(Button, registerButton, SetLabel(t_("Register")).LeftPosZ(4, 68).TopPosZ(124, 20)) - ITEM(Button, connectButton, SetLabel(t_("Connect")).LeftPosZ(80, 68).TopPosZ(124, 20)) - ITEM(Button, refreshButton, SetLabel(t_("Refresh")).LeftPosZ(156, 68).TopPosZ(124, 20)) - ITEM(Button, disconnectButton, SetLabel(t_("Disconnect")).LeftPosZ(232, 68).TopPosZ(124, 20)) - ITEM(Button, getKeyButton, SetLabel(t_("Get Key")).HSizePosZ(308, 176).TopPosZ(124, 20)) - ITEM(Button, getInfoButton, SetLabel(t_("Get Info")).HSizePosZ(384, 100).TopPosZ(124, 20)) + ITEM(Button, registerButton, SetLabel(t_("Register")).LeftPosZ(4, 60).TopPosZ(124, 20)) + ITEM(Button, connectButton, SetLabel(t_("Connect")).LeftPosZ(72, 60).TopPosZ(124, 20)) + ITEM(Button, refreshButton, SetLabel(t_("Refresh")).LeftPosZ(140, 60).TopPosZ(124, 20)) + ITEM(Button, disconnectButton, SetLabel(t_("Disconnect")).LeftPosZ(208, 60).TopPosZ(124, 20)) + ITEM(Button, getKeyButton, SetLabel(t_("Get Key")).HSizePosZ(276, 216).TopPosZ(124, 20)) + ITEM(Button, setInfoButton, SetLabel(t_("Set Info")).HSizePosZ(412, 80).TopPosZ(124, 20)) ITEM(Button, quitButton, SetLabel(t_("Quit")).LeftPosZ(480, 68).TopPosZ(124, 20)) ITEM(LineEdit, responseText, SetEditable(false).SetFrame(NullFrame()).LeftPosZ(4, 544).TopPosZ(176, 276)) + ITEM(Button, getInfoButton, SetLabel(t_("Get Info")).HSizePosZ(344, 148).TopPosZ(124, 20)) END_LAYOUT diff --git a/bazaar/ProtectServerDemo/init b/bazaar/ProtectServerDemo/init new file mode 100644 index 000000000..f256898e7 --- /dev/null +++ b/bazaar/ProtectServerDemo/init @@ -0,0 +1,4 @@ +#ifndef _ProtectServerDemo_icpp_init_stub +#define _ProtectServerDemo_icpp_init_stub +#include "Protect/init" +#endif diff --git a/bazaar/ProtectServerDemo/main.cpp b/bazaar/ProtectServerDemo/main.cpp index 65ae811c9..c0d3be421 100644 --- a/bazaar/ProtectServerDemo/main.cpp +++ b/bazaar/ProtectServerDemo/main.cpp @@ -20,6 +20,10 @@ CONSOLE_APP_MAIN .Host("localhost") .Port(25) ; + server + .SetWelcome("License activation succeeded

Welcome to TIMBERSTRUCT, %USER%
") + .SetActivationFailed("We're sorry but product activation failed, %USER%

Please contact us to solve the problem
") + ; // setup key server.SetKey(ScanHexString("aabbccddeeff00112233445566778899"));