fixed wrong status-code for CardDAV DELETE

This commit is contained in:
Ralf Becker 2012-10-01 17:26:05 +00:00
parent ba2be3bb5b
commit 6feeba00ab
2 changed files with 8 additions and 4 deletions

View File

@ -751,7 +751,8 @@ class addressbook_bo extends addressbook_so
{
$delete = $old;
$delete['tid'] = addressbook_so::DELETED_TYPE;
$ok = $this->save($delete);
if ($check_etag) $delete['etag'] = $check_etag;
if (($ok = $this->save($delete))) $ok = true; // we have to return true or false
egw_link::unlink(0,'addressbook',$id,'','','',true);
}
elseif (($ok = parent::delete($id,$check_etag)))

View File

@ -780,12 +780,15 @@ class addressbook_groupdav extends groupdav_handler
{
return $contact;
}
if (($Ok = isset($contact['list_id']) ? $this->bo->delete_list($contact['list_id']) !== false :
$this->bo->delete($contact['id'],self::etag2value($this->http_if_match))) === 0)
if (isset($contact['list_id']))
{
$ok = $this->bo->delete_list($contact['list_id']) !== false;
}
elseif (($ok = $this->bo->delete($contact['id'],self::etag2value($this->http_if_match))) === 0)
{
return '412 Precondition Failed';
}
return $Ok;
return $ok;
}
/**