aboutsummaryrefslogtreecommitdiffstats
path: root/mod/sources.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2015-01-29 15:09:35 -0800
committerfriendica <info@friendica.com>2015-01-29 15:09:35 -0800
commit912be23e1627211fb417c4b7bced414cbbe38ef0 (patch)
tree2b8567d800624167b3eadf37c8855deb0ba74b0b /mod/sources.php
parentff68ea608786a698ad46637ef13854ac1b1e6beb (diff)
parent872b165eb2bb5d632a12f2d7e1a28e195c2d5348 (diff)
downloadvolse-hubzilla-912be23e1627211fb417c4b7bced414cbbe38ef0.tar.gz
volse-hubzilla-912be23e1627211fb417c4b7bced414cbbe38ef0.tar.bz2
volse-hubzilla-912be23e1627211fb417c4b7bced414cbbe38ef0.zip
Merge branch 'master' into tres
Conflicts: include/group.php include/text.php mod/acl.php mod/channel.php mod/connections.php mod/display.php mod/group.php mod/item.php mod/locs.php mod/network.php mod/photos.php mod/ping.php mod/starred.php mod/viewsrc.php
Diffstat (limited to 'mod/sources.php')
-rw-r--r--mod/sources.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/mod/sources.php b/mod/sources.php
index 73d78bbbf..0aaaa82b1 100644
--- a/mod/sources.php
+++ b/mod/sources.php
@@ -1,10 +1,10 @@
<?php /** @file */
function sources_post(&$a) {
- if(! local_user())
+ if(! local_channel())
return;
- if(! feature_enabled(local_user(),'channel_sources'))
+ if(! feature_enabled(local_channel(),'channel_sources'))
return '';
$source = intval($_REQUEST['source']);
@@ -22,7 +22,7 @@ function sources_post(&$a) {
if($abook) {
$r = q("select abook_xchan from abook where abook_id = %d and abook_channel = %d limit 1",
intval($abook),
- intval(local_user())
+ intval(local_channel())
);
if($r)
$xchan = $r[0]['abook_xchan'];
@@ -36,7 +36,7 @@ function sources_post(&$a) {
if(! $source) {
$r = q("insert into source ( src_channel_id, src_channel_xchan, src_xchan, src_patt )
values ( %d, '%s', '%s', '%s' ) ",
- intval(local_user()),
+ intval(local_channel()),
dbesc($channel['channel_hash']),
dbesc($xchan),
dbesc($words)
@@ -50,7 +50,7 @@ function sources_post(&$a) {
$r = q("update source set src_xchan = '%s', src_patt = '%s' where src_channel_id = %d and src_id = %d",
dbesc($xchan),
dbesc($words),
- intval(local_user()),
+ intval(local_channel()),
intval($source)
);
if($r) {
@@ -62,19 +62,19 @@ function sources_post(&$a) {
function sources_content(&$a) {
- if(! local_user()) {
+ if(! local_channel()) {
notice( t('Permission denied.') . EOL);
return '';
}
- if(! feature_enabled(local_user(),'channel_sources')) {
+ if(! feature_enabled(local_channel(),'channel_sources')) {
return '';
}
// list sources
if(argc() == 1) {
$r = q("select source.*, xchan.* from source left join xchan on src_xchan = xchan_hash where src_channel_id = %d",
- intval(local_user())
+ intval(local_channel())
);
if($r) {
for($x = 0; $x < count($r); $x ++) {
@@ -111,12 +111,12 @@ function sources_content(&$a) {
// edit source
$r = q("select source.*, xchan.* from source left join xchan on src_xchan = xchan_hash where src_id = %d and src_channel_id = %d limit 1",
intval(argv(1)),
- intval(local_user())
+ intval(local_channel())
);
if($r) {
$x = q("select abook_id from abook where abook_xchan = '%s' and abook_channel = %d limit 1",
dbesc($r[0]['src_xchan']),
- intval(local_user())
+ intval(local_channel())
);
}
if(! $r) {
@@ -144,7 +144,7 @@ function sources_content(&$a) {
if(argc() == 3 && intval(argv(1)) && argv(2) === 'drop') {
$r = q("select * from source where src_id = %d and src_channel_id = %d limit 1",
intval(argv(1)),
- intval(local_user())
+ intval(local_channel())
);
if(! $r) {
notice( t('Source not found.') . EOL);
@@ -152,7 +152,7 @@ function sources_content(&$a) {
}
$r = q("delete from source where src_id = %d and src_channel_id = %d",
intval(argv(1)),
- intval(local_user())
+ intval(local_channel())
);
if($r)
info( t('Source removed') . EOL);