diff options
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Photos.php | 3 | ||||
-rw-r--r-- | Zotlabs/Module/Profile.php | 13 | ||||
-rw-r--r-- | Zotlabs/Module/Profiles.php | 34 |
3 files changed, 44 insertions, 6 deletions
diff --git a/Zotlabs/Module/Photos.php b/Zotlabs/Module/Photos.php index ef1eee399..582174d0e 100644 --- a/Zotlabs/Module/Photos.php +++ b/Zotlabs/Module/Photos.php @@ -188,13 +188,12 @@ class Photos extends \Zotlabs\Web\Controller { } if((argc() > 2) && (x($_REQUEST,'delete')) && ($_REQUEST['delete'] === t('Delete Photo'))) { - // same as above but remove single photo $ob_hash = get_observer_hash(); if(! $ob_hash) goaway(z_root() . '/' . $_SESSION['photo_return']); - + $r = q("SELECT id, resource_id FROM photo WHERE ( xchan = '%s' or uid = %d ) AND resource_id = '%s' LIMIT 1", dbesc($ob_hash), intval(local_channel()), diff --git a/Zotlabs/Module/Profile.php b/Zotlabs/Module/Profile.php index 9e868db92..0bc23952b 100644 --- a/Zotlabs/Module/Profile.php +++ b/Zotlabs/Module/Profile.php @@ -60,7 +60,9 @@ class Profile extends \Zotlabs\Web\Controller { } $groups = array(); - + + + $tab = 'profile'; $o = ''; @@ -69,6 +71,15 @@ class Profile extends \Zotlabs\Web\Controller { return; } + + + if(argc() > 2 && argv(2) === 'vcard') { + header('Content-type: text/vcard'); + header('content-disposition: attachment; filename="' . t('vcard') . '-' . $profile['channel_address'] . '.vcf"' ); + echo \App::$profile['profile_vcard']; + killme(); + } + $is_owner = ((local_channel()) && (local_channel() == \App::$profile['profile_uid']) ? true : false); diff --git a/Zotlabs/Module/Profiles.php b/Zotlabs/Module/Profiles.php index 72a056963..e166c3c19 100644 --- a/Zotlabs/Module/Profiles.php +++ b/Zotlabs/Module/Profiles.php @@ -319,10 +319,38 @@ class Profiles extends \Zotlabs\Web\Controller { $orig_vcard = (($orig[0]['profile_vcard']) ? \Sabre\VObject\Reader::read($orig[0]['profile_vcard']) : null); - $_REQUEST['fn'] = $name; - $_REQUEST['title'] = $pdesc; + $channel = \App::get_channel(); + + $default_vcard_cat = ((defined('DEFAULT_VCARD_CAT')) ? DEFAULT_VCARD_CAT : 'HOME'); + + $defcard = [ + 'fn' => $name, + 'title' => $pdesc, + 'photo' => $channel['xchan_photo_l'], + 'adr' => [], + 'adr_type' => [ $default_vcard_cat ], + 'tel' => [], + 'tel_type' => [ $default_vcard_cat ], + 'email' => [], + 'email_type' => [ $default_vcard_cat ], + 'impp' => [], + 'impp_type' => [ $default_vcard_cat ], + 'url' => [], + 'url_type' => [ $default_vcard_cat ] + ]; + + $defcard['adr'][] = [ + 0 => '', + 1 => '', + 2 => $address, + 3 => $locality, + 4 => $region, + 5 => $postal_code, + 6 => $country_name + ]; + - $profile_vcard = update_vcard($_REQUEST,$orig_vcard); + $profile_vcard = update_vcard($defcard,$orig_vcard); require_once('include/text.php'); |