*/
require_once('include/enotify.php');
+require_once('include/Scrape.php');
if(! function_exists('dfrn_request_init')) {
function dfrn_request_init(&$a) {
if(! function_exists('dfrn_request_post')) {
function dfrn_request_post(&$a) {
- if(($a->argc != 2) || (! count($a->profile)))
+ if(($a->argc != 2) || (! count($a->profile))) {
+ logger('Wrong count of argc or profiles: argc=' . $a->argc . ',profile()=' . count($a->profile));
return;
+ }
if(x($_POST, 'cancel')) {
* Scrape the other site's profile page to pick up the dfrn links, key, fn, and photo
*/
- require_once('include/Scrape.php');
-
$parms = scrape_dfrn($dfrn_url);
if(! count($parms)) {
// Next send an email verify form to the requestor.
- }
-
- else {
+ } else {
// Detect the network
$data = probe_url($url);
$network = $data["network"];
- // Use the detected address - if present
- if ($data["addr"] != "")
- $url = $data["addr"];
-
// Canonicalise email-style profile locator
$url = webfinger_dfrn($url,$hcard);
- if (substr($url,0,5) === 'stat:')
- $url = substr($url,5);
+ 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;
- if (($url == "") AND ($network === NETWORK_DIASPORA))
- $url = $data["baseurl"]."/people?q={uri}";
+ $url = substr($url,5);
+ } else
+ $network = NETWORK_DFRN;
}
- logger('dfrn_request: url: ' . $url);
+ logger('dfrn_request: url: ' . $url . ',network=' . $network, LOGGER_DEBUG);
if($network === NETWORK_DFRN) {
$ret = q("SELECT * FROM `contact` WHERE `uid` = %d AND `url` = '%s' AND `self` = 0 LIMIT 1",
else
$tpl = get_markup_template('auto_request.tpl');
- $page_desc .= t("Please enter your 'Identity Address' from one of the following supported communications networks:");
+ $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
get_server()
);
- $o .= replace_macros($tpl,array(
+ $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:'),