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.


Topics - DonnEdwards

Pages: 1 [2]
16
Web Server - Ask For Help / Exception occurred at address 0103B904
« on: April 25, 2021, 09:14:58 AM »
I'm getting this random error after my webserver has been running for a few hours, and only on the live server, not on my development machine.

Exception occurred at address 0103B904
Exception code C0000005: Access Violation
Process PID=1276  Image: C:\dev\test6\kgoffice6.exe
Thread 27  Handle=00000534  TID=1480


The full gory details are in the attached log file. How would I go about trying to trace down the cause? So far there are only about a dozen lines of hand code in the entire app, and they occur when the app starts.

Any hints or suggestions on where to begin will be most welcome.

17
Web Server - Ask For Help / WebServer Generate errors
« on: April 21, 2021, 09:58:45 AM »
I'm getting these two errors (see attachments below). File names vary, but it's always number 1 and 4 because my "Procedures per module" application option is set to 1.

Am I right in assuming it's OK to click Yes in both cases? I'd rather ask than screw up my project. I'm using NT 12

18
I have a field in each table in my NT Server app called "UpBy". It's a string field of 200 characters. I want to be able to put some text in it that indicates who inserted or updated it, assuming they made a change and didn't just view it. Something like

DonnEdwards 2021-04-17 23h08 Add 155.93.152.18

Firstly,  where do I initialise a session variable "UserName" to read "Not Logged In"? Once the user logs in I will change it to the actual user name.

Secondly, where do I put the code to generate the string, assuming I want this string to be the session variable "UserName" followed by the date and time, followed by the word "Add" or "Change", followed by the user's IP address?

Thirdly, how do I detect whether the record is being inserted or updated? Also, how do I avoid changing the field if the record hasn't been modified?

All suggestions, ideas and tips will be most welcome. I'm still busy with RTFM, so please forgive me if this is discussed in the documentation. Just point me to an example or section of the notes.

19
Web Server - Ask For Help / NetTalkServer extra buttons
« on: April 16, 2021, 07:44:27 AM »
I have created two useful buttons to help me set up the secure and insecure ports correctly. See attached image

These are the items to add near the end of the Webserver Window using the Window Structure Editor:

Code: [Select]
          BUTTON('Insecure Address'),AT(6,297),USE(?InsecureButton),TIP('Open the browser with' & |
            ' the insecure address and port')
          BUTTON('Secure Address'),AT(82,297),USE(?SecureButton),TIP('Open the browser with ' & |
            'the secure address and port')

In the Local data "Generated Declarations" embed point, add in:

Code: [Select]
! Secure and Insecure Address buttons
loc:Run           cstring(255)
loc:parameters    cstring (255)
loc:ret           long
st                StringTheory

For the "?InsecureButton" Accepted embed point add in:

Code: [Select]
  ! Open the insecure address
  IF len(clip(set:Domains)) > 4 THEN            ! Domains are listed
        st.SetValue(CLIP(set:Domains) & '<13,10>') ! Get the domains, add a CR LF to the end
        loc:Run = 'http://' & CLIP(st.Before('<13,10>')) & ':' & CLIP(set:InsecurePort) ! First listed domain
  ELSIF LEN(CLIP(set:BindToIpAddress)) > 4 THEN ! IP Address filled in
        loc:Run = 'http://' & CLIP(set:BindToIpAddress) & ':' & CLIP(set:InsecurePort)
  ELSE                                          ! IP Address missing
        loc:Run = 'http://127.0.0.1:' & CLIP(set:InsecurePort)
  END                                           ! IP Address
  loc:parameters = ''
  loc:ret = OS_ShellExecute(0{prop:clienthandle}, 0, address(loc:Run), address(loc:Parameters), 0, 1) ! Open the URL

Similarly for the "?SecureButton"

Code: [Select]
  ! Open the secure address
  IF set:SecurePort > 0 THEN                ! Secure port set
        IF len(clip(set:Domains)) > 4 THEN            ! Domains are listed
            st.SetValue(CLIP(set:Domains) & '<13,10>')  ! Get the domains, add a CR LF to the end
            loc:Run = 'https://' & CLIP(st.Before('<13,10>')) & ':' & CLIP(set:SecurePort) ! First listed domain
        ELSIF LEN(CLIP(set:BindToIpAddress)) > 4 THEN ! IP Address filled in
            loc:Run = 'https://' & CLIP(set:BindToIpAddress) & ':' & CLIP(set:SecurePort)

        ELSE                                ! IP Address missing
            loc:Run = 'https://127.0.0.1:' & CLIP(set:SecurePort)
        END                                 ! IP Address
        loc:parameters = ''
        loc:ret = OS_ShellExecute(0{prop:clienthandle}, 0, address(loc:Run), address(loc:Parameters), 0, 1)  ! Open the URL
  ELSE                                      ! Secure port is zero
        MESSAGE('Secure Port not set')
  END                                       ! Secure port

I'm not entirely sure I have got it right. Please could you guys have a look at my code and tell me how I can improve it further. I'm still very new at all of this.
Thanks in advance
Donn

20
Web Server - Ask For Help / Missing Conditional Compilation Symbols
« on: April 15, 2021, 10:27:54 AM »
My NetTalk server app uses quite a few conditional compilation symbols, most of which are (mercifully) handled for me.

See attachment

But from time to time, for no reason I can determine, all these symbols disappear. The entire set, including FM2=>1 which FileManager3 needs.

I was editing an embed, which I saved, and then I clicked "Start without Debugger (Builds solution)" and poof! All gone and the build failed because FM2=>1 was missing.

Am I doing something wrong? Is this a known bug in C11? In NT 12?

21
Web Server - Ask For Help / Access-Control-Allow-Origin issues
« on: March 06, 2020, 03:15:41 AM »
Hi all, I am having a problem with Access-Control-Allow-Origin

I took the sample NetTalk Login code, and made a few cosmetic changes to reflect the name of my project, and built it and shipped it to a live server. See
http://kgoffice.co.za which instantly and gracefully redirects the user to https://kgoffice.co.za
Perfect!

If I use https://websniffer.cc/?url=https://kgoffice.co.za/ it shows (amongst other things in the header)
Code: [Select]
Access-Control-Allow-Origin: *which is correct, and the default.

However a lot of security review programs and websites complain that Access-Control-Allow-Origin should not be set to "*" but should be set to https://kgoffice.co.za

I tried changing it in the live server settings. See attachment ServerSettings.jpg
But this hasn't changed anything. https://websniffer.cc/?url=https://kgoffice.co.za/
still shows the Access-Control-Allow-Origin header as "*", even after closing the server and starting it again.

What should I be doing differently?


22
Web Server - Ask For Help / Setup for MultiSite
« on: January 29, 2020, 08:57:22 AM »
Hi all, this is my first post
I have watched Don Ridley's presentation on ClarionLive #527 about setting up a MultiSite host, but I just want to check and make absolutely sure.

I am setting up a cloud server at HostAfrica (hostafrica.co.za) and I want to host two NetTalk apps on the same box.

The first one will be at https://kgoffice.co.za and is for office admin on a PC or laptop.
The second one will be https://kgon.co.za and is a mobile app

Please confirm that both domains can use the same IP address, and that I won't have to buy a second static IP?

Also, please confirm that Windows 2009 should NOT have IIS installed. Hopefully I can block all incoming traffic except for port 443. Any other services I can disable?

If I am using basic authentication, do I need to create a Windows user and password for each website user, or does NetTalk manage the basic authentication for me?

Thanks in advance
Donn

Pages: 1 [2]