forked from extern/egroupware
Optimized Funambol recognition
This commit is contained in:
parent
946ecb41b2
commit
ed519fda33
@ -240,12 +240,16 @@ class Horde_SyncML_Command_Put extends Horde_SyncML_Command {
|
||||
|
||||
$ua = $_SERVER['HTTP_USER_AGENT'];
|
||||
|
||||
if (preg_match("/^\s*Funambol (.*) [^\d]*(\d+\.?\d*)[\.|\d]*\s*$/i", $ua, $matches)) {
|
||||
// Funambol uses the hardware Manufacturer we don't care about
|
||||
if (($pos = strpos($ua, 'Funambol'))!== false) {
|
||||
$this->_deviceInfo['manufacturer'] = 'Funambol';
|
||||
$this->_deviceInfo['model'] = 'generic';
|
||||
$this->_deviceInfo['softwareVersion'] = 3.1; // force special treatment
|
||||
$type = substr($ua, $pos + 9);
|
||||
if (preg_match("/^(.*) [^\d]*(\d+\.?\d*)[\.|\d]*\s*$/i", $type, $matches)) {
|
||||
// Funambol uses the hardware Manufacturer we don't care about
|
||||
$this->_deviceInfo['model'] = trim($matches[1]);
|
||||
$this->_deviceInfo['softwareVersion'] = floatval($matches[2]);
|
||||
|
||||
}
|
||||
if (!isset($this->_deviceInfo['deviceType'])) {
|
||||
switch (strtolower(trim($matches[1]))) {
|
||||
case 'pocket pc plug-in':
|
||||
@ -257,6 +261,7 @@ class Horde_SyncML_Command_Put extends Horde_SyncML_Command {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
switch (strtolower($this->_deviceInfo['deviceID'])) {
|
||||
|
Loading…
Reference in New Issue
Block a user