I believe it will no longer work on the login page because the DBNAME constant is already loaded.
Unfortunately, constants are constants. They cannot be deleted.
It might help to play around with the constant definition = disable the original definition and create your own according to the user organization.