aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
authorroot <root@diekershoff.homeunix.net>2010-12-26 08:18:10 +0100
committerroot <root@diekershoff.homeunix.net>2010-12-26 08:18:10 +0100
commit3208d6afcbcf6e74ca5d0ac30be1559327e00bf9 (patch)
treec940d0870729dbeb70845a96f36a6a15926dd9f2 /mod
parentc6a93d5cec05e9282b2f2d26fdfbc93175ed2b06 (diff)
parent10dda88684331366b10967981e661acf5b229ac6 (diff)
downloadvolse-hubzilla-3208d6afcbcf6e74ca5d0ac30be1559327e00bf9.tar.gz
volse-hubzilla-3208d6afcbcf6e74ca5d0ac30be1559327e00bf9.tar.bz2
volse-hubzilla-3208d6afcbcf6e74ca5d0ac30be1559327e00bf9.zip
Merge branch 'master' of git://github.com/friendika/friendika
Diffstat (limited to 'mod')
-rw-r--r--mod/dfrn_poll.php10
-rw-r--r--mod/directory.php9
-rw-r--r--mod/display.php8
-rw-r--r--mod/network.php8
-rw-r--r--mod/parse_url.php11
-rw-r--r--mod/profile.php7
-rw-r--r--mod/redir.php5
7 files changed, 47 insertions, 11 deletions
diff --git a/mod/dfrn_poll.php b/mod/dfrn_poll.php
index 22d2ee40f..52272efad 100644
--- a/mod/dfrn_poll.php
+++ b/mod/dfrn_poll.php
@@ -99,18 +99,18 @@ function dfrn_poll_init(&$a) {
dbesc($sec)
);
if(! count($r)) {
- xml_status(3);
+ xml_status(3, 'No ticket');
// NOTREACHED
}
$orig_id = $r[0]['dfrn_id'];
- if(strpos(':',$orig_id))
+ if(strpos($orig_id, ':'))
$orig_id = substr($orig_id,2);
$c = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
intval($r[0]['cid'])
);
if(! count($c)) {
- xml_status(3);
+ xml_status(3, 'No profile');
}
$contact = $c[0];
@@ -134,9 +134,9 @@ function dfrn_poll_init(&$a) {
$final_dfrn_id = substr($final_dfrn_id,2);
if($final_dfrn_id != $orig_id) {
-
+ logger('profile_check: ' . $final_dfrn_id . ' != ' . $orig_id, LOGGER_DEBUG);
// did not decode properly - cannot trust this site
- xml_status(3);
+ xml_status(3, 'Bad decryption');
}
header("Content-type: text/xml");
diff --git a/mod/directory.php b/mod/directory.php
index 49aac657c..062aae516 100644
--- a/mod/directory.php
+++ b/mod/directory.php
@@ -83,7 +83,7 @@ function directory_content(&$a) {
if(strlen($rr['gender']))
$details .= '<br />Gender: ' . $rr['gender'];
- $o .= replace_macros($tpl,array(
+ $entry = replace_macros($tpl,array(
'$id' => $rr['id'],
'$profile-link' => $profile_link,
'$photo' => $rr[$photo],
@@ -94,7 +94,14 @@ function directory_content(&$a) {
));
+ $arr = array('contact' => $rr, 'entry' => $entry);
+
+ call_hooks('directory_item', $arr);
+
+ $o .= $entry;
+
}
+
$o .= "<div class=\"directory-end\" ></div>\r\n";
$o .= paginate($a);
diff --git a/mod/display.php b/mod/display.php
index 990d0b431..fd845e608 100644
--- a/mod/display.php
+++ b/mod/display.php
@@ -241,7 +241,7 @@ function display_content(&$a) {
$indent .= ' shiny';
- $o .= replace_macros($template,array(
+ $tmp_item = replace_macros($template,array(
'$id' => $item['item_id'],
'$profile_url' => $profile_link,
'$name' => $profile_name,
@@ -264,6 +264,12 @@ function display_content(&$a) {
'$comment' => $comment
));
+ $arr = array('item' => $item, 'output' => $tmp_item);
+ call_hooks('display_item', $arr);
+
+ $o .= $arr['output'];
+
+
}
}
else {
diff --git a/mod/network.php b/mod/network.php
index 43c55b8e3..ad6db2d1e 100644
--- a/mod/network.php
+++ b/mod/network.php
@@ -284,7 +284,7 @@ function network_content(&$a, $update = 0) {
// Build the HTML
- $o .= replace_macros($template,array(
+ $tmp_item = replace_macros($template,array(
'$id' => $item['item_id'],
'$profile_url' => $profile_link,
'$name' => $profile_name,
@@ -306,6 +306,12 @@ function network_content(&$a, $update = 0) {
'$dislike' => $dislike,
'$comment' => $comment
));
+
+ $arr = array('item' => $item, 'output' => $tmp_item);
+ call_hooks('display_item', $arr);
+
+ $o .= $arr['output'];
+
}
}
diff --git a/mod/parse_url.php b/mod/parse_url.php
index 1561eb8a3..b3b42b6cb 100644
--- a/mod/parse_url.php
+++ b/mod/parse_url.php
@@ -11,6 +11,16 @@ function parse_url_content(&$a) {
$template = "<a href=\"%s\" >%s</a>%s";
+
+ $arr = array('url' => $url, 'text' => '');
+
+ call_hooks('parse_link', $arr);
+
+ if(strlen($arr['text'])) {
+ echo $arr['text'];
+ killme();
+ }
+
if($url)
$s = fetch_url($url);
else {
@@ -18,6 +28,7 @@ function parse_url_content(&$a) {
killme();
}
+
if(! $s) {
echo sprintf($template,$url,$url,'');
killme();
diff --git a/mod/profile.php b/mod/profile.php
index ffc412805..cc0debd99 100644
--- a/mod/profile.php
+++ b/mod/profile.php
@@ -342,7 +342,7 @@ function profile_content(&$a, $update = 0) {
if(strcmp(datetime_convert('UTC','UTC',$item['created']),datetime_convert('UTC','UTC','now - 12 hours')) > 0)
$indent .= ' shiny';
- $o .= replace_macros($template,array(
+ $tmp_item = replace_macros($template,array(
'$id' => $item['item_id'],
'$profile_url' => $profile_link,
'$name' => $profile_name,
@@ -360,6 +360,11 @@ function profile_content(&$a, $update = 0) {
'$dislike' => $dislike,
'$comment' => $comment
));
+
+ $arr = array('item' => $item, 'output' => $tmp_item);
+ call_hooks('display_item', $arr);
+
+ $o .= $arr['output'];
}
}
diff --git a/mod/redir.php b/mod/redir.php
index cc58b9cd1..ac21aa17e 100644
--- a/mod/redir.php
+++ b/mod/redir.php
@@ -6,7 +6,7 @@ function redir_init(&$a) {
goaway($a->get_baseurl());
$cid = $a->argv[1];
- $r = q("SELECT `network`, `issued-id`, `dfrn-id`, `duplex`, `poll` FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
+ $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($cid),
intval(local_user())
);
@@ -36,8 +36,9 @@ function redir_init(&$a) {
intval(time() + 45)
);
+ logger('mod_redir: ' . $r[0]['name'] . ' ' . $sec, LOGGER_DEBUG);
+
goaway ($r[0]['poll'] . '?dfrn_id=' . $dfrn_id
-// . '&dfrn_version=' . DFRN_PROTOCOL_VERSION . '&type=profile');
. '&dfrn_version=' . DFRN_PROTOCOL_VERSION . '&type=profile&sec=' . $sec);
}