User avatar
johan
GpsGate
Posts: 14887
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

GUIDE: Add all users to one VehicleTracker

Thu May 07, 2009 5:40 pm

* Start Update *

This functionallity is now better done using "UserSync".

http://gpsgate.com/blogComment/usersync_plugin

* 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.

Related Topics

How to move users between applications, and how to add users to multiple applications
topic.asp?TOPIC_ID=14119

Regards,
Johan

Franson Support

User avatar
johan
GpsGate
Posts: 14887
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: GUIDE: Add all users to one VehicleTracker

Sat May 29, 2010 4:39 pm

Here is another approach to the same thing, that does not require any SQL query to be executed, but involves some more work to administrate

You have one main VehicleTracker (VT) application where all vehicles are. Let's call that application "Main VT". And let's assume we have an administrator in "Main VT" called "AdminVT". When you add new vehicles you add them to "Main VT". Then you log into SiteAdmin and create a new VehicleTracker, let's call this application "User VT". To "User VT" you add the vehicle as administrator.

Here is the step by step instruction:
1. Add a new Vehicle to "Main VT".
2. Log out, and then log into SiteAdmin
3. Go to "Add new application" and add a new VehicleTracker application which you name after the vehicle name.
4. Add an existing user as administrator to the new application. Select the vehicle you created in step 1.
5. Now go to "Application management" and select the new application.
6. You can optionally add one more (existing) administrators to the new application. The best choice would be the "Main VT" administrator, which we call AdminVT.
7. (Optionally) Set the limit to maximum 2 users in the new application.

Now we have one new application "User VT" where the vehicle will see himself only. And one "Main VT" application where all vehicles are members.

8. Now log in to the new "User VT" with your AdminVT user and change the rights for the vehicle from administrator to operator.

Now the vehicle login cannot make any changes to his application, only view his data. And the vehicle login can only log into "his" application instance and not to "Main VT".

Some things to note:
-> You can use one user to be administrator in all applications.
-> You can use this method to make a user/vehicle member of any number of applications. All applications will share the same track data (but not events).
-> The user/vehicle can have different rights in each application.

Regards,
Johan

Franson Support

GRACO
Posts: 488
Joined: Mon Sep 01, 2008 8:19 am

RE: GUIDE: Add all users to one VehicleTracker

Tue Jun 14, 2011 5:28 am

Hello there.
When using 3.0.0.2583 I cannot find the checkbox of admin in step 8.

I want to add 3 vehicles to an application called "demo", these 3 vehicles already exist in other application.

For now, the 3 vehicles are included in the application "demo", but in the Site Admin I see them as Administrators and I want to remove this status.

Inside the application are not administrators, they are Operator.

How do I remove them from administrators in Site Admin without deleting them from the application?

regards!

User avatar
johan
GpsGate
Posts: 14887
Joined: Wed Aug 04, 2004 10:40 pm
Location: Sweden
Contact: Website

RE: GUIDE: Add all users to one VehicleTracker

Tue Jun 14, 2011 10:40 am

> in the Site Admin I see them as Administrators and I want to remove this status.

Yes, but this is a GUI bug only. They are not _Administrators

Regards,
Johan

GpsGate Support

GRACO
Posts: 488
Joined: Mon Sep 01, 2008 8:19 am

RE: GUIDE: Add all users to one VehicleTracker

Sun Aug 14, 2011 10:08 pm

Is there a way to "delete" the admin user in the Admin site without deleting from app?

Return to “GpsGate Server - How to setup and use”