+ if(count($r)) {
+ if($r[0]['page-flags'] != PAGE_NORMAL)
+ $auto_confirm = true;
+ if(($r[0]['notify-flags'] & NOTIFY_INTRO) && (! $auto_confirm)) {
+ $email_tpl = load_view_file('view/request_notify_eml.tpl');
+ $email = replace_macros($email_tpl, array(
+ '$requestor' => ((strlen(stripslashes($r[0]['name']))) ? stripslashes($r[0]['name']) : t('[Name Withheld]')),
+ '$url' => stripslashes($r[0]['url']),
+ '$myname' => $r[0]['username'],
+ '$siteurl' => $a->get_baseurl(),
+ '$sitename' => $a->config['sitename']
+ ));
+ $res = mail($r[0]['email'],
+ t("Introduction received at ") . $a->config['sitename'],
+ $email,
+ 'From: ' . t('Administrator') . '@' . $_SERVER['SERVER_NAME'] );
+ // This is a redundant notification - no point throwing errors if it fails.
+ }
+ if($auto_confirm) {
+ require_once('mod/dfrn_confirm.php');
+ $handsfree = array(
+ '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)
+ );
+ dfrn_confirm_post($a,$handsfree);
+ }
+
+ }
+
+ if(! $auto_confirm) {
+
+ // If we are auto_confirming, this record will have already been nuked
+ // in dfrn_confirm_post()
+
+ $r = q("UPDATE `intro` SET `blocked` = 0 WHERE `hash` = '%s' LIMIT 1",
+ dbesc($_GET['confirm_key'])
+ );
+ }
+ }
+ killme();
+ return; // NOTREACHED
+ }
+ else {