summaryrefslogtreecommitdiff
path: root/lib/kolab_api_service.php
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-04-11 12:49:01 (GMT)
committerAleksander Machniak <alec@alec.pl>2013-04-11 12:49:01 (GMT)
commitacddf93a9ff407eae3c5216d134e5f0a42ff05f9 (patch)
tree0b6cc77190657169b82faee97391bc227aad1be0 /lib/kolab_api_service.php
parent230412594a66265950999402d2992286b6e152c7 (diff)
downloadkolab-wap-acddf93a9ff407eae3c5216d134e5f0a42ff05f9.tar.gz
Slightly improve resource type detection
Diffstat (limited to 'lib/kolab_api_service.php')
-rw-r--r--lib/kolab_api_service.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/kolab_api_service.php b/lib/kolab_api_service.php
index 4c99d81..206a2b9 100644
--- a/lib/kolab_api_service.php
+++ b/lib/kolab_api_service.php
@@ -182,7 +182,7 @@ abstract class kolab_api_service
Log::trace("\$object_class not in \$ref_class (" . $elem['key'] . "): " . implode(", ", $_object_class));
Log::trace("\$ref_class not in \$object_class (" . $elem['key'] . "): " . implode(", ", $_ref_class));
- Log::trace("Score for $object_name type " . $elem['name'] . ": " . $elem_score . "(" . $commonalities . "/" . $differences . ") " . $elem_keys_score);
+ Log::trace("Score for $object_name type " . $elem['name'] . ": " . $elem_score . " (" . $commonalities . "/" . $differences . ") " . $elem_keys_score);
// Compare last and current element score
if ($elem_score > $type_score || ($elem_score == $type_score && $elem_keys_score > $keys_score)) {
@@ -196,8 +196,7 @@ abstract class kolab_api_service
if ($object_name == 'resource') {
//console("From database", $elem);
//console("Element key is " . $elem['key'] . " and \$attributes['mail'] is " . $attributes['mail']);
-
- if (strstr($attributes['mail'], "-" . $elem['key'] . "-")) {
+ if (strpos($attributes['mail'], 'resource-' . $elem['key'] . '-') === 0) {
$type_id = $idx;
$type_score = 10;
}