Hello,
there is a problem when using databases without boolean fields (like Firebird) for the SecurityManager.
Alternatives may be using fields like int or char. But doing so will cause errors due to the properties settings in the
the uIWEditUserForm.pas and uEditUserForm.pas for enabled-checkbox. On both forms the ValueChecked are set to "true" and ValueUnchecked to "false", which will cause the set string values into the integer or char field in the database. Changing them to "1" and "0" instead seems to work.
Any comments?
Best regards
Matthias
Yes, for databases that do not have boolean fields, using 0 & 1 and map on integer fields should make this work.
I also had to change one line in the code because a disabled user was not noticed even if the value was "0" (uSecControl.pas):
if Fld.DataType = ftBoolean then
begin
if not Fld.AsBoolean then
begin
TriggerDisabledLoginEvent(Username);
Exit;
end;
end
else
begin // in case database does not support boolean fields
if (Fld.AsInteger <> 1) then // this line did not work: (not Fld.AsInteger = 1)
begin
TriggerDisabledLoginEvent(Username);
Exit;
end;
end;
Hi
I have just installed IWsecsystem (5.3.0.0). The Enabled -field is now integer in my Firebird 2.1.5 database and the useradmin-dialog opens nicely from uilSecurityManager-component (smallint is not a good choice...). I can edit, create and delete users. But if I check or uncheck the enabled-field in "Edit User"-form and press OK- or Cancel-button I get an errormessage :
" 'True' is not a valid integer value for field 'ENABLED'. " or " 'False' is not a valid integer value for field 'ENABLED'. "
The code change from the post of Matthias Letzel seems not to be pulished. Anyway it does not have any effect to this behaviour.
Changing the field type of the enabled field to varchar with appropriate length seems to repair that problem...
But now when the type is varchar and value of the enabled field is saved as string, gives normal login an error:
We have send an incremental source update by email. Please retest with this update.
what does your ENABLED field.DataType return?
Each time a login happens, the enabled/visible settings are reapplied.
With this kind of if clause
With the update sent, condition Enabled = true is saved as 1 in an integer field and false is stored as 0.
I cannot see any problem with this here.
If I change the properties ValueChecked and ValueUnchecked in the uIWEditUserForm
That is a solution for a DB that doesn't have a boolean field and maps the boolean to an integer field, but this solution will not work when a real boolean field is used.
So, for DBs that don't have a boolean field available, this change can indeed be done.
yes, short way solution only for me ...
We'll check if we can build-in that solution.