Exemple #1
0
 public function set($vcard, $jid)
 {
     $this->__set('jid', \echapJid($jid));
     $validate_date = Validator::date('Y-m-d');
     if (isset($vcard->vCard->BDAY) && $validate_date->validate($vcard->vCard->BDAY)) {
         $this->__set('date', (string) $vcard->vCard->BDAY);
     }
     $this->__set('date', date(DATE_ISO8601, strtotime($this->date)));
     $this->__set('name', (string) $vcard->vCard->NICKNAME);
     $this->__set('fn', (string) $vcard->vCard->FN);
     $this->__set('url', (string) $vcard->vCard->URL);
     $this->__set('gender', (string) $vcard->vCard->{'X-GENDER'});
     $this->__set('marital', (string) $vcard->vCard->MARITAL->STATUS);
     $this->__set('email', (string) $vcard->vCard->EMAIL->USERID);
     $this->__set('adrlocality', (string) $vcard->vCard->ADR->LOCALITY);
     $this->__set('adrpostalcode', (string) $vcard->vCard->ADR->PCODE);
     $this->__set('adrcountry', (string) $vcard->vCard->ADR->CTRY);
     if (filter_var((string) $vcard->vCard->PHOTO, FILTER_VALIDATE_URL)) {
         $this->__set('photobin', base64_encode(requestUrl((string) $vcard->vCard->PHOTO, 1)));
     } else {
         $this->__set('photobin', (string) $vcard->vCard->PHOTO->BINVAL);
     }
     $this->__set('description', (string) $vcard->vCard->DESC);
 }
Exemple #2
0
function deleteUrl($url, $param = null, $format = null)
{
    return requestUrl($url, $param, "DELETE", $format);
}
Exemple #3
0
 public function set($vcard, $jid)
 {
     $this->jid = \echapJid($jid);
     if (isset($vcard->vCard->BDAY) && (string) $vcard->vCard->BDAY != '') {
         $this->date = (string) $vcard->vCard->BDAY;
     } else {
         $this->date = null;
     }
     $this->date = date(DATE_ISO8601, strtotime($this->date));
     $this->name = (string) $vcard->vCard->NICKNAME;
     $this->fn = (string) $vcard->vCard->FN;
     $this->url = (string) $vcard->vCard->URL;
     $this->gender = (string) $vcard->vCard->{'X-GENDER'};
     $this->marital = (string) $vcard->vCard->MARITAL->STATUS;
     $this->email = (string) $vcard->vCard->EMAIL->USERID;
     $this->adrlocality = (string) $vcard->vCard->ADR->LOCALITY;
     $this->adrpostalcode = (string) $vcard->vCard->ADR->PCODE;
     $this->adrcountry = (string) $vcard->vCard->ADR->CTRY;
     if (filter_var((string) $vcard->vCard->PHOTO, FILTER_VALIDATE_URL)) {
         $this->photobin = base64_encode(requestUrl((string) $vcard->vCard->PHOTO, 1));
     } else {
         $this->photobin = (string) $vcard->vCard->PHOTO->BINVAL;
     }
     $this->description = (string) $vcard->vCard->DESC;
 }