streams/mod/follow.php

30 lines
538 B
PHP
Raw Normal View History

<?php
2012-06-03 06:12:20 +00:00
require_once('include/follow.php');
2011-12-18 20:41:46 +00:00
function follow_init(&$a) {
if(! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
$uid = local_user();
2012-06-03 06:17:49 +00:00
$url = notags(trim($_REQUEST['url']));
$return_url = $_SESSION['return_url'];
2012-11-01 04:42:20 +00:00
$result = new_contact($uid,$url,$a->get_channel(),true);
2012-06-03 06:12:20 +00:00
if($result['success'] == false) {
if($result['message'])
notice($result['message']);
goaway($return_url);
}
info( t('Channel added') . EOL);
2012-06-03 06:17:49 +00:00
2013-01-10 06:18:06 +00:00
goaway(z_root() . '/connections/' . $result['abook']['abook_id']);
2011-12-18 20:41:46 +00:00
}