Passed
Push — master ( a034e0...fb1aac )
by
unknown
03:23
created

ConnectionTracking::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 8
rs 10
c 1
b 0
f 0
1
<?php
2
3
/*
4
 * SPDX-License-Identifier: AGPL-3.0-only
5
 * SPDX-FileCopyrightText: Copyright 2020-2025 grommunio GmbH
6
 */
7
8
class ConnectionTracking extends InterProcessData {
9
	/**
10
	 * Constructor.
11
	 */
12
	public function __construct() {
13
		// initialize super parameters
14
		$this->allocate = 0;
15
		$this->type = "grommunio-sync:connections";
16
		parent::__construct();
17
18
		// initialize params
19
		$this->initializeParams();
20
	}
21
22
	/**
23
	 * Initialize the current request.
24
	 *
25
	 * @return bool
26
	 */
27
	public function TrackConnection() {
28
		// use the email address here
29
		self::$user = Request::GetUserIdentifier();
30
31
		$connectiontracking = ["starttime" => self::$start, "pid" => self::$pid, "command" => Request::GetCommand()];
32
33
		return $this->setDeviceUserData($this->type, $connectiontracking, self::$devid, self::$user, $subkey = -1, $doCas = "replace");
34
	}
35
}
36