NetTalk Central

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Bruce

Pages: 1 ... 5 6 [7] 8 9 ... 736
91
Web Server - Ask For Help / Re: Help with NT 14.13 API
« on: February 05, 2024, 05:31:31 PM »
ahh, the joys of auto-numbering. Boy am I glad I've left that behind. It's 'orrible.

I presume we're talking about client-side auto-numbering here?

Cheers
Bruce

92
Web Server - Ask For Help / Re: NT browse CELL Border
« on: February 05, 2024, 07:17:10 AM »
CSS questions are best asked and answered in the User Group meeting on Thursdays.

93
Web Server - Ask For Help / Re: Help with NT 14.13 API
« on: February 02, 2024, 05:03:54 AM »
>> In my EDC_Enrollment API method, I allow the user to do an insert into the Enrollment tps file.  Is there a way to make this conditional? 

<< For example, they will pass an InstitutionID and I will do a lookup into the Institution tps file to see if it is valid.  I thought I might do this lookup in the InsertRecord:PatientEnrollment, Before Add embed.  See the attached image.  If the InstitutionID is not found, how can I stop the Insert action and send back an error message about the InstitutionID not being found?

In the spirit of "teach a man to fish" rather than just parrot out the answer, I think it will be helpful if you look at the generated code for the method, perhaps in the embeditor, and spend a bit of time understanding the flow.

There is a (very simple) solution - (hint - it involves p_web.AddServiceError) - but see where the InsitutionID is parsed, add your validation code there, and set an error if it's not valid.

94
Web Server - Ask For Help / Re: Help with NT 14.13 API
« on: February 02, 2024, 04:59:57 AM »
>>  What if they use the header like "Authorization: Basic ZGVtbzpkZW1v", to pass the username and password.  Does NT resolve this for me or do I need to decode this in the Webhandler Authenticate embed?

The username and password are parsed out for you, and passed into the authenticate method as username and password parameters.
You then add code there to determine if you're happy with those credentials, or not.

95
Web Server - Ask For Help / Re: HTML text not displaying in view form
« on: January 30, 2024, 10:01:55 PM »
that's a very different error, and unrelated to this hread. Start a new thread with that question Rene.

96
Web Server - Ask For Help / Re: Email from browse menu button
« on: January 30, 2024, 10:00:43 PM »
noted. I'll look into both questions later in the week.

97
Web Server - Ask For Help / Re: Email from browse menu button
« on: January 30, 2024, 05:45:17 AM »
so there's no user interface. The user doesn't write a message, or set the to address or anything?
This is just an automated menu item that's something like "send current figures to Steve"
?

98
Web Server - Ask For Help / Re: Email from browse menu button
« on: January 29, 2024, 10:41:30 PM »
I think you need to define what you mean by "send an email".
Is there any user interface here? or is it an automated background send?

99
Web Server - Ask For Help / Re: Help with NT 14.13 API
« on: January 29, 2024, 10:40:32 PM »
Jeff,
this is likely a good question for the User Group Meeting on Thursday, because I have lots of questions for you.

But basically I start with
"Write your code in the ServiceMethod routine".

In other words write the code to do what you've laid out above. Then the parameters and returns become obvious (since they're used by, or created by, your code).

100
Web Server - Ask For Help / Re: WebCam criteria for reading barcodes
« on: January 29, 2024, 10:35:39 PM »
Hi Ron,

Autofocus, sure. but I think they all have auto-focus.
But resolution matters. Cheap PC webcams are typically very low res compared to say the cameras in most phones.
So if you want to scan barcodes from a PC you need aq camera with "good" resolution.

Cheers
Bruce

101
That's not the real question.
The real question is "how you [safely] trigger the serial device?"

Traditionally browsers are isolated from hardware. So code running in the browser (JavaScript) cannot talk to a serial port, and so trigger your serial device. In this situation you need to run a small program on the client device (the Raspberry Pi) which reads and writes the serial port. Typically this program is also a _web server_ - because then the Browser can create a connection to it, send it a command, and so on.

Thus the browser talks to your main home server, and when it gets the ok to open a locker it triggers a request to the local server which then triggers the serial port.

Now, I say, traditionally, because in recent times there's a serial interface experiment happening in the browser. This means that the browser can interact directly with the serial port using JavaScript. Of course one would need to be very careful taking this approach. Since the browser is the "least secure" part of they system, if you use this API you make it _very_ tempting to attack the browser/Javascript with a view to it simply opening all the lockers.

So I think in a situation like yours, I would lean towards a more sophisticated system - one which relies on an encrypted one-time code being passed to the local server from the home NT server. In this way the home server issues a code which opens the locker. I'd code it something liek this;

a) home server decides a locker must be opened.
b) sends a "get random string" (aka a nonce) command to the browser, which in turn requests it from the local (python or whatever) server.
c) the local python server stores that string for a little bit.
d) the browser passes the string back to the home server, and the home server encrypts it using a private key.
e) the string is then passed back to the browser, and on to the local server. the local server decrypts it using a public key. And compares it to the nonce. If that passes then the instruction is executed. The python program then discards the stored nonce.

This prevents replay attacks (recording the command to open locker 2, then playing it back in the future.) By getting a one-time random nonce from the python program, and then including that in the command, the python program won't replay the command. So for example the command passed to the python server (encrypted) might be
{ "nonce" = "1234",
"cmd" : "open locker",
"locker" : 2}







102
Validation happens in the
ValidateValue::Whatever
routine

103
Web Server - Ask For Help / Re: Add a Save and Continue to edit button
« on: January 24, 2024, 01:19:58 AM »
For the 14.17 build I've added a button type "Partial Save". This saves the record, and leaves the form open in Change mode.

104
post an example, and I'll see what can be done.

105
>> A post from a few years ago mentioned it was not possible to disable a TaskPanel menu item yet, so I was wondering if this is something planned for a future update or a way to do this now?

It isn't planned (at least not on my list) and I haven't done any work in this space for ages, so I presume it hasn't changed.
If you'd like to get it on a list, post in the Feature-Request section of the forums.
(you should likely post an example as well)

Pages: 1 ... 5 6 [7] 8 9 ... 736