NetTalk Central

Author Topic: How to store "global" Config data  (Read 4905 times)

tglomb

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • AObit Software
    • Email
How to store "global" Config data
« on: March 22, 2014, 07:04:49 AM »
I need to store some global values a user configured in a session so that the next time he uses the program it must not be done again. These values must be persistent for ever and some of these values I must read out at the very first possible point, before any website is openend, especially before the Login. This is like having an Ini file/registry setings for Win32 progs which I read out at mainframe procedure setup embed.

These values are workingplace/device related, because some of it I must use before the program knows which user has logged in.
So, how to Cookie it ? Which embeds I must use ? Any hints and ideas are appreciated.
TIA. Ciao Thomas

terryd

  • Hero Member
  • *****
  • Posts: 759
    • View Profile
    • Davcomm
    • Email
Re: How to store "global" Config data
« Reply #1 on: March 23, 2014, 12:45:41 AM »
HI. How would you know who the user was before the login?
Terry Davidson
Windows 10 64 bit/Windows7 64bit
Clarion 9.1.11529/Clarion10 12567
Nettalk 913
Nettalk 1015
StringTheory267/Winevent515/XFiles298/MessageBox239/Cryptonite186

tglomb

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • AObit Software
    • Email
Re: How to store "global" Config data
« Reply #2 on: March 23, 2014, 01:45:05 AM »
I neeed to "remember" some config values on a per device basis which are equal for all users working at that device.
Ciao Thomas

peterH

  • Sr. Member
  • ****
  • Posts: 413
    • View Profile
Re: How to store "global" Config data
« Reply #3 on: March 23, 2014, 02:51:57 AM »
Could you store by ip,  mac, computername or some other id depending on your setup and environment?

Peter

Robert Iliuta

  • Sr. Member
  • ****
  • Posts: 472
    • View Profile
    • Email
Re: How to store "global" Config data
« Reply #4 on: March 23, 2014, 03:33:47 AM »
>I neeed to "remember" some config values on a per device basis which are equal for all users working at that device.

you need to store computer name or mac address for this and then compare when login user.

/Robert

tglomb

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • AObit Software
    • Email
Re: How to store "global" Config data
« Reply #5 on: March 23, 2014, 05:01:00 AM »
Hi Peter and "I Robot" (sorry, couldnt resist..)
good idea to have a table in the dict which holds these globals. Thanks. The MAC address would be the unique identifier for a device.
But which is the very first embed at which I can read out the MAC and then get the record with the device globals BEFORE anything else happens ? That means directly after a user typed in the IP, hits [Enter] to start the Web program und the first request tooks place.
Dumb question: hase every Internet aware devive a MAC (i and Android Phones ect.) ?
I wished I could store a good ol' CFG file at the devices..
TIA, Thomas

peterH

  • Sr. Member
  • ****
  • Posts: 413
    • View Profile
Re: How to store "global" Config data
« Reply #6 on: March 23, 2014, 08:24:44 AM »
>I wished I could store a good ol' CFG file at the devices..

Well, you can, sort of. But to do so you'll have to study how to use SQLite. That's a selfcontained db that can be used on all the devices you mention. And Clarion has support for that.
I have no personal experience but it should definitely be doable.

Peter

tglomb

  • Jr. Member
  • **
  • Posts: 79
    • View Profile
    • AObit Software
    • Email
Re: How to store "global" Config data
« Reply #7 on: March 23, 2014, 10:09:45 AM »
Cool idea, thanks Peter

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: How to store "global" Config data
« Reply #8 on: March 23, 2014, 10:20:52 PM »
You could set a cookie on the device, and then with every request sent from the device the cookie will come too.
see
http://www.capesoft.com/docs/NetTalk8/NetTalkWebBasic.htm#Cookies