1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-12-01 13:24:10 +01:00

fix issue when a user is removed

This commit is contained in:
LEDfan 2014-04-02 21:49:53 +02:00
parent 615077b900
commit 4cf45fa91f

View File

@ -59,7 +59,7 @@ class LocalUsers extends AbstractBackend {
* {@inheritdoc}
*/
public function getAddressBooksForUser(array $options = array()) {
return array($this->getAddressBook('admin'));
return array($this->getAddressBook($this->userid));
}
/**
@ -232,7 +232,7 @@ class LocalUsers extends AbstractBackend {
private function removeContacts($contacts, $addressbookid){
foreach($contacts as $user){
try{
$sql = 'DELETE FROM ' . $this->cardsTableName . ' WHERE owner = ? AND id = ?';
$sql = 'DELETE FROM ' . $this->cardsTableName . ' WHERE addressbookid = ? AND id = ?';
$query = \OCP\DB::prepare($sql);
$result = $query->execute(array($this->userid, $user));
if (\OCP\DB::isError($result)) {