4 * @file mod/dfrn_confirm.php
5 * @brief Module: dfrn_confirm
6 * Purpose: Friendship acceptance for DFRN contacts
8 * There are two possible entry points and three scenarios.
10 * 1. A form was submitted by our user approving a friendship that originated elsewhere.
11 * This may also be called from dfrn_request to automatically approve a friendship.
13 * 2. We may be the target or other side of the conversation to scenario 1, and will
14 * interact with that process on our own user's behalf.
16 * @see PDF with dfrn specs: https://github.com/friendica/friendica/blob/master/spec/dfrn2.pdf
17 * You also find a graphic which describes the confirmation process at
18 * https://github.com/friendica/friendica/blob/master/spec/dfrn2_contact_confirmation.png
22 use Friendica\Core\Config;
23 use Friendica\Core\PConfig;
24 use Friendica\Core\System;
25 use Friendica\Core\Worker;
26 use Friendica\Database\DBM;
27 use Friendica\Model\Contact;
28 use Friendica\Model\Group;
29 use Friendica\Model\User;
30 use Friendica\Network\Probe;
31 use Friendica\Protocol\Diaspora;
33 require_once 'include/enotify.php';
34 require_once 'include/group.php';
36 function dfrn_confirm_post(App $a, $handsfree = null) {
38 if(is_array($handsfree)) {
41 * We were called directly from dfrn_request due to automatic friend acceptance.
42 * Any $_POST parameters we may require are supplied in the $handsfree array.
46 $node = $handsfree['node'];
47 $a->interactive = false; // notice() becomes a no-op since nobody is there to see it
57 * Main entry point. Scenario 1. Our user received a friend request notification (perhaps
58 * from another site) and clicked 'Approve'.
59 * $POST['source_url'] is not set. If it is, it indicates Scenario 2.
61 * We may also have been called directly from dfrn_request ($handsfree != null) due to
62 * this being a page type which supports automatic friend acceptance. That is also Scenario 1
63 * since we are operating on behalf of our registered user to approve a friendship.
67 if(! x($_POST,'source_url')) {
69 $uid = ((is_array($handsfree)) ? $handsfree['uid'] : local_user());
72 notice( t('Permission denied.') . EOL );
76 $user = q("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1",
81 notice( t('Profile not found.') . EOL );
86 // These data elements may come from either the friend request notification form or $handsfree array.
88 if(is_array($handsfree)) {
89 logger('Confirm in handsfree mode');
90 $dfrn_id = $handsfree['dfrn_id'];
91 $intro_id = $handsfree['intro_id'];
92 $duplex = $handsfree['duplex'];
93 $hidden = ((array_key_exists('hidden',$handsfree)) ? intval($handsfree['hidden']) : 0 );
94 $activity = ((array_key_exists('activity',$handsfree)) ? intval($handsfree['activity']) : 0 );
97 $dfrn_id = ((x($_POST,'dfrn_id')) ? notags(trim($_POST['dfrn_id'])) : "");
98 $intro_id = ((x($_POST,'intro_id')) ? intval($_POST['intro_id']) : 0 );
99 $duplex = ((x($_POST,'duplex')) ? intval($_POST['duplex']) : 0 );
100 $cid = ((x($_POST,'contact_id')) ? intval($_POST['contact_id']) : 0 );
101 $hidden = ((x($_POST,'hidden')) ? intval($_POST['hidden']) : 0 );
102 $activity = ((x($_POST,'activity')) ? intval($_POST['activity']) : 0 );
107 * Ensure that dfrn_id has precedence when we go to find the contact record.
108 * We only want to search based on contact id if there is no dfrn_id,
109 * e.g. for OStatus network followers.
116 logger('Confirming request for dfrn_id (issued) ' . $dfrn_id);
118 logger('Confirming follower with contact_id: ' . $cid);
123 * The other person will have been issued an ID when they first requested friendship.
124 * Locate their record. At this time, their record will have both pending and blocked set to 1.
125 * There won't be any dfrn_id if this is a network follower, so use the contact_id instead.
129 $r = q("SELECT * FROM `contact` WHERE ( ( `issued-id` != '' AND `issued-id` = '%s' ) OR ( `id` = %d AND `id` != 0 ) ) AND `uid` = %d AND `duplex` = 0 LIMIT 1",
135 if (! DBM::is_result($r)) {
136 logger('Contact not found in DB.');
137 notice( t('Contact not found.') . EOL );
138 notice( t('This may occasionally happen if contact was requested by both persons and it has already been approved.') . EOL );
144 $contact_id = $contact['id'];
145 $relation = $contact['rel'];
146 $site_pubkey = $contact['site-pubkey'];
147 $dfrn_confirm = $contact['confirm'];
148 $aes_allow = $contact['aes_allow'];
150 $network = ((strlen($contact['issued-id'])) ? NETWORK_DFRN : NETWORK_OSTATUS);
152 if($contact['network'])
153 $network = $contact['network'];
155 if($network === NETWORK_DFRN) {
159 * Generate a key pair for all further communications with this person.
160 * We have a keypair for every contact, and a site key for unknown people.
161 * This provides a means to carry on relationships with other people if
162 * any single key is compromised. It is a robust key. We're much more
163 * worried about key leakage than anybody cracking it.
166 require_once 'include/crypto.php';
168 $res = new_keypair(4096);
171 $private_key = $res['prvkey'];
172 $public_key = $res['pubkey'];
174 // Save the private key. Send them the public key.
176 $r = q("UPDATE `contact` SET `prvkey` = '%s' WHERE `id` = %d AND `uid` = %d",
186 * Per the DFRN protocol, we will verify both ends by encrypting the dfrn_id with our
187 * site private key (person on the other end can decrypt it with our site public key).
188 * Then encrypt our profile URL with the other person's site public key. They can decrypt
189 * it with their site private key. If the decryption on the other end fails for either
190 * item, it indicates tampering or key failure on at least one site and we will not be
191 * able to provide a secure communication pathway.
193 * If other site is willing to accept full encryption, (aes_allow is 1 AND we have php5.3
194 * or later) then we encrypt the personal public key we send them using AES-256-CBC and a
195 * random key which is encrypted with their site public key.
199 $src_aes_key = openssl_random_pseudo_bytes(64);
202 openssl_private_encrypt($dfrn_id, $result, $user[0]['prvkey']);
204 $params['dfrn_id'] = bin2hex($result);
205 $params['public_key'] = $public_key;
208 $my_url = System::baseUrl() . '/profile/' . $user[0]['nickname'];
210 openssl_public_encrypt($my_url, $params['source_url'], $site_pubkey);
211 $params['source_url'] = bin2hex($params['source_url']);
213 if($aes_allow && function_exists('openssl_encrypt')) {
214 openssl_public_encrypt($src_aes_key, $params['aes_key'], $site_pubkey);
215 $params['aes_key'] = bin2hex($params['aes_key']);
216 $params['public_key'] = bin2hex(openssl_encrypt($public_key,'AES-256-CBC',$src_aes_key));
219 $params['dfrn_version'] = DFRN_PROTOCOL_VERSION ;
221 $params['duplex'] = 1;
223 if($user[0]['page-flags'] == PAGE_COMMUNITY)
225 if($user[0]['page-flags'] == PAGE_PRVGROUP)
228 logger('Confirm: posting data to ' . $dfrn_confirm . ': ' . print_r($params,true), LOGGER_DATA);
232 * POST all this stuff to the other site.
233 * Temporarily raise the network timeout to 120 seconds because the default 60
234 * doesn't always give the other side quite enough time to decrypt everything.
238 $res = post_url($dfrn_confirm, $params, null, $redirects, 120);
240 logger(' Confirm: received data: ' . $res, LOGGER_DATA);
242 // Now figure out what they responded. Try to be robust if the remote site is
243 // having difficulty and throwing up errors of some kind.
245 $leading_junk = substr($res,0,strpos($res,'<?xml'));
247 $res = substr($res,strpos($res,'<?xml'));
250 // No XML at all, this exchange is messed up really bad.
251 // We shouldn't proceed, because the xml parser might choke,
252 // and $status is going to be zero, which indicates success.
253 // We can hardly call this a success.
255 notice( t('Response from remote site was not understood.') . EOL);
259 if(strlen($leading_junk) && Config::get('system','debugging')) {
261 // This might be more common. Mixed error text and some XML.
262 // If we're configured for debugging, show the text. Proceed in either case.
264 notice( t('Unexpected response from remote site: ') . EOL . $leading_junk . EOL );
267 if(stristr($res, "<status")===false) {
268 // wrong xml! stop here!
269 notice( t('Unexpected response from remote site: ') . EOL . htmlspecialchars($res) . EOL );
273 $xml = parse_xml_string($res);
274 $status = (int) $xml->status;
275 $message = unxmlify($xml->message); // human readable text of what may have gone wrong.
278 info( t("Confirmation completed successfully.") . EOL);
280 notice( t('Remote site reported: ') . $message . EOL);
283 // birthday paradox - generate new dfrn-id and fall through.
284 $new_dfrn_id = random_string();
285 $r = q("UPDATE contact SET `issued-id` = '%s' WHERE `id` = %d AND `uid` = %d",
292 notice( t("Temporary failure. Please wait and try again.") . EOL);
294 notice( t('Remote site reported: ') . $message . EOL);
299 notice( t("Introduction failed or was revoked.") . EOL);
301 notice( t('Remote site reported: ') . $message . EOL);
305 if(($status == 0) && ($intro_id)) {
307 // Success. Delete the notification.
309 $r = q("DELETE FROM `intro` WHERE `id` = %d AND `uid` = %d",
323 * We have now established a relationship with the other site.
324 * Let's make our own personal copy of their profile photo so we don't have
325 * to always load it from their site.
327 * We will also update the contact record with the nature and scope of the relationship.
331 Contact::updateAvatar($contact['photo'], $uid, $contact_id);
333 logger('dfrn_confirm: confirm - imported photos');
335 if($network === NETWORK_DFRN) {
337 $new_relation = CONTACT_IS_FOLLOWER;
338 if(($relation == CONTACT_IS_SHARING) || ($duplex))
339 $new_relation = CONTACT_IS_FRIEND;
341 if(($relation == CONTACT_IS_SHARING) && ($duplex))
344 $r = q("UPDATE `contact` SET `rel` = %d,
351 `network` = '%s' WHERE `id` = %d
353 intval($new_relation),
354 dbesc(datetime_convert()),
355 dbesc(datetime_convert()),
363 // $network !== NETWORK_DFRN
365 $network = (($contact['network']) ? $contact['network'] : NETWORK_OSTATUS);
366 $notify = (($contact['notify']) ? $contact['notify'] : '');
367 $poll = (($contact['poll']) ? $contact['poll'] : '');
369 $arr = Probe::uri($contact['url']);
370 if (empty($contact['notify'])) {
371 $notify = $arr['notify'];
373 if (empty($contact['poll'])) {
374 $poll = $arr['poll'];
377 $addr = $arr['addr'];
379 $new_relation = $contact['rel'];
380 $writable = $contact['writable'];
382 if($network === NETWORK_DIASPORA) {
384 $new_relation = CONTACT_IS_FRIEND;
386 $new_relation = CONTACT_IS_FOLLOWER;
388 if($new_relation != CONTACT_IS_FOLLOWER)
392 $r = q("DELETE FROM `intro` WHERE `id` = %d AND `uid` = %d",
398 $r = q("UPDATE `contact` SET `name-date` = '%s',
411 dbesc(datetime_convert()),
412 dbesc(datetime_convert()),
419 intval($new_relation),
424 /// @TODO is DBM::is_result() working here?
426 notice( t('Unable to set contact photo.') . EOL);
429 // reload contact info
431 $r = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
434 if (DBM::is_result($r)) {
441 if ((isset($new_relation) && $new_relation == CONTACT_IS_FRIEND)) {
443 if (($contact) && ($contact['network'] === NETWORK_DIASPORA)) {
444 $ret = Diaspora::sendShare($user[0],$r[0]);
445 logger('share returns: ' . $ret);
448 // Send a new friend post if we are allowed to...
450 $r = q("SELECT `hide-friends` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
454 if((DBM::is_result($r)) && ($r[0]['hide-friends'] == 0) && ($activity) && (! $hidden)) {
456 require_once 'include/items.php';
458 $self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
465 $arr['guid'] = get_guid(32);
466 $arr['uri'] = $arr['parent-uri'] = item_new_uri($a->get_hostname(), $uid);
468 $arr['contact-id'] = $self[0]['id'];
470 $arr['type'] = 'wall';
473 $arr['author-name'] = $arr['owner-name'] = $self[0]['name'];
474 $arr['author-link'] = $arr['owner-link'] = $self[0]['url'];
475 $arr['author-avatar'] = $arr['owner-avatar'] = $self[0]['thumb'];
477 $A = '[url=' . $self[0]['url'] . ']' . $self[0]['name'] . '[/url]';
478 $APhoto = '[url=' . $self[0]['url'] . ']' . '[img]' . $self[0]['thumb'] . '[/img][/url]';
480 $B = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
481 $BPhoto = '[url=' . $contact['url'] . ']' . '[img]' . $contact['thumb'] . '[/img][/url]';
483 $arr['verb'] = ACTIVITY_FRIEND;
484 $arr['object-type'] = ACTIVITY_OBJ_PERSON;
485 $arr['body'] = sprintf( t('%1$s is now friends with %2$s'), $A, $B)."\n\n\n".$BPhoto;
487 $arr['object'] = '<object><type>' . ACTIVITY_OBJ_PERSON . '</type><title>' . $contact['name'] . '</title>'
488 . '<id>' . $contact['url'] . '/' . $contact['name'] . '</id>';
489 $arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $contact['url'] . '" />' . "\n");
490 $arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $contact['thumb'] . '" />' . "\n");
491 $arr['object'] .= '</link></object>' . "\n";
493 $arr['last-child'] = 1;
495 $arr['allow_cid'] = $user[0]['allow_cid'];
496 $arr['allow_gid'] = $user[0]['allow_gid'];
497 $arr['deny_cid'] = $user[0]['deny_cid'];
498 $arr['deny_gid'] = $user[0]['deny_gid'];
500 $i = item_store($arr);
502 Worker::add(PRIORITY_HIGH, "Notifier", "activity", $i);
507 Group::addMember(User::getDefaultGroup($uid, $contact["network"]), $contact['id']);
509 // Let's send our user to the contact editor in case they want to
510 // do anything special with this new friend.
511 if ($handsfree === null) {
512 goaway(System::baseUrl() . '/contacts/' . intval($contact_id));
522 * End of Scenario 1. [Local confirmation of remote friend request].
524 * Begin Scenario 2. This is the remote response to the above scenario.
525 * This will take place on the site that originally initiated the friend request.
526 * In the section above where the confirming party makes a POST and
527 * retrieves xml status information, they are communicating with the following code.
531 if (x($_POST,'source_url')) {
533 // We are processing an external confirmation to an introduction created by our user.
535 $public_key = ((x($_POST,'public_key')) ? $_POST['public_key'] : '');
536 $dfrn_id = ((x($_POST,'dfrn_id')) ? hex2bin($_POST['dfrn_id']) : '');
537 $source_url = ((x($_POST,'source_url')) ? hex2bin($_POST['source_url']) : '');
538 $aes_key = ((x($_POST,'aes_key')) ? $_POST['aes_key'] : '');
539 $duplex = ((x($_POST,'duplex')) ? intval($_POST['duplex']) : 0 );
540 $page = ((x($_POST,'page')) ? intval($_POST['page']) : 0 );
541 $version_id = ((x($_POST,'dfrn_version')) ? (float) $_POST['dfrn_version'] : 2.0);
543 $forum = (($page == 1) ? 1 : 0);
544 $prv = (($page == 2) ? 1 : 0);
546 logger('dfrn_confirm: requestee contacted: ' . $node);
548 logger('dfrn_confirm: request: POST=' . print_r($_POST,true), LOGGER_DATA);
550 // If $aes_key is set, both of these items require unpacking from the hex transport encoding.
553 $aes_key = hex2bin($aes_key);
554 $public_key = hex2bin($public_key);
557 // Find our user's account
559 $r = q("SELECT * FROM `user` WHERE `nickname` = '%s' LIMIT 1",
562 if (! DBM::is_result($r)) {
563 $message = sprintf(t('No user record found for \'%s\' '), $node);
564 xml_status(3,$message); // failure
568 $my_prvkey = $r[0]['prvkey'];
569 $local_uid = $r[0]['uid'];
572 if(! strstr($my_prvkey,'PRIVATE KEY')) {
573 $message = t('Our site encryption key is apparently messed up.');
574 xml_status(3,$message);
579 $decrypted_source_url = "";
580 openssl_private_decrypt($source_url,$decrypted_source_url,$my_prvkey);
583 if(! strlen($decrypted_source_url)) {
584 $message = t('Empty site URL was provided or URL could not be decrypted by us.');
585 xml_status(3,$message);
589 $ret = q("SELECT * FROM `contact` WHERE `url` = '%s' AND `uid` = %d LIMIT 1",
590 dbesc($decrypted_source_url),
593 if (!DBM::is_result($ret)) {
594 if (strstr($decrypted_source_url,'http:')) {
595 $newurl = str_replace('http:','https:',$decrypted_source_url);
597 $newurl = str_replace('https:','http:',$decrypted_source_url);
600 $ret = q("SELECT * FROM `contact` WHERE `url` = '%s' AND `uid` = %d LIMIT 1",
604 if (!DBM::is_result($ret)) {
605 // this is either a bogus confirmation (?) or we deleted the original introduction.
606 $message = t('Contact record was not found for you on our site.');
607 xml_status(3,$message);
608 return; // NOTREACHED
612 $relation = $ret[0]['rel'];
614 // Decrypt all this stuff we just received
616 $foreign_pubkey = $ret[0]['site-pubkey'];
617 $dfrn_record = $ret[0]['id'];
619 if (! $foreign_pubkey) {
620 $message = sprintf( t('Site public key not available in contact record for URL %s.'), $newurl);
621 xml_status(3,$message);
624 $decrypted_dfrn_id = "";
625 openssl_public_decrypt($dfrn_id,$decrypted_dfrn_id,$foreign_pubkey);
627 if (strlen($aes_key)) {
628 $decrypted_aes_key = "";
629 openssl_private_decrypt($aes_key,$decrypted_aes_key,$my_prvkey);
630 $dfrn_pubkey = openssl_decrypt($public_key,'AES-256-CBC',$decrypted_aes_key);
633 $dfrn_pubkey = $public_key;
636 $r = q("SELECT * FROM `contact` WHERE `dfrn-id` = '%s' LIMIT 1",
637 dbesc($decrypted_dfrn_id)
639 if (DBM::is_result($r)) {
640 $message = t('The ID provided by your system is a duplicate on our system. It should work if you try again.');
641 xml_status(1,$message); // Birthday paradox - duplicate dfrn-id
645 $r = q("UPDATE `contact` SET `dfrn-id` = '%s', `pubkey` = '%s' WHERE `id` = %d",
646 dbesc($decrypted_dfrn_id),
650 if (! DBM::is_result($r)) {
651 $message = t('Unable to set your contact credentials on our system.');
652 xml_status(3,$message);
655 // It's possible that the other person also requested friendship.
656 // If it is a duplex relationship, ditch the issued-id if one exists.
659 $r = q("UPDATE `contact` SET `issued-id` = '' WHERE `id` = %d",
664 // We're good but now we have to scrape the profile photo and send notifications.
668 $r = q("SELECT `photo` FROM `contact` WHERE `id` = %d LIMIT 1",
669 intval($dfrn_record));
671 if (DBM::is_result($r)) {
672 $photo = $r[0]['photo'];
674 $photo = System::baseUrl() . '/images/person-175.jpg';
677 Contact::updateAvatar($photo,$local_uid,$dfrn_record);
679 logger('dfrn_confirm: request - photos imported');
681 $new_relation = CONTACT_IS_SHARING;
682 if (($relation == CONTACT_IS_FOLLOWER) || ($duplex)) {
683 $new_relation = CONTACT_IS_FRIEND;
686 if (($relation == CONTACT_IS_FOLLOWER) && ($duplex)) {
690 $r = q("UPDATE `contact` SET
699 `network` = '%s' WHERE `id` = %d
701 intval($new_relation),
702 dbesc(datetime_convert()),
703 dbesc(datetime_convert()),
710 if ($r === false) { // indicates schema is messed up or total db failure
711 $message = t('Unable to update your contact profile details on our system');
712 xml_status(3,$message);
715 // Otherwise everything seems to have worked and we are almost done. Yay!
716 // Send an email notification
718 logger('dfrn_confirm: request: info updated');
720 $r = q("SELECT `contact`.*, `user`.* FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
721 WHERE `contact`.`id` = %d LIMIT 1",
725 if (DBM::is_result($r))
728 if((DBM::is_result($r)) && ($r[0]['notify-flags'] & NOTIFY_CONFIRM)) {
729 $mutual = ($new_relation == CONTACT_IS_FRIEND);
731 'type' => NOTIFY_CONFIRM,
732 'notify_flags' => $r[0]['notify-flags'],
733 'language' => $r[0]['language'],
734 'to_name' => $r[0]['username'],
735 'to_email' => $r[0]['email'],
736 'uid' => $r[0]['uid'],
737 'link' => System::baseUrl() . '/contacts/' . $dfrn_record,
738 'source_name' => ((strlen(stripslashes($r[0]['name']))) ? stripslashes($r[0]['name']) : t('[Name Withheld]')),
739 'source_link' => $r[0]['url'],
740 'source_photo' => $r[0]['photo'],
741 'verb' => ($mutual?ACTIVITY_FRIEND:ACTIVITY_FOLLOW),
746 // Send a new friend post if we are allowed to...
748 if($page && intval(PConfig::get($local_uid,'system','post_joingroup'))) {
749 $r = q("SELECT `hide-friends` FROM `profile` WHERE `uid` = %d AND `is-default` = 1 LIMIT 1",
753 if((DBM::is_result($r)) && ($r[0]['hide-friends'] == 0)) {
755 require_once 'include/items.php';
757 $self = q("SELECT * FROM `contact` WHERE `self` = 1 AND `uid` = %d LIMIT 1",
764 $arr['uri'] = $arr['parent-uri'] = item_new_uri($a->get_hostname(), $local_uid);
765 $arr['uid'] = $local_uid;
766 $arr['contact-id'] = $self[0]['id'];
768 $arr['type'] = 'wall';
771 $arr['author-name'] = $arr['owner-name'] = $self[0]['name'];
772 $arr['author-link'] = $arr['owner-link'] = $self[0]['url'];
773 $arr['author-avatar'] = $arr['owner-avatar'] = $self[0]['thumb'];
775 $A = '[url=' . $self[0]['url'] . ']' . $self[0]['name'] . '[/url]';
776 $APhoto = '[url=' . $self[0]['url'] . ']' . '[img]' . $self[0]['thumb'] . '[/img][/url]';
778 $B = '[url=' . $combined['url'] . ']' . $combined['name'] . '[/url]';
779 $BPhoto = '[url=' . $combined['url'] . ']' . '[img]' . $combined['thumb'] . '[/img][/url]';
781 $arr['verb'] = ACTIVITY_JOIN;
782 $arr['object-type'] = ACTIVITY_OBJ_GROUP;
783 $arr['body'] = sprintf( t('%1$s has joined %2$s'), $A, $B)."\n\n\n" .$BPhoto;
784 $arr['object'] = '<object><type>' . ACTIVITY_OBJ_GROUP . '</type><title>' . $combined['name'] . '</title>'
785 . '<id>' . $combined['url'] . '/' . $combined['name'] . '</id>';
786 $arr['object'] .= '<link>' . xmlify('<link rel="alternate" type="text/html" href="' . $combined['url'] . '" />' . "\n");
787 $arr['object'] .= xmlify('<link rel="photo" type="image/jpeg" href="' . $combined['thumb'] . '" />' . "\n");
788 $arr['object'] .= '</link></object>' . "\n";
790 $arr['last-child'] = 1;
792 $arr['allow_cid'] = $user[0]['allow_cid'];
793 $arr['allow_gid'] = $user[0]['allow_gid'];
794 $arr['deny_cid'] = $user[0]['deny_cid'];
795 $arr['deny_gid'] = $user[0]['deny_gid'];
797 $i = item_store($arr);
799 Worker::add(PRIORITY_HIGH, "Notifier", "activity", $i);
804 xml_status(0); // Success
805 return; // NOTREACHED
807 ////////////////////// End of this scenario ///////////////////////////////////////////////
810 // somebody arrived here by mistake or they are fishing. Send them to the homepage.
812 goaway(System::baseUrl());