Home

Cardbox

 
Cardbox > Support > Knowledge Base ...

How macro safety settings are stored

When you open a database stored on a server, using the command File > Open > Server, it is given a safety level. Safety levels range from "Completely Trusted" to "Completely Untrusted", and they control what a macro associated with this database is allowed to do. For a random database accessed across the Internet you would probably use "Untrusted" (the default), while for a database that you have designed and are administering yourself, "Completely Trusted" would probably be appropriate. You can read more about safety levels on page 266 of The Cardbox Book and in Help Point 526 from within Cardbox.

The standard way of setting safety levels is to use File > Open > Server. If you want to set safety for a single database, use the drop-down list on the right:

If you want to set safety for all databases on a server, or for all servers, press the Server Safety button and the following window will appear:

How macro safety settings are stored

Cardbox stores macro safety settings in the Windows Registry, in the part of it (HKEY_CURRENT_USER) that holds settings for the currently logged-in Windows user.

This means that:

If you are a network administrator then you may want to set up the macro safety settings for all of your users without necessarily having to go round each computer in turn and open File > Open > Server on each user's system. You can do this by making the appropriate registry settings directly.

In every case, the registry setting for a safety level is a string (in 'regedit' terms, this is type REG_SZ) with the words "Completely Untrusted", "Untrusted", "Trusted", "Highly Trusted", or "Completely Trusted". These strings are always in English even if you are running Cardbox in another language.

"Databases in general"

The "Databases in general" setting is stored as the default value of the registry key:

HKEY_CURRENT_USER\Software\Cardbox\Cardbox 3.0\Macro Safety

"Databases on this server"

The "Databases on this server" setting is stored as the default value of the registry key:

HKEY_CURRENT_USER\Software\Cardbox\Cardbox 3.0\Macro Safety\servername

where "servername" is the name or the IP address of the server. If you think that the same server may be accessed both by name and by IP address, then you must set up a registry key for both. For example:

HKEY_CURRENT_USER\Software\Cardbox\Cardbox 3.0\Macro Safety\localhost

and

HKEY_CURRENT_USER\Software\Cardbox\Cardbox 3.0\Macro Safety\127.0.0.1

Settings for specific databases

The setting for a specific database is stored as a named value of the registry key that represents its server. For example, a database called "Test for Wine" on a server called "superserver" would have its macro safety setting stored in the value named "Test for Wine" within the key

HKEY_CURRENT_USER\Software\Cardbox\Cardbox 3.0\Macro Safety\superserver

Suggested strategy

It is probably easiest to go to one computer (as one user) and use Cardbox's own commands to set up the macro safety levels that you want.

If you have tools that will broadcast registry settings to other users, you can then use those tools.

If you don't, then use Cardbox's command Tools > Management > Save Cardbox Registry Settings to save the entire HKEY_CURRENT_USER\Software\Cardbox\Cardbox 3.0 registry branch to a .reg file, then edit the .reg file manually to remove things other than the macro safety settings. Finally, open the .reg file once on behalf of each user (or get them to do this themselves) so that the settings get added to each user's Windows registry.

© 2016 Martin Kochanski
"Cardbox" is a registered trademark.
 Top of page