Message to disabled user

Turbovix2 months ago

Friends, is it possible to show a message to the disabled user when he tries to log in?

Anton Tananaev2 months ago

You mean customize the message? No, we don't support it.

Turbovix2 months ago

Hi Anton, the idea was that if a user was disabled and tried to log in, it would appear to him, for example: Contact finance.

Ashok Chandra2 months ago

@turbovix it's good idea, I think this option be a part of Traccar.

RastreameMX2 months ago

@Turbovix

Sounds easy, just need to modify your web template to 'interpret' unauthorized response from API, and display custom message you need.

Ashok Chandra2 months ago

@educracker explaining in words is easy. Can you provide a updated class that we require to change.

Thanks in advanced

Turbovix2 months ago

@RastreameMX I don't believe this is the solution, since a message about the financial issue would appear for any user who was disabled regardless of the reason.

Turbovix2 months ago

I think the correct way would be to have a field for a personalized message with the possibility of activating/deactivating it in each user account, and every time the user logs into the system a popup would show that message.

Ashok Chandra2 months ago

I have check the code and found this is possible to display the msg for disabled users.
Once it's ready I will share the ip.

I also required more options suggestions that we can implement on traccar.

Please share your idea what you want more on traccar.

RastreameMX2 months ago

@turbovix The way i gave you is one possible solution, not ideal, because it would work as "generic" unauthorized message.

Because the traccar api does not differentiate between "disable modes", the only way I can think of doing it is through one user flag on user attributes. And even with the flag, the tricky part is in how to "obtain" those attributes when the user is deactivated.

In our instance, we are currently doing some similar, displaying a message bar (yellow or red) to users that have some pending balance, it works using user's attributes where we place balance on each user, and type of message to display. But it is shown after user is authenticated. When the user is finally disabled, we show original "unauthorized" message.

Greets.

Ashok Chandra2 months ago

@Turbovix I have implemented the same in the bellow ip you can check here.

You also get the error msg for invalid userid or incorrect password.

disabled user login details
Id: company_1
password: company_1

http://143.198.107.22:8082/login

Turbovix2 months ago

Hello @Ashok, it turned out perfect. Can you share what you did?

Ashok Chandra2 months ago

You need to modify Login page.jsx and server code