+ logger('dfrn_confirm: request: info updated');
+
+ $r = q("SELECT `contact`.*, `user`.* FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
+ WHERE `contact`.`id` = %d LIMIT 1",
+ intval($dfrn_record)
+ );
+ if((count($r)) && ($r[0]['notify-flags'] & NOTIFY_CONFIRM)) {
+
+ push_lang($r[0]['language']);
+ $tpl = (($new_relation == CONTACT_IS_FRIEND)
+ ? get_intltext_template('friend_complete_eml.tpl')
+ : get_intltext_template('intro_complete_eml.tpl'));
+
+ $email_tpl = replace_macros($tpl, array(
+ '$sitename' => $a->config['sitename'],
+ '$siteurl' => $a->get_baseurl(),
+ '$username' => $r[0]['username'],
+ '$email' => $r[0]['email'],
+ '$fn' => $r[0]['name'],
+ '$dfrn_url' => $r[0]['url'],
+ '$uid' => $newuid )
+ );
+
+ $res = mail($r[0]['email'], sprintf( t("Connection accepted at %s") , $a->config['sitename']),
+ $email_tpl,
+ 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] . "\n"
+ . 'Content-type: text/plain; charset=UTF-8' . "\n"
+ . 'Content-transfer-encoding: 8bit' );
+
+ if(!$res) {
+ // pointless throwing an error here and confusing the person at the other end of the wire.
+ }
+ pop_lang();
+ }
+ xml_status(0); // Success
+ return; // NOTREACHED
+
+ ////////////////////// End of this scenario ///////////////////////////////////////////////