Subject AlterUser - new possibilities
Author Lucas Sroka
Hello

I just want to share my new discovery to Interbase and IBObjects - please
don't laugh at me If it's already well known solution :

As You know sometimes it's necessary to allow users change their passwords
without SYSDBA intervence.
IB_Connection has very interesting method AlterUser - but if you try to call
it and you aren't logged as SYSDBA there is an exception - it's part of
server security. Only SYSDBA is allowed to alter USERS table in isc4.gdb.
But if you grant UPDATE for table USERS to PUBLIC and add following 'before
update' trigger for USERS table :
IF (USER <>'SYSDBA') THEN
IF (USER<>OLD.USER_NAME)
THEN EXCEPTION E_ABORT;
then every user will be able to change his and only his password.
I verified it and
AlterUser(uaModifyUser,Connection1->Username,password,"","","","");
works fine !
If you want to preserve GroupName, and FIRST Middle and LastName fields just
add some code to above trigger like :
if LAST_NAME='' then NEW.LAST_NAME=OLD.LAST_NAME;

greeeeeeetings

Lucas Sroka