Articles with the tag:
Close
Changelog
Close
Try in the cloud
Try in the cloud

Managing Active connections

Admin

Logged into the portal from another device, but then forgot to log out? You can manually close a specific user's active session.

Note: the list of active connections is available only for your profile, and only connections of your profile can be logged out.

Bare Bones Instructions

Perform these simple steps to close a particular session:

  1. Enter your portal.
  2. Go to your Profile page in the upper right corner.
  3. Find the Active connections section. Click the Show button to open the list of all active connections of this user.
  4. Find the needed connection and click on the Delete icon icon located on the right.
  5. Confirm the action.

The selected connection will be stopped and excluded from the list. After that, the user will need to enter credentials once again to log in to the portal from the same device.

The list of each active connection contains the following data: Operating system, Browser, Time and date IP-address, and Location.

Active connections list

If you are using the server version, location detection is not available by default. To enable this feature, please follow the steps described in the Enabling location detection for the server version section.

In order to close all active connections:

  1. Enter your portal.
  2. Go to your Profile page in the upper right corner.
    • Click on the Log out from all active connections in the Active connections section.

      or

    • Click the Actions icon icon next to the username and select the Log out from all active connections item from the drop-down list. This option can only be applied by administrators to profiles of other users.
  3. The Log out from all active connections window will appear:

    Log out from all active connections

    • Click the Log out and Change password button to log out all connections and start the password change procedure.
    • Click the Log out button to log out all connections.

Helpful Hints

Why can't I find the 'Log out from all active connections' item in the 'Actions' Actions icon menu next to the user's name?

The 'Log out from all active connections' function using the 'Actions' menu can only be applied to other users. To sign out of all connections for your profile, open the 'Active connections' section and click the 'Log out from all active connections' button.

Enabling location detection for the server version

If you are using the server version, location detection is not available by default. To enable this feature, please follow the steps below.

Chapter 1

To determine the location by IP address, you need to fill in the `onlyoffice`.`dbip_location` table with data in the database.

The table has a specific data format.

To display location in the Active connections section, it's necessary to fill in the following columns:

  • `addr_type` - the type of the IP address.
  • `ip_start` - the beginning of the IP addresses range.
  • `ip_end` - the end of the IP addresses range.
  • `country` - the country code in the ISO-3166-alpha2 format.
  • `city` - the locality name.

The type of the IP address has two possible values: "ipv4" or "ipv6".

The IP addresses range is specified in an extended format containing empty positions:

  • "127.0.0.1" must be extended to "127.000.000.001";
  • "::1" must be extended to "0000:0000:0000:0000:0000:0000:0000:0001".

The country code is specified as a two-letter abbreviation (e.g., "AU", "US", "JP", etc.) The "ZZ" value is ignored (Unknown or unspecified country).

dbip_location table

Chapter 2

The data for filling in the `onlyoffice`.`dbip_location` table can be taken anywhere.

Following the instructions from Chapter 1, you can add records to the table in any accessible and convenient way.

There are a lot of services which provide information on the geolocation of IP addresses. Most of these services allow to download information in the .csv format.

As an example, we will use the https://db-ip.com/ service.

Download the free base in the .csv format. Use the following command replacing {year} and {month} with the current year/month, e.g. 2022 and 08:

wget https://download.db-ip.com/free/dbip-city-lite-{year}-{month}.csv.gz

Unpack the archive. Use the following command replacing {year} and {month} with the current year/month, e.g. 2022 and 08:

gzip -dk dbip-city-lite-{year}-{month}.csv.gz

Chapter 3

To facilitate data transfer, we have written the IpGeolocationConverter utility that converts the source data from the .csv file into a format specific for us.

The source code of the utility can be found on GitHub.

Building and running the executable

OS Windows

You can use Visual Studio or MSBuild in the console for building the executable. .NET Framework 4.8 Developer Pack is also required.

Download the utility, go to the directory, run MSBuild.exe specifying the project file:

"%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe" IpGeolocationConverter.csproj

Run the .\bin\Debug\IpGeolocationConverter.exe file.

OS Linux

You can use mono for building the executable. If ONLYOFFICE is already installed, mono is present either on the host or in the CommunityServer container.

Download the utility, go to the directory, run specifying the source code file:

mcs -out:IpGeolocationConverter.exe Program.cs

Run the mono IpGeolocationConverter.exe file.

Alternatively, you can build the entire project using xbuild IpGeolocationConverter.csproj and run the mono bin/Debug/IpGeolocationConverter.exe file.

Once the executable file is launched, you will be prompted to enter the path to the .csv file containing data.

Then you will be prompted to enter the numbers of columns in the file which correspond to the certain data.

If you are using the IpGeolocationConverter.exe utility and a database downloaded from db-ip.com, it's recommended to specify numbers of columns as they shown on the image below:

IpGeolocationConverter

As a result, a new file containing data specific for us will be created in the directory with the specified .csv file.

Chapter 4

The output .csv file containing data must be imported to the `onlyoffice`.`dbip_location` table in the database.

Importing csv to the database

OS Windows + HeidiSQL

Open HeidiSQL.

Connect to the ONLYOFFICE MySQL database. To do that, enter the following data:

  • Hostname: ONLYOFFICE Domain or IP address
  • User: root
  • Password: onlyoffice
  • Database: onlyoffice

Then press Open.

Specify the ON value for the local_infile setting.

HeidiSQL HeidiSQL

Choose the Tools -> Import CSV file... menu item. Select the output file, the table, specify the encoding, separators ('Lines terminated by') and fields. Uncheck the 'id' and 'processed' columns.

HeidiSQL HeidiSQL

Click the Import button.

OS Linux + command line (ONLYOFFICE Docker version)

Copy the file containing data to the container:

docker cp ./converteddbip-city-lite-2022-05.csv onlyoffice-mysql-server:/tmp/dbip.csv

Enter the container:

docker exec -it onlyoffice-mysql-server bash

Connect to mysql:

mysql --local-infile=1 -u root -pmy-secret-pw

Make sure that the local_infile setting has the ON value. Otherwise, you'll get the following error: 'ERROR 3948 (42000): Loading local data is disabled; this must be enabled on both the client and server sides'.

SHOW GLOBAL VARIABLES LIKE 'local_infile';

If not, set this value:

SET GLOBAL local_infile = true;

Select the database:

use onlyoffice;

Execute the request:

load data local infile '/tmp/dbip.csv'
into table dbip_location
character set utf8
fields terminated by ','
enclosed by '"'
lines terminated by '\n'
(addr_type, ip_start, ip_end, country, stateprov, district, city, zipcode, latitude, longitude, geoname_id, timezone_offset, timezone_name);
Note Depending on your operating system, the terminated by parameter may differ: '\n' or '\r\n'.
Try now for free Try and make your decision No need to install anything
to see all the features in action
You Might Also Like This:
Close