squdo
Posts: 16
Joined: Thu Jan 31, 2008 10:25 pm
Location: Poland

How add VehicleTracker user to BuddyTracker

Thu Mar 13, 2008 4:13 pm

How add VehicleTracker user to BuddyTracker.
But I want to add this user without admin rights.

I need this because I want allow users to see ony their own position because if user login to VehicleTracker he see all users position

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

RE: How add VehicleTracker user to BuddyTracker

Thu Mar 13, 2008 5:47 pm

This is possible to do. GpsGate Server supports the possibility to include a user in several applications with different rights in each application. This opens up for many possibilities including the one you mention above.

However the only web interface we have to this right now is the possibility to add an administrator to several application, you can however add users in other ways, but it will require direct database access.

Here is how to do it.

First add a Vehicle to one VehicleTracker application. Let's say the Vehicle's username is "dual".

Now you need to open a MySQL shell, so you can write SQL commands directly to the database.

First enter:
<font face="Courier New">SELECT * FROM applications;</font id="Courier New">

A list of all applications on your server is shown. In the first column application_id is displayed. Remember the application_id for the BuddyTracker application you want to add the vehicle "dual" to. In our example this is 6

Now we should add a group which is linked to the BT application. You do this with this SQL command

<font face="Courier New">INSERT INTO groups (group_name, group_description, bo_type, application_id, created) VALUES('Dual buddy list', 'Some description', 'GpsGate.BuddyTracker.BTBuddyGroup', 6, '2008-03-13 13:29:00');</font id="Courier New">

(Note! Each new group needs a unique name.)
To find out which group_id the new group got, we execute:
<font face="Courier New">SELECT * FROM groups WHERE group_name = 'Dual buddy list';</font id="Courier New">

And we need to find out the user_id for "dual", using this command:
<font face="Courier New">SELECT * FROM users WHERE username = 'dual';</font id="Courier New">

As a final step we should add a link between the user and the new group. We do it like this:
<font face="Courier New">INSERT INTO user_groups (user_id, group_id, group_right_id, admin_right_id) VALUES (7, 13, 2, 1);</font id="Courier New">

Where 7 is the user_id returned in the second select query above.
And 13 is the group_id returned from the first select query above.

Now you can login with user "dual" to BuddyTracker. "dual" will still not be able to login to VehicleTracker since the user only have vehicle rights and not operator rights in VT.

(We will probably add better support for this kind of one user - multiple applications - in coming versions of GpsGate Server).

Regards,
Johan

Franson Support

squdo
Posts: 16
Joined: Thu Jan 31, 2008 10:25 pm
Location: Poland

RE: How add VehicleTracker user to BuddyTracker

Thu Mar 13, 2008 8:13 pm

Great It works.
But I'm not sure, this probably takes one buddy tracker license

Maybe You have Idea haw remove from menu in buddy tracker: Invite, Group,Preferences, Administraction Panel.

This will probably solve my problems

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

RE: How add VehicleTracker user to BuddyTracker

Thu Mar 13, 2008 8:29 pm

The "Administrator Panel" is only shown for admin users, and not normal users.

To remove the other menu items you will need to edit the aspx-pages. If you do edit the aspx pages the changes will be overwritten when you upgrade to the next GpsGate Server release. This means you need to backup your changes, and re-apply them after your upgrade.

Regards,
Johan

Franson Support

squdo
Posts: 16
Joined: Thu Jan 31, 2008 10:25 pm
Location: Poland

RE: How add VehicleTracker user to BuddyTracker

Thu Mar 13, 2008 9:53 pm

My knowlege about web programing isn't good. I checked .aspx pagegs and can't found oe them menu.
It's look that shape of menu is take from diferent central file

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

RE: How add VehicleTracker user to BuddyTracker

Fri Mar 14, 2008 11:40 am

If you cannot make changes in the aspx files, maybe you need to live with the way they look today.

I have noted the request of disabling some menus, I will see what we can do in coming versions of GpsGate Server.

Regards,
Johan

Franson Support

squdo
Posts: 16
Joined: Thu Jan 31, 2008 10:25 pm
Location: Poland

RE: How add VehicleTracker user to BuddyTracker

Sun Mar 16, 2008 10:19 pm

A found settings for menu in .master file and it worsk good

Can You write how to remove user added this way from buddy tracker

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

RE: How add VehicleTracker user to BuddyTracker

Mon Mar 17, 2008 12:19 pm

If you login as Admin in BuddyTracker you can delete users. If the user is memeber of many applications it will only be removed from the one and tracks etc. will not be removed. If the user is only memeber of one application, all user data including tracks will be removed.

Regards,
Johan

Franson Support

squdo
Posts: 16
Joined: Thu Jan 31, 2008 10:25 pm
Location: Poland

RE: How add VehicleTracker user to BuddyTracker

Mon Mar 17, 2008 12:39 pm

I tried to do this before writing this post. But when I login on Administrator to BuddyTracker I see other people in Administration Panel but there isn't "dual"

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

RE: How add VehicleTracker user to BuddyTracker

Mon Mar 17, 2008 10:20 pm

It seems like the search feature in BuddyTracker Administration Panel does not work when the email or surname field is set to NULL, and those fields are set to NULL when creating a vehicle.

To solve this we need to make one more SQL command

Code: Select all

UPDATE users SET email = 'dual@something.com', surname = 'surname' WHERE username = 'dual';
Now the search feature will work in BT. And you will be able to delete "dual".

Regards,
Johan

Franson Support

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