#!/bin/sh
+[ "$_GET[\"action\"]" = "del_filter" ] && _GET["filter"]="" && _GET["filtertype"]=""
listcards() {
- ls -1 ${_DATA}/vcard/*vcf
+ case "$_GET["filtertype"]" in
+ any)
+ grep -il "$_GET[\"filter\"]" ${_DATA}/vcard/*vcf
+ ;;
+ name)
+ egrep -xil "(FN|NICKNAME|N)(;.+)*:.*$_GET[\"filter\"].*" ${_DATA}/vcard/*vcf
+ ;;
+ street)
+ egrep -xil "(ADR)(;.+)*:([^;]*;){2}$_GET[\"filter\"].*" ${_DATA}/vcard/*vcf
+ ;;
+ zip)
+ egrep -xil "(ADR)(;.+)*:([^;]*;){5}$_GET[\"filter\"].*" ${_DATA}/vcard/*vcf
+ ;;
+ telephone)
+ egrep -xil "(TEL)(;.+)*:.*$_GET[\"filter\"].*" ${_DATA}/vcard/*vcf
+ ;;
+ birth)
+ egrep -xil "(BDAY)(;.+)*:$_GET[\"filter\"].*" ${_DATA}/vcard/*vcf
+ ;;
+ course)
+ ;;
+ *) ls -1 ${_DATA}/vcard/*vcf
+ ;;
+ esac
}
vcf_parse() {