9 * @author Christian Weiske <cweiske@cweiske.de>
10 * @copyright 2014 Christian Weiske
11 * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
12 * @link http://cweiske.de/grauphel.htm
14 namespace OCA\Grauphel\Lib;
17 * Client identification helper
21 * @author Christian Weiske <cweiske@cweiske.de>
22 * @copyright 2014 Christian Weiske
23 * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
24 * @version Release: @package_version@
25 * @link http://cweiske.de/grauphel.htm
29 public function getClient()
31 if (isset($_SERVER['HTTP_X_TOMBOY_CLIENT'])) {
32 $client = $_SERVER['HTTP_X_TOMBOY_CLIENT'];
33 $doublepos = strpos($client, ', org.tomdroid');
34 if ($doublepos !== false) {
35 //https://bugs.launchpad.net/tomdroid/+bug/1375436
36 //X-Tomboy-Client header is sent twice
37 $client = substr($client, 0, $doublepos);
45 public function getNiceName($client)
47 if (substr($client, 0, 12) == 'org.tomdroid') {
48 //org.tomdroid v0.7.5, build 14, Android v4.4.2, innotek GmbH/VirtualBox