+use Friendica\Database\DBM;
+use Friendica\Model\Contact;
+use Friendica\Model\Group;
+use Friendica\Model\Profile;
+use Friendica\Model\User;
+use Friendica\Module\Login;
* Scenario 2: We've introduced ourself to another cell, then have been returned to our own cell
* to confirm the request, and then we've clicked submit (perhaps after logging in).
* That brings us here:
* Scenario 2: We've introduced ourself to another cell, then have been returned to our own cell
* to confirm the request, and then we've clicked submit (perhaps after logging in).
* That brings us here:
-
- if((x($_POST,'localconfirm')) && ($_POST['localconfirm'] == 1)) {
-
- /*
- * Ensure this is a valid request
- */
-
- if(local_user() && ($a->user['nickname'] == $a->argv[1]) && (x($_POST,'dfrn_url'))) {
-
-
- $dfrn_url = notags(trim($_POST['dfrn_url']));
- $aes_allow = (((x($_POST,'aes_allow')) && ($_POST['aes_allow'] == 1)) ? 1 : 0);
- $confirm_key = ((x($_POST,'confirm_key')) ? $_POST['confirm_key'] : "");
- $hidden = ((x($_POST,'hidden-contact')) ? intval($_POST['hidden-contact']) : 0);
+ if ((x($_POST, 'localconfirm')) && ($_POST['localconfirm'] == 1)) {
+ // Ensure this is a valid request
+ if (local_user() && ($a->user['nickname'] == $a->argv[1]) && (x($_POST, 'dfrn_url'))) {
+ $dfrn_url = notags(trim($_POST['dfrn_url']));
+ $aes_allow = (((x($_POST, 'aes_allow')) && ($_POST['aes_allow'] == 1)) ? 1 : 0);
+ $confirm_key = ((x($_POST, 'confirm_key')) ? $_POST['confirm_key'] : "");
+ $hidden = ((x($_POST, 'hidden-contact')) ? intval($_POST['hidden-contact']) : 0);
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' AND NOT `self` LIMIT 1",
intval(local_user()),
dbesc(normalise_link($dfrn_url))
);
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `nurl` = '%s' AND NOT `self` LIMIT 1",
intval(local_user()),
dbesc(normalise_link($dfrn_url))
);
- if (dbm::is_result($r)) {
- if(strlen($r[0]['dfrn-id'])) {
-
- /*
- * We don't need to be here. It has already happened.
- */
-
- notice( t("This introduction has already been accepted.") . EOL );
+ if (DBM::is_result($r)) {
+ if (strlen($r[0]['dfrn-id'])) {
+ // We don't need to be here. It has already happened.
+ notice(L10n::t("This introduction has already been accepted.") . EOL);
$r = q("UPDATE `contact` SET `ret-aes` = %d, hidden = %d WHERE `id` = %d",
intval($aes_allow),
intval($hidden),
intval($contact_record['id'])
);
$r = q("UPDATE `contact` SET `ret-aes` = %d, hidden = %d WHERE `id` = %d",
intval($aes_allow),
intval($hidden),
intval($contact_record['id'])
);
- }
- else {
-
- /*
- * Scrape the other site's profile page to pick up the dfrn links, key, fn, and photo
- */
-
+ } else {
+ // Scrape the other site's profile page to pick up the dfrn links, key, fn, and photo
- }
- else {
- if (! x($parms,'fn')) {
- notice( t('Warning: profile location has no identifiable owner name.') . EOL );
+ } else {
+ if (!x($parms, 'fn')) {
+ notice(L10n::t('Warning: profile location has no identifiable owner name.') . EOL);
- if (! x($parms,'photo')) {
- notice( t('Warning: profile location has no profile photo.') . EOL );
+ if (!x($parms, 'photo')) {
+ notice(L10n::t('Warning: profile location has no profile photo.') . EOL);
- notice( sprintf( tt("%d required parameter was not found at the given location",
- "%d required parameters were not found at the given location",
- $invalid), $invalid) . EOL );
+ notice(L10n::tt("%d required parameter was not found at the given location", "%d required parameters were not found at the given location", $invalid) . EOL);
$r = q("INSERT INTO `contact` ( `uid`, `created`,`url`, `nurl`, `addr`, `name`, `nick`, `photo`, `site-pubkey`,
`request`, `confirm`, `notify`, `poll`, `poco`, `network`, `aes_allow`, `hidden`, `blocked`, `pending`)
VALUES ( %d, '%s', '%s', '%s', '%s', '%s' , '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d)",
intval(local_user()),
$r = q("INSERT INTO `contact` ( `uid`, `created`,`url`, `nurl`, `addr`, `name`, `nick`, `photo`, `site-pubkey`,
`request`, `confirm`, `notify`, `poll`, `poco`, `network`, `aes_allow`, `hidden`, `blocked`, `pending`)
VALUES ( %d, '%s', '%s', '%s', '%s', '%s' , '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, %d, %d)",
intval(local_user()),
- if (dbm::is_result($r)) {
- $def_gid = get_default_group(local_user(), $r[0]["network"]);
- if(intval($def_gid))
- group_add_member(local_user(), '', $r[0]['id'], $def_gid);
+ if (DBM::is_result($r)) {
+ Group::addMember(User::getDefaultGroup(local_user(), $r[0]["network"]), $r[0]['id']);
- if (isset($photo))
- update_contact_avatar($photo, local_user(), $r[0]["id"], true);
+ if (isset($photo)) {
+ Contact::updateAvatar($photo, local_user(), $r[0]["id"], true);
+ }
if (is_array($contact_record)) {
$dfrn_request = $contact_record['request'];
}
if (strlen($dfrn_request) && strlen($confirm_key)) {
if (is_array($contact_record)) {
$dfrn_request = $contact_record['request'];
}
if (strlen($dfrn_request) && strlen($confirm_key)) {
-
- if( x($_POST,'dfrn_url')) {
-
- /*
- * Block friend request spam
- */
-
- if($maxreq) {
+ if (x($_POST, 'dfrn_url')) {
+ // Block friend request spam
+ if ($maxreq) {
- if (dbm::is_result($r) && count($r) > $maxreq) {
- notice( sprintf( t('%s has received too many connection requests today.'), $a->profile['name']) . EOL);
- notice( t('Spam protection measures have been invoked.') . EOL);
- notice( t('Friends are advised to please try again in 24 hours.') . EOL);
+ if (DBM::is_result($r) && count($r) > $maxreq) {
+ notice(L10n::t('%s has received too many connection requests today.', $a->profile['name']) . EOL);
+ notice(L10n::t('Spam protection measures have been invoked.') . EOL);
+ notice(L10n::t('Friends are advised to please try again in 24 hours.') . EOL);
$r = q("SELECT `intro`.*, `intro`.`id` AS `iid`, `contact`.`id` AS `cid`, `contact`.`rel`
FROM `intro` LEFT JOIN `contact` on `intro`.`contact-id` = `contact`.`id`
WHERE `intro`.`blocked` = 1 AND `contact`.`self` = 0
$r = q("SELECT `intro`.*, `intro`.`id` AS `iid`, `contact`.`id` AS `cid`, `contact`.`rel`
FROM `intro` LEFT JOIN `contact` on `intro`.`contact-id` = `contact`.`id`
WHERE `intro`.`blocked` = 1 AND `contact`.`self` = 0
- /*
- *
- * Cleanup any old email intros - which will have a greater lifetime
- */
-
- $r = q("SELECT `intro`.*, `intro`.`id` AS `iid`, `contact`.`id` AS `cid`, `contact`.`rel`
- FROM `intro` LEFT JOIN `contact` on `intro`.`contact-id` = `contact`.`id`
- WHERE `intro`.`blocked` = 1 AND `contact`.`self` = 0
- AND `contact`.`network` = '%s'
- AND `intro`.`datetime` < UTC_TIMESTAMP() - INTERVAL 3 DAY ",
- dbesc(NETWORK_MAIL2)
- );
- if (dbm::is_result($r)) {
- foreach ($r as $rr) {
- if(! $rr['rel']) {
- q("DELETE FROM `contact` WHERE `id` = %d AND NOT `self`",
- intval($rr['cid'])
- );
- }
- q("DELETE FROM `intro` WHERE `id` = %d",
- intval($rr['iid'])
- );
- }
- }
-
- $email_follow = (x($_POST,'email_follow') ? intval($_POST['email_follow']) : 0);
- $real_name = (x($_POST,'realname') ? notags(trim($_POST['realname'])) : '');
+ $real_name = x($_POST, 'realname') ? notags(trim($_POST['realname'])) : '';
- if($email_follow) {
-
- if(! validate_email($url)) {
- notice( t('Invalid email address.') . EOL);
- return;
- }
-
- $addr = $url;
- $name = ($realname) ? $realname : $addr;
- $nick = substr($addr,0,strpos($addr,'@'));
- $url = 'http://' . substr($addr,strpos($addr,'@') + 1);
- $nurl = normalise_url($host);
- $poll = 'email ' . random_string();
- $notify = 'smtp ' . random_string();
- $network = NETWORK_MAIL2;
- $rel = CONTACT_IS_FOLLOWER;
-
- $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
- if(get_config('system','dfrn_only'))
- $mail_disabled = 1;
-
- if(! $mail_disabled) {
- $failed = false;
- $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
- intval($uid)
- );
-
- if (! dbm::is_result($r)) {
- notice( t('This account has not been configured for email. Request failed.') . EOL);
- return;
- }
- }
+ // Detect the network
+ $data = Probe::uri($url);
+ $network = $data["network"];
- $r = q("insert into contact ( uid, created, addr, name, nick, url, nurl, poll, notify, blocked, pending, network, rel )
- values( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d ) ",
- intval($uid),
- dbesc(datetime_convert()),
- dbesc($addr),
- dbesc($name),
- dbesc($nick),
- dbesc($url),
- dbesc($nurl),
- dbesc($poll),
- dbesc($notify),
- intval($blocked),
- intval($pending),
- dbesc($network),
- intval($rel)
- );
+ // Canonicalise email-style profile locator
+ $url = Probe::webfingerDfrn($url, $hcard);
- $r = q("SELECT `id`, `network` FROM `contact` WHERE `poll` = '%s' AND `uid` = %d LIMIT 1",
- dbesc($poll),
- intval($uid)
- );
- if (dbm::is_result($r)) {
- $contact_id = $r[0]['id'];
-
- $def_gid = get_default_group($uid, $r[0]["network"]);
- if (intval($def_gid))
- group_add_member($uid, '', $contact_id, $def_gid);
-
- $photo = avatar_img($addr);
-
- $r = q("UPDATE `contact` SET
- `photo` = '%s',
- `thumb` = '%s',
- `micro` = '%s',
- `name-date` = '%s',
- `uri-date` = '%s',
- `avatar-date` = '%s',
- `hidden` = 0,
- WHERE `id` = %d
- ",
- dbesc($photos[0]),
- dbesc($photos[1]),
- dbesc($photos[2]),
- dbesc(datetime_convert()),
- dbesc(datetime_convert()),
- dbesc(datetime_convert()),
- intval($contact_id)
- );
+ if (substr($url, 0, 5) === 'stat:') {
+ // Every time we detect the remote subscription we define this as OStatus.
+ // We do this even if it is not OStatus.
+ // we only need to pass this through another section of the code.
+ if ($network != NETWORK_DIASPORA) {
+ $network = NETWORK_OSTATUS;
- // contact is created. Now create an introduction
-
- $hash = random_string();
-
- $r = q("INSERT INTO `intro` ( `uid`, `contact-id`, knowyou, note, hash, datetime, blocked )
- VALUES( %d , %d, %d, '%s', '%s', '%s', %d ) ",
- intval($uid),
- intval($contact_id),
- ((x($_POST,'knowyou') && ($_POST['knowyou'] == 1)) ? 1 : 0),
- dbesc(notags(trim($_POST['dfrn-request-message']))),
- dbesc($hash),
- dbesc(datetime_convert()),
- 1
- );
-
- // Next send an email verify form to the requestor.
-
+ $url = substr($url, 5);
- // Detect the network
- $data = probe_url($url);
- $network = $data["network"];
-
- // Canonicalise email-style profile locator
- $url = Probe::webfingerDfrn($url,$hcard);
-
- if (substr($url,0,5) === 'stat:') {
-
- // Every time we detect the remote subscription we define this as OStatus.
- // We do this even if it is not OStatus.
- // we only need to pass this through another section of the code.
- if ($network != NETWORK_DIASPORA)
- $network = NETWORK_OSTATUS;
-
- $url = substr($url,5);
- } else
- $network = NETWORK_DFRN;
+ $network = NETWORK_DFRN;
- if (dbm::is_result($ret)) {
- if(strlen($ret[0]['issued-id'])) {
- notice( t('You have already introduced yourself here.') . EOL );
+ if (DBM::is_result($ret)) {
+ if (strlen($ret[0]['issued-id'])) {
+ notice(L10n::t('You have already introduced yourself here.') . EOL);
- }
- elseif($ret[0]['rel'] == CONTACT_IS_FRIEND) {
- notice( sprintf( t('Apparently you are already friends with %s.'), $a->profile['name']) . EOL);
+ } elseif ($ret[0]['rel'] == CONTACT_IS_FRIEND) {
+ notice(L10n::t('Apparently you are already friends with %s.', $a->profile['name']) . EOL);
// There is a contact record but no issued-id, so this
// is a reciprocal introduction from a known contact
$r = q("UPDATE `contact` SET `issued-id` = '%s' WHERE `id` = %d",
dbesc($issued_id),
intval($contact_record['id'])
);
// There is a contact record but no issued-id, so this
// is a reciprocal introduction from a known contact
$r = q("UPDATE `contact` SET `issued-id` = '%s' WHERE `id` = %d",
dbesc($issued_id),
intval($contact_record['id'])
);
- }
- else {
- if (! x($parms,'fn')) {
- notice( t('Warning: profile location has no identifiable owner name.') . EOL );
+ } else {
+ if (!x($parms, 'fn')) {
+ notice(L10n::t('Warning: profile location has no identifiable owner name.') . EOL);
- if (! x($parms,'photo')) {
- notice( t('Warning: profile location has no profile photo.') . EOL );
+ if (!x($parms, 'photo')) {
+ notice(L10n::t('Warning: profile location has no profile photo.') . EOL);
- notice( sprintf( tt("%d required parameter was not found at the given location",
- "%d required parameters were not found at the given location",
- $invalid), $invalid) . EOL );
+ notice(L10n::tt("%d required parameter was not found at the given location", "%d required parameters were not found at the given location", $invalid) . EOL);
$r = q("INSERT INTO `contact` ( `uid`, `created`, `url`, `nurl`, `addr`, `name`, `nick`, `issued-id`, `photo`, `site-pubkey`,
`request`, `confirm`, `notify`, `poll`, `poco`, `network`, `blocked`, `pending` )
VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d )",
intval($uid),
$r = q("INSERT INTO `contact` ( `uid`, `created`, `url`, `nurl`, `addr`, `name`, `nick`, `issued-id`, `photo`, `site-pubkey`,
`request`, `confirm`, `notify`, `poll`, `poco`, `network`, `blocked`, `pending` )
VALUES ( %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d )",
intval($uid),
- update_contact_avatar($photo, $uid, $contact_record["id"], true);
+ Contact::updateAvatar($photo, $uid, $contact_record["id"], true);
((x($_POST,'knowyou') && ($_POST['knowyou'] == 1)) ? 1 : 0),
dbesc(notags(trim($_POST['dfrn-request-message']))),
dbesc($hash),
((x($_POST,'knowyou') && ($_POST['knowyou'] == 1)) ? 1 : 0),
dbesc(notags(trim($_POST['dfrn-request-message']))),
dbesc($hash),
$dfrn_url = bin2hex(System::baseUrl() . '/profile/' . $nickname);
$aes_allow = ((function_exists('openssl_encrypt')) ? 1 : 0);
goaway($parms['dfrn-request'] . "?dfrn_url=$dfrn_url"
. '&dfrn_version=' . DFRN_PROTOCOL_VERSION
$dfrn_url = bin2hex(System::baseUrl() . '/profile/' . $nickname);
$aes_allow = ((function_exists('openssl_encrypt')) ? 1 : 0);
goaway($parms['dfrn-request'] . "?dfrn_url=$dfrn_url"
. '&dfrn_version=' . DFRN_PROTOCOL_VERSION
. (($aes_allow) ? "&aes_allow=1" : "")
);
// NOTREACHED
// END $network === NETWORK_DFRN
} elseif (($network != NETWORK_PHANTOM) && ($url != "")) {
. (($aes_allow) ? "&aes_allow=1" : "")
);
// NOTREACHED
// END $network === NETWORK_DFRN
} elseif (($network != NETWORK_PHANTOM) && ($url != "")) {
// Diaspora needs the uri in the format user@domain.tld
// Diaspora will support the remote subscription in a future version
if ($network == NETWORK_DIASPORA) {
// Diaspora needs the uri in the format user@domain.tld
// Diaspora will support the remote subscription in a future version
if ($network == NETWORK_DIASPORA) {
// "Homecoming". Make sure we're logged in to this site as the correct user. Then offer a confirm button
// to send us to the post section to record the introduction.
// "Homecoming". Make sure we're logged in to this site as the correct user. Then offer a confirm button
// to send us to the post section to record the introduction.
-
- if (x($_GET,'dfrn_url')) {
-
- if (! local_user()) {
- info( t("Please login to confirm introduction.") . EOL );
+ if (x($_GET, 'dfrn_url')) {
+ if (!local_user()) {
+ info(L10n::t("Please login to confirm introduction.") . EOL);
}
// Edge case, but can easily happen in the wild. This person is authenticated,
// but not as the person who needs to deal with this request.
}
// Edge case, but can easily happen in the wild. This person is authenticated,
// but not as the person who needs to deal with this request.
- $aes_allow = (((x($_GET,'aes_allow')) && ($_GET['aes_allow'] == 1)) ? 1 : 0);
- $confirm_key = (x($_GET,'confirm_key') ? $_GET['confirm_key'] : "");
+ $aes_allow = x($_GET, 'aes_allow') && $_GET['aes_allow'] == 1 ? 1 : 0;
+ $confirm_key = x($_GET, 'confirm_key') ? $_GET['confirm_key'] : "";
// Checking fastlane for validity
if (x($_SESSION, "fastlane") && (normalise_link($_SESSION["fastlane"]) == normalise_link($dfrn_url))) {
// Checking fastlane for validity
if (x($_SESSION, "fastlane") && (normalise_link($_SESSION["fastlane"]) == normalise_link($dfrn_url))) {
$_POST["confirm_key"] = $confirm_key;
$_POST["localconfirm"] = 1;
$_POST["hidden-contact"] = 0;
$_POST["confirm_key"] = $confirm_key;
$_POST["localconfirm"] = 1;
$_POST["hidden-contact"] = 0;
'$dfrn_url' => $dfrn_url,
'$aes_allow' => (($aes_allow) ? '<input type="hidden" name="aes_allow" value="1" />' : "" ),
'$dfrn_url' => $dfrn_url,
'$aes_allow' => (($aes_allow) ? '<input type="hidden" name="aes_allow" value="1" />' : "" ),
- '$welcome' => sprintf( t('Welcome home %s.'), $a->user['username']),
- '$please' => sprintf( t('Please confirm your introduction/connection request to %s.'), $dfrn_url),
- '$submit' => t('Confirm'),
+ '$welcome' => L10n::t('Welcome home %s.', $a->user['username']),
+ '$please' => L10n::t('Please confirm your introduction/connection request to %s.', $dfrn_url),
+ '$submit' => L10n::t('Confirm'),
'$uid' => $_SESSION['uid'],
'$nickname' => $a->user['nickname'],
'dfrn_rawurl' => $_GET['dfrn_url']
'$uid' => $_SESSION['uid'],
'$nickname' => $a->user['nickname'],
'dfrn_rawurl' => $_GET['dfrn_url']
// we are the requestee and it is now safe to send our user their introduction,
// We could just unblock it, but first we have to jump through a few hoops to
// send an email, or even to find out if we need to send an email.
// we are the requestee and it is now safe to send our user their introduction,
// We could just unblock it, but first we have to jump through a few hoops to
// send an email, or even to find out if we need to send an email.
$intro = q("SELECT * FROM `intro` WHERE `hash` = '%s' LIMIT 1",
dbesc($_GET['confirm_key'])
);
$intro = q("SELECT * FROM `intro` WHERE `hash` = '%s' LIMIT 1",
dbesc($_GET['confirm_key'])
);
$r = q("SELECT `contact`.*, `user`.* FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
WHERE `contact`.`id` = %d LIMIT 1",
intval($intro[0]['contact-id'])
$r = q("SELECT `contact`.*, `user`.* FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
WHERE `contact`.`id` = %d LIMIT 1",
intval($intro[0]['contact-id'])
'type' => NOTIFY_INTRO,
'notify_flags' => $r[0]['notify-flags'],
'language' => $r[0]['language'],
'type' => NOTIFY_INTRO,
'notify_flags' => $r[0]['notify-flags'],
'language' => $r[0]['language'],
'to_email' => $r[0]['email'],
'uid' => $r[0]['uid'],
'link' => System::baseUrl() . '/notifications/intros',
'to_email' => $r[0]['email'],
'uid' => $r[0]['uid'],
'link' => System::baseUrl() . '/notifications/intros',
'source_link' => $r[0]['url'],
'source_photo' => $r[0]['photo'],
'verb' => ACTIVITY_REQ_FRIEND,
'otype' => 'intro'
'source_link' => $r[0]['url'],
'source_photo' => $r[0]['photo'],
'verb' => ACTIVITY_REQ_FRIEND,
'otype' => 'intro'
'uid' => $r[0]['uid'],
'node' => $r[0]['nickname'],
'dfrn_id' => $r[0]['issued-id'],
'intro_id' => $intro[0]['id'],
'duplex' => (($r[0]['page-flags'] == PAGE_FREELOVE) ? 1 : 0),
'uid' => $r[0]['uid'],
'node' => $r[0]['nickname'],
'dfrn_id' => $r[0]['issued-id'],
'intro_id' => $intro[0]['id'],
'duplex' => (($r[0]['page-flags'] == PAGE_FREELOVE) ? 1 : 0),
- 'activity' => intval(get_pconfig($r[0]['uid'],'system','post_newfriend'))
- );
- dfrn_confirm_post($a,$handsfree);
+ ];
+ dfrn_confirm_post($a, $handsfree);
// If we are auto_confirming, this record will have already been nuked
// in dfrn_confirm_post()
// If we are auto_confirming, this record will have already been nuked
// in dfrn_confirm_post()
- }
- else {
-
- /*
- * Normal web request. Display our user's introduction form.
- */
-
- if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
- if(! get_config('system','local_block')) {
- notice( t('Public access denied.') . EOL);
+ } else {
+ // Normal web request. Display our user's introduction form.
+ if ((Config::get('system', 'block_public')) && (!local_user()) && (!remote_user())) {
+ if (!Config::get('system', 'local_block')) {
+ notice(L10n::t('Public access denied.') . EOL);
$myaddr = $_GET['address'];
} elseif (local_user()) {
if (strlen($a->path)) {
$myaddr = System::baseUrl() . '/profile/' . $a->user['nickname'];
} else {
$myaddr = $_GET['address'];
} elseif (local_user()) {
if (strlen($a->path)) {
$myaddr = System::baseUrl() . '/profile/' . $a->user['nickname'];
} else {
if ($a->profile['page-flags'] == PAGE_NORMAL) {
$tpl = get_markup_template('dfrn_request.tpl');
} else {
$tpl = get_markup_template('auto_request.tpl');
}
if ($a->profile['page-flags'] == PAGE_NORMAL) {
$tpl = get_markup_template('dfrn_request.tpl');
} else {
$tpl = get_markup_template('auto_request.tpl');
}
- $page_desc = t("Please enter your 'Identity Address' from one of the following supported communications networks:");
-
- // see if we are allowed to have NETWORK_MAIL2 contacts
-
- $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
-
- if (get_config('system','dfrn_only')) {
- $mail_disabled = 1;
- }
-
- if (! $mail_disabled) {
- $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
- intval($a->profile['uid'])
- );
- if (! dbm::is_result($r)) {
- $mail_disabled = 1;
- }
- }
-
- // "coming soon" is disabled for now
- //$emailnet = (($mail_disabled) ? '' : t("<strike>Connect as an email follower</strike> \x28Coming soon\x29"));
- $emailnet = "";
+ $page_desc = L10n::t("Please enter your 'Identity Address' from one of the following supported communications networks:");
- 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>.'),
- get_server()
+ L10n::t('If you are not yet a member of the free social web, <a href="%s">follow this link to find a public Friendica site and join us today</a>.'),
+ get_server() . '/servers'
- $o = replace_macros($tpl,array(
- '$header' => t('Friend/Connection Request'),
- '$desc' => t('Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@identi.ca'),
- '$pls_answer' => t('Please answer the following:'),
- '$does_know_you' => array('knowyou', sprintf(t('Does %s know you?'),$a->profile['name']), false, '', array(t('No'), t('Yes'))),
- /*'$does_know' => sprintf( t('Does %s know you?'),$a->profile['name']),
- '$yes' => t('Yes'),
- '$no' => t('No'), */
- '$add_note' => t('Add a personal note:'),
+ $o = replace_macros($tpl, [
+ '$header' => L10n::t('Friend/Connection Request'),
+ '$desc' => L10n::t('Examples: jojo@demo.friendica.com, http://demo.friendica.com/profile/jojo, testuser@gnusocial.de'),
+ '$pls_answer' => L10n::t('Please answer the following:'),
+ '$does_know_you' => ['knowyou', L10n::t('Does %s know you?', $a->profile['name']), false, '', [L10n::t('No'), L10n::t('Yes')]],
+ '$add_note' => L10n::t('Add a personal note:'),
- '$friendica' => t('Friendica'),
- '$statusnet' => t('StatusNet/Federated Social Web'),
- '$diaspora' => t('Diaspora'),
- '$diasnote' => sprintf (t(' - please do not use this form. Instead, enter %s into your Diaspora search bar.'),$target_addr),
- '$your_address' => t('Your Identity Address:'),
+ '$friendica' => L10n::t('Friendica'),
+ '$statusnet' => L10n::t("GNU Social \x28Pleroma, Mastodon\x29"),
+ '$diaspora' => L10n::t("Diaspora \x28Socialhome, Hubzilla\x29"),
+ '$diasnote' => L10n::t(' - please do not use this form. Instead, enter %s into your Diaspora search bar.', $target_addr),
+ '$your_address' => L10n::t('Your Identity Address:'),
- '$emailnet' => $emailnet,
- '$submit' => t('Submit Request'),
- '$cancel' => t('Cancel'),
+ '$submit' => L10n::t('Submit Request'),
+ '$cancel' => L10n::t('Cancel'),
'$nickname' => $a->argv[1],
'$name' => $a->profile['name'],
'$myaddr' => $myaddr
'$nickname' => $a->argv[1],
'$name' => $a->profile['name'],
'$myaddr' => $myaddr