friendica/mod/follow.php

33 lines
629 B
PHP
Raw Normal View History

<?php
require_once('Scrape.php');
2012-06-03 08:12:20 +02:00
require_once('include/follow.php');
2011-12-18 21:41:46 +01:00
function follow_init(&$a) {
if(! local_user()) {
notice( t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
// NOTREACHED
}
$uid = local_user();
2011-12-18 10:08:32 +01:00
$url = $orig_url = notags(trim($_REQUEST['url']));
$return_url = $_SESSION['return_url'];
2012-06-03 08:12:20 +02:00
$result = new_contact($uid,$url,true);
2012-06-03 08:12:20 +02:00
if($result['success'] == false) {
if($result['message'])
notice($result['message']);
goaway($return_url);
}
if(strstr($return_url,'contacts'))
2011-12-18 21:41:46 +01:00
goaway($a->get_baseurl() . '/contacts/' . $contact_id);
goaway($return_url);
// NOTREACHED
}