diff options
author | friendica <info@friendica.com> | 2015-01-29 00:28:23 -0800 |
---|---|---|
committer | friendica <info@friendica.com> | 2015-01-29 00:28:23 -0800 |
commit | fd0b6c967fce4d8a82e9dad121ae7d8301d3f342 (patch) | |
tree | 5c37812ef7baeadc17fce088c4394d25f75b593c /mod/connections.php | |
parent | c993ddd86ee25832e35e65333fa25b396e7aefdf (diff) | |
parent | 872b165eb2bb5d632a12f2d7e1a28e195c2d5348 (diff) | |
download | volse-hubzilla-fd0b6c967fce4d8a82e9dad121ae7d8301d3f342.tar.gz volse-hubzilla-fd0b6c967fce4d8a82e9dad121ae7d8301d3f342.tar.bz2 volse-hubzilla-fd0b6c967fce4d8a82e9dad121ae7d8301d3f342.zip |
Merge branch 'master' into pocorate
Diffstat (limited to 'mod/connections.php')
-rw-r--r-- | mod/connections.php | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/mod/connections.php b/mod/connections.php index d36734ccb..469d3a62f 100644 --- a/mod/connections.php +++ b/mod/connections.php @@ -10,7 +10,7 @@ require_once('include/widgets.php'); function connections_init(&$a) { - if(! local_user()) + if(! local_channel()) return; $channel = $a->get_channel(); @@ -21,7 +21,7 @@ function connections_init(&$a) { function connections_post(&$a) { - if(! local_user()) + if(! local_channel()) return; $contact_id = intval(argv(1)); @@ -30,7 +30,7 @@ function connections_post(&$a) { $orig_record = q("SELECT * FROM abook WHERE abook_id = %d AND abook_channel = %d LIMIT 1", intval($contact_id), - intval(local_user()) + intval(local_channel()) ); if(! $orig_record) { @@ -45,7 +45,7 @@ function connections_post(&$a) { if($profile_id) { $r = q("SELECT profile_guid FROM profile WHERE profile_guid = '%s' AND `uid` = %d LIMIT 1", dbesc($profile_id), - intval(local_user()) + intval(local_channel()) ); if(! count($r)) { notice( t('Could not locate selected profile.') . EOL); @@ -87,7 +87,7 @@ function connections_post(&$a) { intval($closeness), intval($abook_flags), intval($contact_id), - intval(local_user()) + intval(local_channel()) ); if($r) @@ -105,9 +105,9 @@ function connections_post(&$a) { $default_group = $channel['channel_default_group']; if($default_group) { require_once('include/group.php'); - $g = group_rec_byhash(local_user(),$default_group); + $g = group_rec_byhash(local_channel(),$default_group); if($g) - group_add_member(local_user(),'',$a->data['abook_xchan'],$g['id']); + group_add_member(local_channel(),'',$a->data['abook_xchan'],$g['id']); } @@ -127,7 +127,7 @@ function connections_post(&$a) { $r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook_xchan = xchan_hash WHERE abook_channel = %d and abook_id = %d LIMIT 1", - intval(local_user()), + intval(local_channel()), intval($contact_id) ); if($r) { @@ -135,7 +135,7 @@ function connections_post(&$a) { } if($new_friend) { - $arr = array('channel_id' => local_user(), 'abook' => $a->data['abook']); + $arr = array('channel_id' => local_channel(), 'abook' => $a->data['abook']); call_hooks('accept_follow', $arr); } @@ -155,7 +155,7 @@ function connections_clone(&$a) { unset($clone['abook_account']); unset($clone['abook_channel']); - build_sync_packet(0 /* use the current local_user */, array('abook' => array($clone))); + build_sync_packet(0 /* use the current local_channel */, array('abook' => array($clone))); } @@ -165,7 +165,7 @@ function connections_content(&$a) { $o = ''; - if(! local_user()) { + if(! local_channel()) { notice( t('Permission denied.') . EOL); return login(); } @@ -215,7 +215,7 @@ function connections_content(&$a) { break; case 'ifpending': $r = q("SELECT COUNT(abook.abook_id) AS total FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and (abook_flags & %d)>0 and not ((abook_flags & %d)>0 or (xchan_flags & %d)>0)", - intval(local_user()), + intval(local_channel()), intval(ABOOK_FLAG_PENDING), intval(ABOOK_FLAG_SELF|ABOOK_FLAG_IGNORED), intval(XCHAN_FLAGS_DELETED|XCHAN_FLAGS_ORPHAN) @@ -339,12 +339,12 @@ function connections_content(&$a) { $sql_extra .= (($searching) ? protect_sprintf(" AND xchan_name like '%$search_txt%' ") : ""); if($_REQUEST['gid']) { - $sql_extra .= " and xchan_hash in ( select xchan from group_member where gid = " . intval($_REQUEST['gid']) . " and uid = " . intval(local_user()) . " ) "; + $sql_extra .= " and xchan_hash in ( select xchan from group_member where gid = " . intval($_REQUEST['gid']) . " and uid = " . intval(local_channel()) . " ) "; } $r = q("SELECT COUNT(abook.abook_id) AS total FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and not (abook_flags & %d)>0 and not (xchan_flags & %d )>0 $sql_extra $sql_extra2 ", - intval(local_user()), + intval(local_channel()), intval(ABOOK_FLAG_SELF), intval(XCHAN_FLAGS_DELETED|XCHAN_FLAGS_ORPHAN) ); @@ -355,7 +355,7 @@ function connections_content(&$a) { $r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash WHERE abook_channel = %d and not (abook_flags & %d)>0 and not ( xchan_flags & %d)>0 $sql_extra $sql_extra2 ORDER BY xchan_name LIMIT %d OFFSET %d ", - intval(local_user()), + intval(local_channel()), intval(ABOOK_FLAG_SELF), intval(XCHAN_FLAGS_DELETED|XCHAN_FLAGS_ORPHAN), intval($a->pager['itemspage']), |