Delete Account

greendays2 years ago

When creating/editing a user, we have the option to disable changing the email address without taking away any other permissions. However, I don't see an option to prevent account deletion by the user. Is this by design?

greendays2 years ago

Going thru the code, I noticed if registration is not enabled on the server, it will not allow deleting accounts. Is that how it's supposed to be controlled?

Anton Tananaev2 years ago

Yes.

something similar to this
when i create a user and i delete its account using the same user account the server stops working and i get this error:

Cannot invoke "org.traccar.model.User.check Disabled()" because the return value of "org.traccar.api.security.PermissionsService.getUser(long)" is null - NullPointerException (SecurityRequestFilter:104 < ... < OverrideFilter:50 < ...)

the only possible solution for the service to resume working is to restart traccar
here is the log

2023-08-26 16:24:35  INFO: [T7bc601b2: freedom < 5.104.80.149] 494e56495445207369703a30303137383739313933313833403130342e3235312e3231322e33353a35303636205349502f322e300d0a5669613a205349502f322e302f54435020352e3130342e38302e3134393a31353939383b6272616e63683d7a39684734624b2d3532343238372d312d2d2d613537346434323431393763623831343b72706f72740d0a4d61782d466f7277617264733a2037300d0a436f6e746163743a203c7369703a3130303840352e3130342e38302e3134393a31353939383b6f623b7472616e73706f72743d7463703e3b2b7369702e696e7374616e63653d223c75726e3a757569643a39313041324142362d323234462d333943462d374435392d4239443834363242463746453e220d0a546f3a203c7369703a30303137383739313933313833403130342e3235312e3231322e33353a353036363e0d0a46726f6d3a202231303038223c7369703a31303038403130342e3235312e3231322e33353a353036363e3b7461673d30363633386535350d0a43616c6c2d49443a206f4c43666c377941454b7551377265764f43704258672e2e0d0a435365713a203120494e564954450d0a416c6c6f773a20494e564954452c2041434b2c2043414e43454c2c204f5054494f4e532c204259452c2052454645522c204e4f544946592c204d4553534147452c2052454749535445522c205355425343524942452c20494e464f2c205055424c4953480d0a436f6e74656e742d547970653a206170706c69636174696f6e2f7364700d0a537570706f727465643a207265706c616365732c206f7574626f756e642c20706174680d0a557365722d4167656e743a20506f727453495020566f49502053444b2031312e320d0a416c6c6f772d4576656e74733a20686f6c642c2074616c6b2c20636f6e666572656e63650d0a436f6e74656e742d4c656e6774683a203237330d0a0d0a763d300d0a6f3d2d20343532363338373837203120494e2049503420352e3130342e38302e3134390d0a733d706f72747369702e636f6d0d0a633d494e2049503420352e3130342e38302e3134390d0a743d3020300d0a6d3d617564696f203230303034205254502f41565020302038203138203130310d0a613d7274706d61703a302050434d552f383030300d0a613d7274706d61703a382050434d412f383030300d0a613d7274706d61703a313820473732392f383030300d0a613d666d74703a313820616e6e6578623d6e6f0d0a613d7274706d61703a3130312074656c6570686f6e652d6576656e742f383030300d0a613d666d74703a31303120302d31360d0a613d73656e64726563760d0a
2023-08-26 16:24:49  INFO: [T26365962] timed out
2023-08-26 16:24:49  INFO: [T26365962] disconnected
2023-08-26 16:25:05  INFO: [T7bc601b2] timed out
2023-08-26 16:25:05  INFO: [T7bc601b2] disconnected
2023-08-26 16:27:07  INFO: [T317d84f6] connected
2023-08-26 16:27:07  INFO: [T317d84f6: startek < 184.105.139.69] 3c3f786d6c2076657273696f6e3d27312e30273f3e3c73747265616d3a73747265616d20786d6c6e733a73747265616d3d27687474703a2f2f6574686572782e6a61626265722e6f72672f73747265616d732720786d6c6e733d276a61626265723a636c69656e742720786d6c3a6c616e673d27656e2d55532720746f3d272e272076657273696f6e3d27312e30273e
2023-08-26 16:27:11  INFO: [T317d84f6] disconnected
2023-08-26 16:27:53  INFO: user: 4, action: remove, object: user, id: 4
2023-08-26 16:27:58  INFO: [Ta865a03d] connected
2023-08-26 16:27:58  INFO: [Ta865a03d: freedom < 78.128.114.2] 0300002f2ae00000000000436f6f6b69653a206d737473686173683d41646d696e697374720d0a0100080003000000
2023-08-26 16:28:28  INFO: [Ta865a03d] timed out
2023-08-26 16:28:28  INFO: [Ta865a03d] disconnected
2023-08-26 16:29:51  INFO: [Ted07fa0f] connected
2023-08-26 16:29:51  INFO: [Ted07fa0f: teltonika < 78.128.114.2] 0300002f2ae00000000000436f6f6b69653a206d737473686173683d41646d696e697374720d0a0100080003000000
2023-08-26 16:30:03  INFO: [T9975a5cf] connected
2023-08-26 16:30:03  INFO: [T9975a5cf: navis < 78.128.114.2] 0300002f2ae00000000000436f6f6b69653a206d737473686173683d41646d696e697374720d0a0100080003000000
2023-08-26 16:30:21  INFO: [Ted07fa0f] timed out
2023-08-26 16:30:21  INFO: [Ted07fa0f] disconnected
2023-08-26 16:30:33  INFO: [T9975a5cf] timed out
2023-08-26 16:30:33  INFO: [T9975a5cf] disconnected
Anton Tananaeva year ago
  1. What exactly stops working?
  2. Is this reproducible on a clean server with the latest version of Traccar?

im using traccar version 5.8 windows version and also the same behaviors happen in my vps Linux setup
ps: i did some customization on web modern interface.
1-the traccar service stops working as soon as the user click delete user
2-yes it isreproducible on a clean server with the latest version , all you need to do is register your admin, log out, register another user example test, log in to test, delete test account , you ll be send to the log in page and if you refresh you ll find the server isnt working now,

suggestion: i suggest to you if i may to change to email field to password field in order for a user to delete his account

Anton Tananaeva year ago

OK, I was able to reproduce the issue, but server was not crashing. It's just session was not cleared. You could either clear browser cache or login from a different device just fine. Fixed now.