ZoneMinder / zmNinja

High performance, cross platform ionic app for Home/Commerical Security Surveillance using ZoneMinder
http://zmninja.zoneminder.com
Other
1.01k stars 268 forks source link

ZM Authentication settings does not update user restricted monitors #926

Closed exterity closed 4 years ago

exterity commented 4 years ago

Event Server version 5.11.3

Hooks version 5.11.3

The version of zmNinja you are reporting: 1.3.096

The version of ZoneMinder you are using: 1.34.9, Ubuntu 18.04

Platform zmNinja is running on Android 10

What is the nature of your issue Bug

Details

Re-procedure:

  1. Configuring:
  1. Testing:
  1. Press Save once more time, and quit. Re-open zmninja and login as Alice, but the same result.

  2. Remove zmninja, reinstall from Google Play. Reconfigure and login to zmninja by Alice. At this time, Alice can see only Camera1. It works as expected.

As above steps, Alice should only see the Camera1 when updating ZM Authentication on zmninja. Seems that zmninja still keep the credentials for the first logon user.

I do not know if this is expected behaviour on Zmninja or is it a bug.

welcome[bot] commented 4 years ago

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you follow the issue template or I may not respond.

pliablepixels commented 4 years ago

I think the reason this is happening is due to the 24 hr cache. Try this:

  1. Login as Bob, make sure it works
  2. Switch to Alice then clear the Menu->API Cache
  3. Exit app
  4. Restart app and see if Alice looks ok
pliablepixels commented 4 years ago

Oops no, that is not the issue. It's an auth token issue. Will fix.

exterity commented 4 years ago

Just for your information, I tried those steps but it did not work.

pliablepixels commented 4 years ago

I did some basic tests and it seems to be working. Is there a desktop version you use that I can send to test.

exterity commented 4 years ago

Yes, I use Ubuntu Dekstop. Please send me for test. Thank you very much.

pliablepixels commented 4 years ago

https://drive.google.com/open?id=1tBXEVB_5MWahKtva2_muGG9UOLVguUea

exterity commented 4 years ago

Yeah, cool. It works. Thanks for the fix :)

exterity commented 4 years ago

Just a small thing, the "report events" options from Settings -> Event Server of 2 users does not update correctly when switching users. Let says: Bob selected report events for Camera1 and Camera2. Then switch user as Alice. Alice selected report events for Camera1. Switch back to Bob, this time Bob only see the Camera1 selected, but not Camera2. It can cause missing event report whenever switching users.

exterity commented 4 years ago

and the Montage view does not show camera correctly for Bob (only show Camera 1) when switch back to Bob from Bob -> Alice -> Bob. Bob has to select profile "all monitors" again to view all cameras.

pliablepixels commented 4 years ago

Yes, so two things:

a) It may just be better for you to create two server profiles "bob" and "alice" instead of manually switching auth. Then the montage profiles etc will work (all data is scoped inside the server name). H

b) The ES is another story altogether. It does not keep a record of the username - it only remembers the device token. So even if Bob and alice are switching, it will consider it a single device. Fixing this will require an ES side re-architecture of data format. You might want want to list that aspect as a separate issue and I'll get to it (but not soon)

exterity commented 4 years ago

I see. Thank you very much for the quick fix.