aboutsummaryrefslogtreecommitdiffstats
path: root/boot.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-04-16 16:22:37 -0700
committerfriendica <info@friendica.com>2013-04-16 16:22:37 -0700
commit2ccb8c2e2b776d870ab56b7d54508b77027c151f (patch)
treee90740d286b2092e5f8f1fd638c60b1b06b74f39 /boot.php
parent36bfe90882b9ca1268e6338281c8da28803ae3eb (diff)
downloadvolse-hubzilla-2ccb8c2e2b776d870ab56b7d54508b77027c151f.tar.gz
volse-hubzilla-2ccb8c2e2b776d870ab56b7d54508b77027c151f.tar.bz2
volse-hubzilla-2ccb8c2e2b776d870ab56b7d54508b77027c151f.zip
more doco
Diffstat (limited to 'boot.php')
-rw-r--r--boot.php22
1 files changed, 20 insertions, 2 deletions
diff --git a/boot.php b/boot.php
index e4452dcb7..8e6b85905 100644
--- a/boot.php
+++ b/boot.php
@@ -2009,6 +2009,17 @@ function get_my_address() {
return false;
}
+/**
+ * @function zid_init(&$a)
+ * If somebody arrives at our site using a zid, add their xchan to our DB if we don't have it already.
+ * And if they aren't already authenticated here, attempt reverse magic auth.
+ *
+ * @hooks 'zid_init'
+ * string 'zid' - their zid
+ * string 'url' - the destination url
+ *
+ */
+
function zid_init(&$a) {
$tmp_str = get_my_address();
if(validate_email($tmp_str)) {
@@ -2038,6 +2049,10 @@ function zid_init(&$a) {
* Currently unused
* @return string
*
+ * @hooks 'zid'
+ * string url - url to accept zid
+ * string zid - urlencoded zid
+ * string result - the return string we calculated, change it if you want to return something else
*/
@@ -2053,8 +2068,11 @@ function zid($s,$force = false) {
$mine = get_my_url();
$myaddr = get_my_address();
if($mine and ! link_compare($mine,$s))
- return $s . (($num_slashes >= 3) ? '' : '/') . $achar . 'zid=' . urlencode($myaddr);
- return $s;
+ $zurl = $s . (($num_slashes >= 3) ? '' : '/') . $achar . 'zid=' . urlencode($myaddr);
+
+ $arr = array('url' => $s, 'zid' => urlencode($myaddr), 'result' => $zurl);
+ call_hooks('zid', $arr);
+ return $arr['result'];
}
/**