Skip to content

Commit

Permalink
Pingback restriction not always respected
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickTingen committed Nov 17, 2020
1 parent 943f00e commit 162bb79
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 129 deletions.
3 changes: 3 additions & 0 deletions DataDigger.i
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
*/
&GLOBAL-DEFINE PINGBACKURL https://is.gd/DataDigger25
&GLOBAL-DEFINE PINGBACKSTATS https://is.gd/stats.php?url=DataDigger25
&GLOBAL-DEFINE EASTEREGG https://is.gd/EasterEgg
&GLOBAL-DEFINE FEELINGLUCKY https://is.gd/FeelingLucky

/* DataDigger 24: https://is.gd/stats.php?url=DataDigger
DataDigger 25: https://is.gd/stats.php?url=DataDigger25
*/
Expand Down
1 change: 1 addition & 0 deletions DataDigger.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ DataDigger version 25
- Solved: Username sometimes not retrieved properly #54 (Movedoa)
- Solved: Deprecated option RCODE-INFORMATION on TT definitions removed #53 (Movedoa)
- Solved: Conversion procedure not found
- Solved: Pingback restriction not always respected

- Change: File description now shows both label and description (Johan Geerts)
- Change: File label shown in title and description as tooltip on file browse (Dirk Vreken)
Expand Down
14 changes: 14 additions & 0 deletions DataDiggerLib.p
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,20 @@ PROCEDURE CloseHandle EXTERNAL "kernel32" :
DEFINE RETURN PARAMETER ReturnValue AS LONG.
END PROCEDURE.

/* Used in update check / about window */
PROCEDURE URLDownloadToFileA EXTERNAL "URLMON.DLL" :
DEFINE INPUT PARAMETER pCaller AS LONG.
DEFINE INPUT PARAMETER szURL AS CHARACTER.
DEFINE INPUT PARAMETER szFilename AS CHARACTER.
DEFINE INPUT PARAMETER dwReserved AS LONG.
DEFINE INPUT PARAMETER lpfnCB AS LONG.
DEFINE RETURN PARAMETER ReturnValue AS LONG.
END PROCEDURE. /* URLDownloadToFileA */

PROCEDURE DeleteUrlCacheEntry EXTERNAL "WININET.DLL" :
DEFINE INPUT PARAMETER lbszUrlName AS CHARACTER.
END PROCEDURE. /* DeleteUrlCacheEntry */

DEFINE TEMP-TABLE ttColor NO-UNDO
FIELD cName AS CHARACTER
FIELD iColor AS INTEGER
Expand Down
2 changes: 1 addition & 1 deletion build.i
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20201111
20201117
80 changes: 32 additions & 48 deletions getRemoteFile.p
Original file line number Diff line number Diff line change
@@ -1,49 +1,33 @@
/*------------------------------------------------------------------------
Name: getRemoteFile.p
Desc: Return a remotely hosted file as longchar
------------------------------------------------------------------------*/

DEFINE INPUT PARAMETER pcRemoteFile AS CHARACTER NO-UNDO.
DEFINE OUTPUT PARAMETER pcContents AS LONGCHAR NO-UNDO.

PROCEDURE URLDownloadToFileA EXTERNAL "URLMON.DLL" :
DEFINE INPUT PARAMETER pCaller AS LONG.
DEFINE INPUT PARAMETER szURL AS CHARACTER.
DEFINE INPUT PARAMETER szFilename AS CHARACTER.
DEFINE INPUT PARAMETER dwReserved AS LONG.
DEFINE INPUT PARAMETER lpfnCB AS LONG.
DEFINE RETURN PARAMETER ReturnValue AS LONG.
END PROCEDURE. /* URLDownloadToFileA */

PROCEDURE DeleteUrlCacheEntry EXTERNAL "WININET.DLL" :
DEFINE INPUT PARAMETER lbszUrlName AS CHARACTER.
END PROCEDURE. /* DeleteUrlCacheEntry */


/* Main
*/
{&_proparse_prolint-nowarn(varusage)}
DEFINE VARIABLE iResult AS INTEGER NO-UNDO.
DEFINE VARIABLE cTempFile AS CHARACTER NO-UNDO.

/* Figure out a temp name */
#GetName:
REPEAT:
cTempFile = SUBSTITUTE('&1_remote-file-&2.txt', SESSION:TEMP-DIRECTORY, ETIME).
IF SEARCH(cTempFile) = ? THEN LEAVE #GetName.
END.

/* Download */
RUN DeleteURLCacheEntry (INPUT pcRemoteFile).

{&_proparse_prolint-nowarn(varusage)}
RUN urlDownloadToFileA (0, pcRemoteFile, cTempFile, 0, 0, OUTPUT iResult).

/* Read */
IF SEARCH(cTempFile) <> ? THEN COPY-LOB FILE cTempFile TO pcContents.
pcContents = TRIM(pcContents).

/* Cleanup */
/*------------------------------------------------------------------------
Name: getRemoteFile.p
Desc: Return a remotely hosted file as longchar
------------------------------------------------------------------------*/

DEFINE INPUT PARAMETER pcRemoteFile AS CHARACTER NO-UNDO.
DEFINE OUTPUT PARAMETER pcContents AS LONGCHAR NO-UNDO.

{&_proparse_prolint-nowarn(varusage)}
DEFINE VARIABLE iResult AS INTEGER NO-UNDO.
DEFINE VARIABLE cTempFile AS CHARACTER NO-UNDO.

/* Figure out a temp name */
#GetName:
REPEAT:
cTempFile = SUBSTITUTE('&1_remote-file-&2.txt', SESSION:TEMP-DIRECTORY, ETIME).
IF SEARCH(cTempFile) = ? THEN LEAVE #GetName.
END.

/* Download */
RUN DeleteURLCacheEntry (INPUT pcRemoteFile).

{&_proparse_prolint-nowarn(varusage)}
RUN urlDownloadToFileA (0, pcRemoteFile, cTempFile, 0, 0, OUTPUT iResult).

/* Read */
IF SEARCH(cTempFile) <> ? THEN COPY-LOB FILE cTempFile TO pcContents.
pcContents = TRIM(pcContents).

/* Cleanup */
OS-DELETE VALUE(cTempFile).
19 changes: 10 additions & 9 deletions wAbout.w
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,10 @@ DEFINE FRAME DEFAULT-FRAME
btnDataDigger AT ROW 1.71 COL 3 WIDGET-ID 324
BtnOK AT Y 10 X 540 WIDGET-ID 48
edChangelog AT Y 60 X 5 NO-LABEL WIDGET-ID 72
fiDataDigger-1 AT Y 15 X 40 COLON-ALIGNED NO-LABEL WIDGET-ID 74
fiDataDigger-2 AT Y 32 X 40 COLON-ALIGNED NO-LABEL WIDGET-ID 76
fiDataDigger-1 AT Y 15 X 45 COLON-ALIGNED NO-LABEL WIDGET-ID 74
fiDataDigger-2 AT Y 32 X 45 COLON-ALIGNED NO-LABEL WIDGET-ID 76
fiWebsite AT Y 425 X 227 NO-LABEL WIDGET-ID 298
imgPlayer AT ROW 2.43 COL 60.6 WIDGET-ID 328
imgPlayer AT ROW 2.43 COL 61.2 WIDGET-ID 328
imgBall AT ROW 5.43 COL 59.8 WIDGET-ID 330
rcCord AT ROW 4.05 COL 60.6 WIDGET-ID 332
WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
Expand Down Expand Up @@ -258,8 +258,14 @@ END.
&ANALYZE-SUSPEND _UIB-CODE-BLOCK _CONTROL btnDataDigger wAbout
ON CHOOSE OF btnDataDigger IN FRAME DEFAULT-FRAME /* D */
DO:
DEFINE VARIABLE iResult AS INTEGER NO-UNDO.

{&WINDOW-NAME}:SENSITIVE = FALSE.
chCtrlFrame:PSTimer:ENABLED = FALSE.

IF LOGICAL(getRegistry('DataDigger:Update','PingBack')) = TRUE THEN
RUN urlDownloadToFileA (0, '{&EASTEREGG}', '', 0, 0, OUTPUT iResult).

RUN SokoDigger.w.
{&WINDOW-NAME}:SENSITIVE = TRUE.
END.
Expand Down Expand Up @@ -393,11 +399,8 @@ PROCEDURE blinkLogo :
END.
IF xx <= 5 THEN LEAVE #Bounce.

RUN lockWindow(FRAME {&FRAME-NAME}:HANDLE, YES).
btnDataDigger:X = xx.
btnDataDigger:Y = yy.
btnDataDigger:MOVE-TO-TOP().
RUN lockWindow(FRAME {&FRAME-NAME}:HANDLE, NO).

RUN justWait(9).
END.
Expand All @@ -406,7 +409,7 @@ PROCEDURE blinkLogo :
btnDataDigger:Y = 15.

/* Blink logo */
DO ii = 1 TO 2:
DO ii = 1 TO 3:
btnDataDigger:SENSITIVE = NO.
RUN justWait(300).
btnDataDigger:SENSITIVE = YES.
Expand All @@ -422,11 +425,9 @@ PROCEDURE blinkLogo :
imgPlayer:Y = ii.
IF ii > 90 THEN
DO:
RUN lockWindow(FRAME {&FRAME-NAME}:HANDLE, YES).
imgBall:Y = imgBall:Y + 4.
rcCord:Y = rcCord:Y + 4.
edChangelog:HEIGHT-PIXELS = edChangelog:HEIGHT-PIXELS + 4.
RUN lockWindow(FRAME {&FRAME-NAME}:HANDLE, NO).
END.

RUN justWait(9).
Expand Down
Binary file modified wAbout.wrx
Binary file not shown.
134 changes: 63 additions & 71 deletions wDataDigger.w
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,6 @@ DEFINE VARIABLE giColorFavouriteTableFG AS INTEGER NO-UNDO.
DEFINE VARIABLE giColorFavouriteTableBG AS INTEGER NO-UNDO.
DEFINE VARIABLE glUseColorsFavouriteTable AS LOGICAL NO-UNDO.

/* Procedure used in update check */
PROCEDURE URLDownloadToFileA EXTERNAL "URLMON.DLL" :
DEFINE INPUT PARAMETER pCaller AS LONG.
DEFINE INPUT PARAMETER szURL AS CHARACTER.
DEFINE INPUT PARAMETER szFilename AS CHARACTER.
DEFINE INPUT PARAMETER dwReserved AS LONG.
DEFINE INPUT PARAMETER lpfnCB AS LONG.
END PROCEDURE. /* URLDownloadToFileA */

/* _UIB-CODE-BLOCK-END */
&ANALYZE-RESUME

Expand Down Expand Up @@ -202,7 +193,7 @@ END PROCEDURE. /* URLDownloadToFileA */
&Scoped-Define ENABLED-OBJECTS rctQuery rctEdit fiTableFilter ~
cbDatabaseFilter btnFavourite tgSelAll fiIndexNameFilter fiFlagsFilter ~
fiFieldsFilter btnClearIndexFilter brTables brFields brIndexes tgDebugMode ~
btnClearTableFilter fiTableDesc cbFavouriteGroup btnTableFilter ficWhere ~
fiTableDesc cbFavouriteGroup btnClearTableFilter ficWhere btnTableFilter ~
btnAddFavGroup btnWhere btnQueries btnView btnTools btnTabTables btnClear ~
btnClearFieldFilter btnClipboard btnMoveBottom btnMoveDown btnMoveTop ~
btnMoveUp btnReset btnTabFavourites btnTabFields btnTabIndexes btnNextQuery ~
Expand Down Expand Up @@ -998,13 +989,13 @@ DEFINE FRAME frMain
brFields AT Y 27 X 325 WIDGET-ID 100
brIndexes AT Y 28 X 829 WIDGET-ID 200
tgDebugMode AT Y 29 X 38 WIDGET-ID 238 NO-TAB-STOP
btnClearTableFilter AT Y 3 X 237 WIDGET-ID 222
fiTableDesc AT Y 236 X 57 NO-LABEL WIDGET-ID 90
cbFavouriteGroup AT Y 236 X 75 COLON-ALIGNED NO-LABEL WIDGET-ID 316
btnTableFilter AT Y 3 X 257 WIDGET-ID 38
btnClearTableFilter AT Y 3 X 237 WIDGET-ID 222
ficWhere AT Y 266 X 80 NO-LABEL
btnAddFavGroup AT Y 236 X 248 WIDGET-ID 318
fiWarning AT Y 520 X 480 COLON-ALIGNED NO-LABEL WIDGET-ID 172
btnTableFilter AT Y 3 X 257 WIDGET-ID 38
btnAddFavGroup AT Y 236 X 248 WIDGET-ID 318
btnWhere AT Y 265 X 683 WIDGET-ID 236
btnQueries AT Y 265 X 745 WIDGET-ID 190
btnView AT Y 520 X 200 WIDGET-ID 4
Expand Down Expand Up @@ -1042,46 +1033,17 @@ DEFINE FRAME frMain
AT X 0 Y 0
SIZE-PIXELS 1498 BY 560 DROP-TARGET.

DEFINE FRAME frSettings
btnQueries-txt AT Y 175 X 37 WIDGET-ID 294
btnDataDigger AT Y 35 X 1 WIDGET-ID 126
btnSettings AT Y 70 X 1 WIDGET-ID 210
btnDict AT Y 105 X 1 WIDGET-ID 224
btnDataAdmin AT Y 140 X 1 WIDGET-ID 214
btnQueries-3 AT Y 175 X 1 WIDGET-ID 190
btnQueryTester AT Y 210 X 1 WIDGET-ID 232
btnConnections AT Y 245 X 1 WIDGET-ID 212
btnEditor AT Y 280 X 1 WIDGET-ID 228
btnHelp AT Y 315 X 1 WIDGET-ID 260
btnAbout AT Y 350 X 1 WIDGET-ID 196
btnExpand AT Y 485 X 1 WIDGET-ID 306
btnExpand-txt AT Y 485 X 35 WIDGET-ID 308
btnEditor-txt AT Y 280 X 37 WIDGET-ID 290
btnQueryTester-txt AT Y 210 X 37 WIDGET-ID 298
btnAbout-txt AT Y 350 X 37 WIDGET-ID 266
btnConnections-txt AT Y 245 X 37 WIDGET-ID 270
btnDataAdmin-txt AT Y 140 X 37 WIDGET-ID 274
btnDataDigger-txt AT Y 35 X 37 WIDGET-ID 278
btnHelp-txt AT Y 315 X 37 WIDGET-ID 286
btnSettings-txt AT Y 70 X 37 WIDGET-ID 302
btnTools-2 AT Y 0 X 1 WIDGET-ID 264
btnDict-txt AT Y 105 X 37 WIDGET-ID 282
btnTools-txt AT Y 0 X 35 WIDGET-ID 304
DEFINE FRAME frData
btnClearDataFilter AT Y 5 X 761 WIDGET-ID 76
btnDataSort AT Y 4 X 5 WIDGET-ID 300
fiNumSelected AT Y 198 X 636 COLON-ALIGNED NO-LABEL WIDGET-ID 298
fiNumRecords AT Y 198 X 665 COLON-ALIGNED NO-LABEL WIDGET-ID 210
rctData AT Y 0 X 0 WIDGET-ID 272
rctDataFilter AT Y 1 X 0 WIDGET-ID 296
WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
SIDE-LABELS NO-UNDERLINE
AT COL 1 ROW 2.43
SIZE 28 BY 24.76
BGCOLOR 15 WIDGET-ID 500.

DEFINE FRAME frHint
edHint AT Y 4 X 35 NO-LABEL WIDGET-ID 2
btGotIt AT Y 110 X 104 WIDGET-ID 4
imgArrow AT Y 0 X 0 WIDGET-ID 10
WITH 1 DOWN KEEP-TAB-ORDER OVERLAY
SIDE-LABELS TOP-ONLY NO-UNDERLINE THREE-D
AT X 1150 Y 15
SIZE-PIXELS 285 BY 140
BGCOLOR 14 WIDGET-ID 600.
SIDE-LABELS NO-UNDERLINE THREE-D
AT COL 7 ROW 15.05
SIZE 158 BY 10.24 WIDGET-ID 700.

DEFINE FRAME frWhere
btnBegins AT Y 123 X 17 WIDGET-ID 74
Expand Down Expand Up @@ -1119,17 +1081,46 @@ DEFINE FRAME frWhere
TITLE "Query Editor"
DEFAULT-BUTTON btnOK WIDGET-ID 400.

DEFINE FRAME frData
btnClearDataFilter AT Y 5 X 761 WIDGET-ID 76
btnDataSort AT Y 4 X 5 WIDGET-ID 300
fiNumSelected AT Y 198 X 636 COLON-ALIGNED NO-LABEL WIDGET-ID 298
fiNumRecords AT Y 198 X 665 COLON-ALIGNED NO-LABEL WIDGET-ID 210
rctData AT Y 0 X 0 WIDGET-ID 272
rctDataFilter AT Y 1 X 0 WIDGET-ID 296
DEFINE FRAME frHint
edHint AT Y 4 X 35 NO-LABEL WIDGET-ID 2
btGotIt AT Y 110 X 104 WIDGET-ID 4
imgArrow AT Y 0 X 0 WIDGET-ID 10
WITH 1 DOWN KEEP-TAB-ORDER OVERLAY
SIDE-LABELS TOP-ONLY NO-UNDERLINE THREE-D
AT X 1150 Y 15
SIZE-PIXELS 285 BY 140
BGCOLOR 14 WIDGET-ID 600.

DEFINE FRAME frSettings
btnQueries-txt AT Y 175 X 37 WIDGET-ID 294
btnDataDigger AT Y 35 X 1 WIDGET-ID 126
btnSettings AT Y 70 X 1 WIDGET-ID 210
btnDict AT Y 105 X 1 WIDGET-ID 224
btnDataAdmin AT Y 140 X 1 WIDGET-ID 214
btnQueries-3 AT Y 175 X 1 WIDGET-ID 190
btnQueryTester AT Y 210 X 1 WIDGET-ID 232
btnConnections AT Y 245 X 1 WIDGET-ID 212
btnEditor AT Y 280 X 1 WIDGET-ID 228
btnHelp AT Y 315 X 1 WIDGET-ID 260
btnAbout AT Y 350 X 1 WIDGET-ID 196
btnExpand AT Y 485 X 1 WIDGET-ID 306
btnExpand-txt AT Y 485 X 35 WIDGET-ID 308
btnEditor-txt AT Y 280 X 37 WIDGET-ID 290
btnQueryTester-txt AT Y 210 X 37 WIDGET-ID 298
btnAbout-txt AT Y 350 X 37 WIDGET-ID 266
btnConnections-txt AT Y 245 X 37 WIDGET-ID 270
btnDataAdmin-txt AT Y 140 X 37 WIDGET-ID 274
btnDataDigger-txt AT Y 35 X 37 WIDGET-ID 278
btnHelp-txt AT Y 315 X 37 WIDGET-ID 286
btnSettings-txt AT Y 70 X 37 WIDGET-ID 302
btnTools-2 AT Y 0 X 1 WIDGET-ID 264
btnDict-txt AT Y 105 X 37 WIDGET-ID 282
btnTools-txt AT Y 0 X 35 WIDGET-ID 304
WITH 1 DOWN NO-BOX KEEP-TAB-ORDER OVERLAY
SIDE-LABELS NO-UNDERLINE THREE-D
AT COL 7 ROW 15.05
SIZE 158 BY 10.24 WIDGET-ID 700.
SIDE-LABELS NO-UNDERLINE
AT COL 1 ROW 2.43
SIZE 28 BY 24.76
BGCOLOR 15 WIDGET-ID 500.


/* *********************** Procedure Settings ************************ */
Expand Down Expand Up @@ -6739,13 +6730,13 @@ PROCEDURE enable_UI :
WITH FRAME frMain IN WINDOW C-Win.
ENABLE rctQuery rctEdit fiTableFilter cbDatabaseFilter btnFavourite tgSelAll
fiIndexNameFilter fiFlagsFilter fiFieldsFilter btnClearIndexFilter
brTables brFields brIndexes tgDebugMode btnClearTableFilter
fiTableDesc cbFavouriteGroup btnTableFilter ficWhere btnAddFavGroup
btnWhere btnQueries btnView btnTools btnTabTables btnClear
btnClearFieldFilter btnClipboard btnMoveBottom btnMoveDown btnMoveTop
btnMoveUp btnReset btnTabFavourites btnTabFields btnTabIndexes
btnNextQuery btnPrevQuery btnDump btnLoad btnDelete btnResizeVer
btnClone btnAdd btnEdit fiFeedback
brTables brFields brIndexes tgDebugMode fiTableDesc cbFavouriteGroup
btnClearTableFilter ficWhere btnTableFilter btnAddFavGroup btnWhere
btnQueries btnView btnTools btnTabTables btnClear btnClearFieldFilter
btnClipboard btnMoveBottom btnMoveDown btnMoveTop btnMoveUp btnReset
btnTabFavourites btnTabFields btnTabIndexes btnNextQuery btnPrevQuery
btnDump btnLoad btnDelete btnResizeVer btnClone btnAdd btnEdit
fiFeedback
WITH FRAME frMain IN WINDOW C-Win.
{&OPEN-BROWSERS-IN-QUERY-frMain}
DISPLAY edHint
Expand Down Expand Up @@ -7114,7 +7105,7 @@ PROCEDURE feelingLucky :
* Start link https://is.gd/FeelingLucky
*/
setRegistry("DataDigger", "FeelingLucky", ISO-DATE(TODAY)).
OS-COMMAND NO-WAIT START VALUE("https://is.gd/FeelingLucky").
OS-COMMAND NO-WAIT START VALUE("{&FEELINGLUCKY}").
RUN createMenuTableBrowse.

END PROCEDURE. /* feelingLucky */
Expand Down Expand Up @@ -12332,6 +12323,7 @@ PROCEDURE startSession :
DEFINE VARIABLE lNewVersion AS LOGICAL NO-UNDO.
DEFINE VARIABLE lUpgraded AS LOGICAL NO-UNDO.
DEFINE VARIABLE iChannel AS INTEGER NO-UNDO.
DEFINE VARIABLE iResult AS INTEGER NO-UNDO.
DEFINE VARIABLE cRemoteBuildNr AS CHARACTER NO-UNDO.

/* Set debug flag */
Expand Down Expand Up @@ -12402,7 +12394,7 @@ PROCEDURE startSession :
IF LOGICAL(getRegistry('DataDigger:Update','PingBack')) = TRUE
AND getRegistry('DataDigger:Update','LastPingBack') <> ISO-DATE(TODAY) THEN
DO:
RUN urlDownloadToFileA (0, '{&PINGBACKURL}', '', 0, 0).
RUN urlDownloadToFileA (0, '{&PINGBACKURL}', '', 0, 0, OUTPUT iResult).
setRegistry('DataDigger:Update','LastPingBack',ISO-DATE(TODAY)).
END.

Expand Down
Binary file modified wDataDigger.wrx
Binary file not shown.

0 comments on commit 162bb79

Please sign in to comment.