mirror of
https://github.com/owncloudarchive/contacts.git
synced 2025-01-18 07:52:21 +01:00
Small cleanup
This commit is contained in:
parent
e70814997f
commit
00cf07ec1a
@ -77,9 +77,6 @@ class LocalUsers extends AbstractBackend {
|
||||
"backend" => $this->name,
|
||||
"active" => 1
|
||||
);
|
||||
//var_dump($addressbook);
|
||||
//throw new \Exception($addressBookId);
|
||||
|
||||
return $addressbook;
|
||||
}
|
||||
|
||||
@ -124,8 +121,6 @@ class LocalUsers extends AbstractBackend {
|
||||
$this->removeContacts($remove, $addressbookid);
|
||||
$recall = true;
|
||||
}
|
||||
//var_dump($contacts);
|
||||
//throw new \Exception('err');
|
||||
|
||||
if($recall === true){
|
||||
return $this->getContacts($addressbookid);
|
||||
@ -232,7 +227,7 @@ class LocalUsers extends AbstractBackend {
|
||||
*/
|
||||
private function removeContacts($contacts, $addressbookid){
|
||||
foreach($contacts as $user){
|
||||
try{
|
||||
try{
|
||||
$sql = 'DELETE FROM ' . $this->cardsTableName . ' WHERE addressbookid = ? AND id = ?';
|
||||
$query = \OCP\DB::prepare($sql);
|
||||
$result = $query->execute(array($this->userid, $user));
|
||||
|
@ -16,22 +16,18 @@ class LocalUsersAddressbookProvider implements \OCP\IAddressBook {
|
||||
*/
|
||||
public function search($pattern, $searchProperties, $options) {
|
||||
if(in_array("FN", $searchProperties) && in_array("id", $searchProperties)){
|
||||
echo "beide";
|
||||
$query = 'SELECT DISTINCT * FROM `*PREFIX*contacts_ocu_cards` WHERE addressbookid = ? AND (`id` LIKE ? OR `fullname` LIKE ?) ';
|
||||
$stmt = \OCP\DB::prepare($query);
|
||||
$result = $stmt->execute(array(\OCP\User::getUser(), '%' . $pattern . "%", '%' . $pattern . "%"));
|
||||
} elseif(in_array("FN", $searchProperties)){
|
||||
echo "fn";
|
||||
$query = 'SELECT * FROM `*PREFIX*contacts_ocu_cards` WHERE addressbookid = ? AND `fullname` LIKE ? ';
|
||||
$stmt = \OCP\DB::prepare($query);
|
||||
$result = $stmt->execute(array(\OCP\User::getUser(), '%' . $pattern . "%"));
|
||||
} elseif(in_array("id", $searchProperties)){
|
||||
echo "id";
|
||||
$query = 'SELECT * FROM `*PREFIX*contacts_ocu_cards` WHERE addressbookid = ? AND `id` LIKE ? ';
|
||||
$stmt = \OCP\DB::prepare($query);
|
||||
$result = $stmt->execute(array(\OCP\User::getUser(), '%' . $pattern . "%"));
|
||||
} else {
|
||||
echo "else";
|
||||
$query = 'SELECT * FROM `*PREFIX*contacts_ocu_cards` WHERE addressbookid = ?';
|
||||
$stmt = \OCP\DB::prepare($query);
|
||||
$result = $stmt->execute(array(\OCP\User::getUser()));
|
||||
@ -46,7 +42,7 @@ class LocalUsersAddressbookProvider implements \OCP\IAddressBook {
|
||||
$contacts = array();
|
||||
|
||||
while( $row = $result->fetchRow()) {
|
||||
$contacts[] = $row['id'];
|
||||
$contacts[] = $row;
|
||||
}
|
||||
|
||||
return $contacts;
|
||||
@ -80,7 +76,7 @@ class LocalUsersAddressbookProvider implements \OCP\IAddressBook {
|
||||
* @return bool successful or not
|
||||
*/
|
||||
public function delete($id){
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user