From 2ccb8c2e2b776d870ab56b7d54508b77027c151f Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 16 Apr 2013 16:22:37 -0700 Subject: more doco --- boot.php | 22 ++++++++++++++++++++-- 1 file 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']; } /** -- cgit v1.2.3