In a message dated 99-03-11 12:50:34 EST, you write:
These are the basic values:
1 = Enabled 2 = Locked 4 = No offline logon 8 = Cannot change
password 32 = Realtime user rights update 64 = Cannot delete documentThe others are made of combinations of these - for example 33 is 32 and 1,
77 is 64, 8, 4 and 1.
The answer given previously is certainly correct. However, the best way to
decipher values is to realize that these settings are nothing more than binary
“bits” displayed using a single numeric value. There is a reason why the base
settings listed above are all powers of two! Rather than try all variations of
math to figure out just how BusObj arrived at a status of 97, try the
following.
If you see a status number and cannot figure out what the settings are,
convert that status number to binary and simply look for the bits that are
“on” (set to 1) and refer to the listing below. In binary mode, you will see
values of only 1 or 0 (zero). For example, a user that is enabled, cannot log
in offline, and cannot change a password will be 00001101 or 1+4+8=13.
1 = Enabled (first bit on or 00000001)
2 = Locked (second bit on or 00000010)
4 = No Offline Login (third bit on or 00000100)
8 = No Password Change (fourth bit on or 00001000)
16 = not documented, perhaps reserved for future use?
32 = Real Time Updates (sixth bit on or 00100000)
64 = Cannot Delete Documents (7th bit or 01000000)
128 = Password Invalidated (8th bit or 10000000)
In other words, to truly identify users that have logins that are disabled,
you should look for this value being greater than or equal to 128, not simply
equal to 128. In a previous post, a user asked about the distinct values found
in their database of:
The distinct codes I found in my table are: 1, 33, 65, 77, 97, 128,
Using the Windows Calculator I enter a decimal value of 97, then switch to
binary display mode. This gives me 01100001 for the bit settings. I then can
decode this to be: Enabled (bit 1), Real Time Update (bit 6) and Cannot Delete
Documents (bit 7). For the value of 160, the binary bit flags are 10100000,
resulting in Real Time Updates (bit 6) and Password Invalidated (bit 8). If
you are wondering how to convert to binary using Windows Calculator, look
under the “View” menu and select Scientific. Enter your code in Decimal, then
switch to Binary mode. Be carefull! Count the digits! If you don’t see 8 bits,
then all of the leading positions should be set to zero.
If you are wondering why they use a scheme like this, bitwise math is a fast
way to determine if a user is enabled or any other setting. In this way they
(BusObj programmers) can use a single field to store up to 8 different codes
in any combination of values.
In tables in the repository where only one value is allowed, then they simply
store a value from 1 to “n”, where “n” is the number of possible (singular)
settings. For example, the Repository Type (a repository can be one of either
Universe, Document, or Security, but not two or more at the same time) is
listed as 1 = Master (Security), 2 = Universe, 3 = Documents.
Another example of a multi-code column in the repository is the User Type. A
user can be a user, a supervisor, a designer, or any combination of the three.
To allow for this, the M_ACTL_N_ACTORTYPE column has these values:
Group (rather than individual user) = 1
General Supervisor = 2
Supervisor = 4
Designer = 8
Normal User = 16
Document Agent = 32
So a user configured as a Supervisor / Designer would be 12 (4+8) and would be
displayed in binary mode as 00001100. To determine if a user is a supervisor,
a bit operation of AND would be done:
00000100 AND user_settings, or, in otherwords
00000100 AND 00001100 returns 00000100, showing that the user does have
supervisor rights. (AND returns 1 only if the same bit is “on” in both
values.) Knowing how to interpret the bit “flags” keeps you from having to
code for every possible combination of values… something that will come in
useful for the “Repository Universe” project.
Regards,
Dave Rathbun
Integra Solutions
www.islink.com
Listserv Archives (BOB member since 2002-06-25)