4 * @file mod/dfrn_request.php
5 * @brief Module: dfrn_request
7 * Purpose: Handles communication associated with the issuance of
10 * @see PDF with dfrn specs: https://github.com/friendica/friendica/blob/master/spec/dfrn2.pdf
11 * You also find a graphic which describes the confirmation process at
12 * https://github.com/friendica/friendica/blob/master/spec/dfrn2_contact_request.png
16 use Friendica\Core\Config;
17 use Friendica\Core\PConfig;
18 use Friendica\Core\System;
19 use Friendica\Database\DBM;
20 use Friendica\Network\Probe;
22 require_once 'include/enotify.php';
23 require_once 'include/group.php';
25 function dfrn_request_init(App $a) {
30 profile_load($a,$which);
36 * Function: dfrn_request_post
39 * Handles multiple scenarios.
42 * Clicking 'submit' on a friend request page.
45 * Following Scenario 1, we are brought back to our home site
46 * in order to link our friend request with our own server cell.
47 * After logging in, we click 'submit' to approve the linkage.
50 function dfrn_request_post(App $a) {
52 if(($a->argc != 2) || (! count($a->profile))) {
53 logger('Wrong count of argc or profiles: argc=' . $a->argc . ',profile()=' . count($a->profile));
58 if(x($_POST, 'cancel')) {
59 goaway(System::baseUrl());
65 * Scenario 2: We've introduced ourself to another cell, then have been returned to our own cell
66 * to confirm the request, and then we've clicked submit (perhaps after logging in).
67 * That brings us here:
71 if((x($_POST,'localconfirm')) && ($_POST['localconfirm'] == 1)) {
74 * Ensure this is a valid request
77 if(local_user() && ($a->user['nickname'] == $a->argv[1]) && (x($_POST,'dfrn_url'))) {
80 $dfrn_url = notags(trim($_POST['dfrn_url']));
81 $aes_allow = (((x($_POST,'aes_allow')) && ($_POST['aes_allow'] == 1)) ? 1 : 0);
82 $confirm_key = ((x($_POST,'confirm_key')) ? $_POST['confirm_key'] : "");
83 $hidden = ((x($_POST,'hidden-contact')) ? intval($_POST['hidden-contact']) : 0);
84 $contact_record = null;
91 * Lookup the contact based on their URL (which is the only unique thing we have at the moment)
94 $r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' AND NOT `self` LIMIT 1",
96 dbesc(normalise_link($dfrn_url))
99 if (DBM::is_result($r)) {
100 if(strlen($r[0]['dfrn-id'])) {
103 * We don't need to be here. It has already happened.
106 notice( t("This introduction has already been accepted.") . EOL );
110 $contact_record = $r[0];
113 if(is_array($contact_record)) {
114 $r = q("UPDATE `contact` SET `ret-aes` = %d, hidden = %d WHERE `id` = %d",
117 intval($contact_record['id'])
123 * Scrape the other site's profile page to pick up the dfrn links, key, fn, and photo
126 $parms = Probe::profile($dfrn_url);
128 if (! count($parms)) {
129 notice( t('Profile location is not valid or does not contain profile information.') . EOL );
133 if (! x($parms,'fn')) {
134 notice( t('Warning: profile location has no identifiable owner name.') . EOL );
136 if (! x($parms,'photo')) {
137 notice( t('Warning: profile location has no profile photo.') . EOL );
139 $invalid = Probe::validDfrn($parms);
141 notice( sprintf( tt("%d required parameter was not found at the given location",
142 "%d required parameters were not found at the given location",
143 $invalid), $invalid) . EOL );
148 $dfrn_request = $parms['dfrn-request'];
150 $photo = $parms["photo"];
152 // Escape the entire array
153 DBM::esc_array($parms);
156 * Create a contact record on our site for the other person
159 $r = q("INSERT INTO `contact` ( `uid`, `created`,`url`, `nurl`, `addr`, `name`, `nick`, `photo`, `site-pubkey`,
160 `request`, `confirm`, `notify`, `poll`, `poco`, `network`, `aes_allow`, `hidden`, `blocked`, `pending`)
161 VALUES ( %d, '%s', '%s', '%s', '%s', '%s' , '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d)",
162 intval(local_user()),
165 dbesc(normalise_link($dfrn_url)),
171 $parms['dfrn-request'],
172 $parms['dfrn-confirm'],
173 $parms['dfrn-notify'],
185 info( t("Introduction complete.") . EOL);
188 $r = q("SELECT `id`, `network` FROM `contact` WHERE `uid` = %d AND `url` = '%s' AND `site-pubkey` = '%s' LIMIT 1",
189 intval(local_user()),
191 $parms['key'] // this was already escaped
193 if (DBM::is_result($r)) {
194 $def_gid = get_default_group(local_user(), $r[0]["network"]);
196 group_add_member(local_user(), '', $r[0]['id'], $def_gid);
199 update_contact_avatar($photo, local_user(), $r[0]["id"], true);
201 $forwardurl = System::baseUrl()."/contacts/".$r[0]['id'];
203 $forwardurl = System::baseUrl()."/contacts";
207 * Allow the blocked remote notification to complete
210 if (is_array($contact_record)) {
211 $dfrn_request = $contact_record['request'];
214 if (strlen($dfrn_request) && strlen($confirm_key)) {
215 $s = fetch_url($dfrn_request . '?confirm_key=' . $confirm_key);
218 // (ignore reply, nothing we can do it failed)
220 // Old: goaway(zrl($dfrn_url));
222 return; // NOTREACHED
228 // invalid/bogus request
230 notice( t('Unrecoverable protocol error.') . EOL );
231 goaway(System::baseUrl());
232 return; // NOTREACHED
239 * We are the requestee. A person from a remote cell has made an introduction
240 * on our profile web page and clicked submit. We will use their DFRN-URL to
241 * figure out how to contact their cell.
243 * Scrape the originating DFRN-URL for everything we need. Create a contact record
244 * and an introduction to show our user next time he/she logs in.
245 * Finally redirect back to the requestor so that their site can record the request.
246 * If our user (the requestee) later confirms this request, a record of it will need
247 * to exist on the requestor's cell in order for the confirmation process to complete..
249 * It's possible that neither the requestor or the requestee are logged in at the moment,
250 * and the requestor does not yet have any credentials to the requestee profile.
252 * Who is the requestee? We've already loaded their profile which means their nickname should be
253 * in $a->argv[1] and we should have their complete info in $a->profile.
257 if(! (is_array($a->profile) && count($a->profile))) {
258 notice( t('Profile unavailable.') . EOL);
262 $nickname = $a->profile['nickname'];
263 $notify_flags = $a->profile['notify-flags'];
264 $uid = $a->profile['uid'];
265 $maxreq = intval($a->profile['maxreq']);
266 $contact_record = null;
273 if( x($_POST,'dfrn_url')) {
276 * Block friend request spam
280 $r = q("SELECT * FROM `intro` WHERE `datetime` > '%s' AND `uid` = %d",
281 dbesc(datetime_convert('UTC','UTC','now - 24 hours')),
284 if (DBM::is_result($r) && count($r) > $maxreq) {
285 notice( sprintf( t('%s has received too many connection requests today.'), $a->profile['name']) . EOL);
286 notice( t('Spam protection measures have been invoked.') . EOL);
287 notice( t('Friends are advised to please try again in 24 hours.') . EOL);
294 * Cleanup old introductions that remain blocked.
295 * Also remove the contact record, but only if there is no existing relationship
296 * Do not remove email contacts as these may be awaiting email verification
299 $r = q("SELECT `intro`.*, `intro`.`id` AS `iid`, `contact`.`id` AS `cid`, `contact`.`rel`
300 FROM `intro` LEFT JOIN `contact` on `intro`.`contact-id` = `contact`.`id`
301 WHERE `intro`.`blocked` = 1 AND `contact`.`self` = 0
302 AND `contact`.`network` != '%s'
303 AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 30 MINUTE ",
306 if (DBM::is_result($r)) {
307 foreach ($r as $rr) {
309 q("DELETE FROM `contact` WHERE `id` = %d AND NOT `self`",
313 q("DELETE FROM `intro` WHERE `id` = %d",
321 * Cleanup any old email intros - which will have a greater lifetime
324 $r = q("SELECT `intro`.*, `intro`.`id` AS `iid`, `contact`.`id` AS `cid`, `contact`.`rel`
325 FROM `intro` LEFT JOIN `contact` on `intro`.`contact-id` = `contact`.`id`
326 WHERE `intro`.`blocked` = 1 AND `contact`.`self` = 0
327 AND `contact`.`network` = '%s'
328 AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 3 DAY ",
331 if (DBM::is_result($r)) {
332 foreach ($r as $rr) {
334 q("DELETE FROM `contact` WHERE `id` = %d AND NOT `self`",
338 q("DELETE FROM `intro` WHERE `id` = %d",
344 $email_follow = (x($_POST,'email_follow') ? intval($_POST['email_follow']) : 0);
345 $real_name = (x($_POST,'realname') ? notags(trim($_POST['realname'])) : '');
347 $url = trim($_POST['dfrn_url']);
349 notice( t("Invalid locator") . EOL );
357 if(! validate_email($url)) {
358 notice( t('Invalid email address.') . EOL);
363 $name = ($realname) ? $realname : $addr;
364 $nick = substr($addr,0,strpos($addr,'@'));
365 $url = 'http://' . substr($addr,strpos($addr,'@') + 1);
366 $nurl = normalise_url($host);
367 $poll = 'email ' . random_string();
368 $notify = 'smtp ' . random_string();
369 $network = NETWORK_MAIL2;
370 $rel = CONTACT_IS_FOLLOWER;
372 $mail_disabled = ((function_exists('imap_open') && (! Config::get('system','imap_disabled'))) ? 0 : 1);
373 if(Config::get('system','dfrn_only'))
376 if(! $mail_disabled) {
378 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
382 if (! DBM::is_result($r)) {
383 notice( t('This account has not been configured for email. Request failed.') . EOL);
388 $r = q("insert into contact ( uid, created, addr, name, nick, url, nurl, poll, notify, blocked, pending, network, rel )
389 values( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d ) ",
391 dbesc(datetime_convert()),
405 $r = q("SELECT `id`, `network` FROM `contact` WHERE `poll` = '%s' AND `uid` = %d LIMIT 1",
409 if (DBM::is_result($r)) {
410 $contact_id = $r[0]['id'];
412 $def_gid = get_default_group($uid, $r[0]["network"]);
413 if (intval($def_gid))
414 group_add_member($uid, '', $contact_id, $def_gid);
416 $photo = avatar_img($addr);
418 $r = q("UPDATE `contact` SET
424 `avatar-date` = '%s',
431 dbesc(datetime_convert()),
432 dbesc(datetime_convert()),
433 dbesc(datetime_convert()),
438 // contact is created. Now create an introduction
440 $hash = random_string();
442 $r = q("INSERT INTO `intro` ( `uid`, `contact-id`, knowyou, note, hash, datetime, blocked )
443 VALUES( %d , %d, %d, '%s', '%s', '%s', %d ) ",
446 ((x($_POST,'knowyou') && ($_POST['knowyou'] == 1)) ? 1 : 0),
447 dbesc(notags(trim($_POST['dfrn-request-message']))),
449 dbesc(datetime_convert()),
453 // Next send an email verify form to the requestor.
456 // Detect the network
457 $data = Probe::uri($url);
458 $network = $data["network"];
460 // Canonicalise email-style profile locator
461 $url = Probe::webfingerDfrn($url,$hcard);
463 if (substr($url,0,5) === 'stat:') {
465 // Every time we detect the remote subscription we define this as OStatus.
466 // We do this even if it is not OStatus.
467 // we only need to pass this through another section of the code.
468 if ($network != NETWORK_DIASPORA)
469 $network = NETWORK_OSTATUS;
471 $url = substr($url,5);
473 $network = NETWORK_DFRN;
476 logger('dfrn_request: url: ' . $url . ',network=' . $network, LOGGER_DEBUG);
478 if($network === NETWORK_DFRN) {
479 $ret = q("SELECT * FROM `contact` WHERE `uid` = %d AND `url` = '%s' AND `self` = 0 LIMIT 1",
484 if (DBM::is_result($ret)) {
485 if(strlen($ret[0]['issued-id'])) {
486 notice( t('You have already introduced yourself here.') . EOL );
489 elseif($ret[0]['rel'] == CONTACT_IS_FRIEND) {
490 notice( sprintf( t('Apparently you are already friends with %s.'), $a->profile['name']) . EOL);
494 $contact_record = $ret[0];
495 $parms = array('dfrn-request' => $ret[0]['request']);
499 $issued_id = random_string();
501 if(is_array($contact_record)) {
502 // There is a contact record but no issued-id, so this
503 // is a reciprocal introduction from a known contact
504 $r = q("UPDATE `contact` SET `issued-id` = '%s' WHERE `id` = %d",
506 intval($contact_record['id'])
510 if (! validate_url($url)) {
511 notice( t('Invalid profile URL.') . EOL);
512 goaway(System::baseUrl() . '/' . $a->cmd);
513 return; // NOTREACHED
516 if (! allowed_url($url)) {
517 notice( t('Disallowed profile URL.') . EOL);
518 goaway(System::baseUrl() . '/' . $a->cmd);
519 return; // NOTREACHED
522 if (blocked_url($url)) {
523 notice( t('Blocked domain') . EOL);
524 goaway(System::baseUrl() . '/' . $a->cmd);
525 return; // NOTREACHED
528 $parms = Probe::profile(($hcard) ? $hcard : $url);
530 if (! count($parms)) {
531 notice( t('Profile location is not valid or does not contain profile information.') . EOL );
532 goaway(System::baseUrl() . '/' . $a->cmd);
535 if (! x($parms,'fn')) {
536 notice( t('Warning: profile location has no identifiable owner name.') . EOL );
538 if (! x($parms,'photo')) {
539 notice( t('Warning: profile location has no profile photo.') . EOL );
541 $invalid = Probe::validDfrn($parms);
543 notice( sprintf( tt("%d required parameter was not found at the given location",
544 "%d required parameters were not found at the given location",
545 $invalid), $invalid) . EOL );
552 $parms['url'] = $url;
553 $parms['issued-id'] = $issued_id;
554 $photo = $parms["photo"];
556 DBM::esc_array($parms);
557 $r = q("INSERT INTO `contact` ( `uid`, `created`, `url`, `nurl`, `addr`, `name`, `nick`, `issued-id`, `photo`, `site-pubkey`,
558 `request`, `confirm`, `notify`, `poll`, `poco`, `network`, `blocked`, `pending` )
559 VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d )",
561 dbesc(datetime_convert()),
563 dbesc(normalise_link($url)),
570 $parms['dfrn-request'],
571 $parms['dfrn-confirm'],
572 $parms['dfrn-notify'],
580 // find the contact record we just created
582 $r = q("SELECT `id` FROM `contact`
583 WHERE `uid` = %d AND `url` = '%s' AND `issued-id` = '%s' LIMIT 1",
588 if (DBM::is_result($r)) {
589 $contact_record = $r[0];
590 update_contact_avatar($photo, $uid, $contact_record["id"], true);
596 notice( t('Failed to update contact record.') . EOL );
600 $hash = random_string() . (string) time(); // Generate a confirm_key
602 if (is_array($contact_record)) {
603 $ret = q("INSERT INTO `intro` ( `uid`, `contact-id`, `blocked`, `knowyou`, `note`, `hash`, `datetime`)
604 VALUES ( %d, %d, 1, %d, '%s', '%s', '%s' )",
606 intval($contact_record['id']),
607 ((x($_POST,'knowyou') && ($_POST['knowyou'] == 1)) ? 1 : 0),
608 dbesc(notags(trim($_POST['dfrn-request-message']))),
610 dbesc(datetime_convert())
614 // This notice will only be seen by the requestor if the requestor and requestee are on the same server.
617 info( t('Your introduction has been sent.') . EOL );
620 // "Homecoming" - send the requestor back to their site to record the introduction.
622 $dfrn_url = bin2hex(System::baseUrl() . '/profile/' . $nickname);
623 $aes_allow = ((function_exists('openssl_encrypt')) ? 1 : 0);
625 goaway($parms['dfrn-request'] . "?dfrn_url=$dfrn_url"
626 . '&dfrn_version=' . DFRN_PROTOCOL_VERSION
627 . '&confirm_key=' . $hash
628 . (($aes_allow) ? "&aes_allow=1" : "")
631 // END $network === NETWORK_DFRN
632 } elseif (($network != NETWORK_PHANTOM) && ($url != "")) {
636 * Substitute our user's feed URL into $url template
637 * Send the subscriber home to subscribe
641 // Diaspora needs the uri in the format user@domain.tld
642 // Diaspora will support the remote subscription in a future version
643 if ($network == NETWORK_DIASPORA) {
644 $uri = $nickname.'@'.$a->get_hostname();
647 $uri .= '/'.$a->get_path();
649 $uri = urlencode($uri);
651 $uri = System::baseUrl().'/profile/'.$nickname;
654 $url = str_replace('{uri}', $uri, $url);
657 // END $network != NETWORK_PHANTOM
659 notice(t("Remote subscription can't be done for your network. Please subscribe directly on your system.").EOL);
667 function dfrn_request_content(App $a) {
669 if (($a->argc != 2) || (! count($a->profile))) {
674 // "Homecoming". Make sure we're logged in to this site as the correct user. Then offer a confirm button
675 // to send us to the post section to record the introduction.
677 if (x($_GET,'dfrn_url')) {
679 if (! local_user()) {
680 info( t("Please login to confirm introduction.") . EOL );
681 /* setup the return URL to come back to this page if they use openid */
682 $_SESSION['return_url'] = $a->query_string;
686 // Edge case, but can easily happen in the wild. This person is authenticated,
687 // but not as the person who needs to deal with this request.
689 if ($a->user['nickname'] != $a->argv[1]) {
690 notice( t("Incorrect identity currently logged in. Please login to <strong>this</strong> profile.") . EOL);
694 $dfrn_url = notags(trim(hex2bin($_GET['dfrn_url'])));
695 $aes_allow = (((x($_GET,'aes_allow')) && ($_GET['aes_allow'] == 1)) ? 1 : 0);
696 $confirm_key = (x($_GET,'confirm_key') ? $_GET['confirm_key'] : "");
698 // Checking fastlane for validity
699 if (x($_SESSION, "fastlane") && (normalise_link($_SESSION["fastlane"]) == normalise_link($dfrn_url))) {
700 $_POST["dfrn_url"] = $dfrn_url;
701 $_POST["confirm_key"] = $confirm_key;
702 $_POST["localconfirm"] = 1;
703 $_POST["hidden-contact"] = 0;
704 $_POST["submit"] = t('Confirm');
706 dfrn_request_post($a);
709 return; // NOTREACHED
712 $tpl = get_markup_template("dfrn_req_confirm.tpl");
713 $o = replace_macros($tpl,array(
714 '$dfrn_url' => $dfrn_url,
715 '$aes_allow' => (($aes_allow) ? '<input type="hidden" name="aes_allow" value="1" />' : "" ),
716 '$hidethem' => t('Hide this contact'),
717 '$hidechecked' => '',
718 '$confirm_key' => $confirm_key,
719 '$welcome' => sprintf( t('Welcome home %s.'), $a->user['username']),
720 '$please' => sprintf( t('Please confirm your introduction/connection request to %s.'), $dfrn_url),
721 '$submit' => t('Confirm'),
722 '$uid' => $_SESSION['uid'],
723 '$nickname' => $a->user['nickname'],
724 'dfrn_rawurl' => $_GET['dfrn_url']
729 elseif((x($_GET,'confirm_key')) && strlen($_GET['confirm_key'])) {
731 // we are the requestee and it is now safe to send our user their introduction,
732 // We could just unblock it, but first we have to jump through a few hoops to
733 // send an email, or even to find out if we need to send an email.
735 $intro = q("SELECT * FROM `intro` WHERE `hash` = '%s' LIMIT 1",
736 dbesc($_GET['confirm_key'])
739 if (DBM::is_result($intro)) {
741 $r = q("SELECT `contact`.*, `user`.* FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
742 WHERE `contact`.`id` = %d LIMIT 1",
743 intval($intro[0]['contact-id'])
746 $auto_confirm = false;
748 if (DBM::is_result($r)) {
749 if(($r[0]['page-flags'] != PAGE_NORMAL) && ($r[0]['page-flags'] != PAGE_PRVGROUP))
750 $auto_confirm = true;
752 if(! $auto_confirm) {
755 'type' => NOTIFY_INTRO,
756 'notify_flags' => $r[0]['notify-flags'],
757 'language' => $r[0]['language'],
758 'to_name' => $r[0]['username'],
759 'to_email' => $r[0]['email'],
760 'uid' => $r[0]['uid'],
761 'link' => System::baseUrl() . '/notifications/intros',
762 'source_name' => ((strlen(stripslashes($r[0]['name']))) ? stripslashes($r[0]['name']) : t('[Name Withheld]')),
763 'source_link' => $r[0]['url'],
764 'source_photo' => $r[0]['photo'],
765 'verb' => ACTIVITY_REQ_FRIEND,
771 require_once 'mod/dfrn_confirm.php';
773 'uid' => $r[0]['uid'],
774 'node' => $r[0]['nickname'],
775 'dfrn_id' => $r[0]['issued-id'],
776 'intro_id' => $intro[0]['id'],
777 'duplex' => (($r[0]['page-flags'] == PAGE_FREELOVE) ? 1 : 0),
778 'activity' => intval(PConfig::get($r[0]['uid'],'system','post_newfriend'))
780 dfrn_confirm_post($a,$handsfree);
785 if(! $auto_confirm) {
787 // If we are auto_confirming, this record will have already been nuked
788 // in dfrn_confirm_post()
790 $r = q("UPDATE `intro` SET `blocked` = 0 WHERE `hash` = '%s'",
791 dbesc($_GET['confirm_key'])
797 return; // NOTREACHED
802 * Normal web request. Display our user's introduction form.
805 if((Config::get('system','block_public')) && (! local_user()) && (! remote_user())) {
806 if(! Config::get('system','local_block')) {
807 notice( t('Public access denied.') . EOL);
814 * Try to auto-fill the profile address
817 // At first look if an address was provided
818 // Otherwise take the local address
819 if (x($_GET,'addr') && ($_GET['addr'] != "")) {
820 $myaddr = hex2bin($_GET['addr']);
821 } elseif (x($_GET,'address') && ($_GET['address'] != "")) {
822 $myaddr = $_GET['address'];
823 } elseif (local_user()) {
824 if (strlen($a->path)) {
825 $myaddr = System::baseUrl() . '/profile/' . $a->user['nickname'];
827 $myaddr = $a->user['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(),'://') + 3 );
831 $myaddr = get_my_url();
834 $target_addr = $a->profile['nickname'] . '@' . substr(System::baseUrl(), strpos(System::baseUrl(),'://') + 3 );
839 * The auto_request form only has the profile address
840 * because nobody is going to read the comments and
841 * it doesn't matter if they know you or not.
845 if ($a->profile['page-flags'] == PAGE_NORMAL) {
846 $tpl = get_markup_template('dfrn_request.tpl');
848 $tpl = get_markup_template('auto_request.tpl');
851 $page_desc = t("Please enter your 'Identity Address' from one of the following supported communications networks:");
853 // see if we are allowed to have NETWORK_MAIL2 contacts
855 $mail_disabled = ((function_exists('imap_open') && (! Config::get('system','imap_disabled'))) ? 0 : 1);
857 if (Config::get('system','dfrn_only')) {
861 if (! $mail_disabled) {
862 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
863 intval($a->profile['uid'])
865 if (! DBM::is_result($r)) {
870 // "coming soon" is disabled for now
871 //$emailnet = (($mail_disabled) ? '' : t("<strike>Connect as an email follower</strike> \x28Coming soon\x29"));
874 $invite_desc = sprintf(
875 t('If you are not yet a member of the free social web, <a href="%s/siteinfo">follow this link to find a public Friendica site and join us today</a>.'),
879 $o = replace_macros($tpl,array(
880 '$header' => t('Friend/Connection Request'),
881 '$desc' => t('Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@identi.ca'),
882 '$pls_answer' => t('Please answer the following:'),
883 '$does_know_you' => array('knowyou', sprintf(t('Does %s know you?'),$a->profile['name']), false, '', array(t('No'), t('Yes'))),
884 /*'$does_know' => sprintf( t('Does %s know you?'),$a->profile['name']),
887 '$add_note' => t('Add a personal note:'),
888 '$page_desc' => $page_desc,
889 '$friendica' => t('Friendica'),
890 '$statusnet' => t('StatusNet/Federated Social Web'),
891 '$diaspora' => t('Diaspora'),
892 '$diasnote' => sprintf (t(' - please do not use this form. Instead, enter %s into your Diaspora search bar.'),$target_addr),
893 '$your_address' => t('Your Identity Address:'),
894 '$invite_desc' => $invite_desc,
895 '$emailnet' => $emailnet,
896 '$submit' => t('Submit Request'),
897 '$cancel' => t('Cancel'),
898 '$nickname' => $a->argv[1],
899 '$name' => $a->profile['name'],
905 return; // Somebody is fishing.