1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-30 19:52:17 +01:00

Merge branch 'contacts_backends' of github.com:owncloud/apps into contacts_backends

This commit is contained in:
Thomas Tanghus 2013-04-09 23:20:11 +02:00
commit 4bb6662b25
2 changed files with 7 additions and 3 deletions

View File

@ -186,6 +186,10 @@ Class Properties {
);
}
public static function generateUID($app = 'contacts') {
return date('Ymd\\THis') . '.' . time(). '@' . OCP\Util::getServerHostName();
}
/**
* Update the contact property index.
*

View File

@ -25,7 +25,7 @@
namespace OCA\Contacts\VObject;
use OCA\Contacts;
use OCA\Contacts\Utils;
use Sabre\VObject;
/**
@ -57,7 +57,7 @@ class VCard extends VObject\Component\VCard {
*/
protected function formatPropertyTypes(&$property) {
foreach($property->parameters as $key=>&$parameter) {
$types = Contacts\Utils\Properties::getTypesForProperty($property->name);
$types = Utils\Properties::getTypesForProperty($property->name);
if(is_array($types) && in_array(strtoupper($parameter->name), array_keys($types))
|| strtoupper($parameter->name) == 'PREF') {
unset($property->parameters[$key]);
@ -199,7 +199,7 @@ class VCard extends VObject\Component\VCard {
'node' => $this,
);
if ($options & self::REPAIR) {
$this->UID = substr(md5(rand().time()), 0, 10);
$this->UID = Utils\Properties::generateUID();
}
}