* Start Update *
This functionallity is now better done using "UserSync".
* End Update *
The information below is not recommended for use
GUIDE: Add all users to one VehicleTracker
Sometimes you have a large number of VT applications and you want one place with overview of all users.
To add all users in the system to one VT application as vehicles follow those steps:
1. First create one new VT application in SiteAdmin. Remember the appID.
2. Run this query to get the group_id to add users to. "appID" is the new VT applications database ID.
SELECT group_id FROM groups WHERE application_id = appID and group_name = 'Vehicles';
3. Execute this insert statement to add all users as vehicles to the VT application. Where GROUP_ID is the number you got from the select query above.
INSERT INTO user_groups (user_id, group_id, group_right_id, admin_right_id)
(SELECT user_id, GROUP_ID, 7, 2 FROM users u WHERE NOT u.user_id IN
(SELECT user_id FROM user_groups ug2 WHERE ug2.group_id = GROUP_ID));
4. If you want the vehicles to be part of Event Rules in the overview application, make sure they are member of a Role with _DeviceLogin. E.g. the _Unit Role.
You can execute this query any number of times. When you add a new user to your server you can execute the INSERT statement again.
You can now login to your VT application and see all users. You can create tags, views and even event rules that are separate to this application. However the device mapper is common for all applications for one device (that belongs to a user).
f you do have a large number of vehicles you should use tags + views to group them in a suitable way.
How to move users between applications, and how to add users to multiple applications