diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-08-23 14:44:28 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-08-23 22:03:35 +0200 |
commit | d5127b14bef08edeeec60da991723dc48b260dbb (patch) | |
tree | d781bb625b3bfdf72c5ca487eb1fd0cc3cb62eec /apps | |
parent | d5c111a984278a097025d267f3461c01983ca0c2 (diff) | |
download | nextcloud-server-d5127b14bef08edeeec60da991723dc48b260dbb.tar.gz nextcloud-server-d5127b14bef08edeeec60da991723dc48b260dbb.zip |
Return newly created addressbook.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/contacts/lib/addressbook.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/contacts/lib/addressbook.php b/apps/contacts/lib/addressbook.php index 92c5f4da3a7..810c681fe51 100644 --- a/apps/contacts/lib/addressbook.php +++ b/apps/contacts/lib/addressbook.php @@ -66,7 +66,8 @@ class OC_Contacts_Addressbook { } $addressbooks = array_merge($addressbooks, OCP\Share::getItemsSharedWith('addressbook', OC_Share_Backend_Addressbook::FORMAT_ADDRESSBOOKS)); if(!$active && !count($addressbooks)) { - self::addDefault($uid); + $id = self::addDefault($uid); + return array(self::find($id),); } return $addressbooks; } @@ -139,7 +140,7 @@ class OC_Contacts_Addressbook { } return $id; } - + /** * @brief Creates a new address book * @param string $userid @@ -290,7 +291,7 @@ class OC_Contacts_Addressbook { OCP\Util::writeLog('contacts', __CLASS__.'::'.__METHOD__.', exception for '.$id.': '.$e->getMessage(), OCP\Util::ERROR); return false; } - + $cards = OC_Contacts_VCard::all($id); foreach($cards as $card){ OC_Contacts_VCard::delete($card['id']); |