예제 #1
0
            }
            break;
        case 'EMAIL':
        case 'TEL':
        case 'IMPP':
        case 'URL':
            debug('Setting element: (EMAIL/TEL/ADR)' . $element);
            $property->setValue($value);
            break;
        default:
            $vcard->{$name} = $value;
            break;
    }
    setParameters($property, $parameters, true);
    // Do checksum and be happy
    if (in_array($name, $multi_properties)) {
        $checksum = substr(md5($property->serialize()), 0, 8);
    }
}
//debug('New checksum: '.$checksum);
//$vcard->children[$line] = $property; ???
try {
    VCard::edit($id, $vcard);
} catch (Exception $e) {
    bailOut($e->getMessage());
}
if (in_array($name, $multi_properties)) {
    \OCP\JSON::success(array('data' => array('line' => $line, 'checksum' => $checksum, 'oldchecksum' => $_POST['checksum'], 'lastmodified' => App::lastModified($vcard)->format('U'))));
} else {
    \OCP\JSON::success(array('data' => array('lastmodified' => App::lastModified($vcard)->format('U'))));
}