friendica/mod/follow.php

35 lines
652 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();
2012-06-03 08:17:49 +02:00
$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);
}
2012-06-03 08:17:49 +02:00
info( t('Contact added') . EOL);
if(strstr($return_url,'contacts'))
2011-12-18 21:41:46 +01:00
goaway($a->get_baseurl() . '/contacts/' . $contact_id);
goaway($return_url);
// NOTREACHED
}