aboutsummaryrefslogtreecommitdiffstats
path: root/include/channel.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-07-17 21:40:04 -0700
committerredmatrix <git@macgirvin.com>2016-07-17 21:40:04 -0700
commitde4f9d68bdaade902a8030888f9df035fa1329ec (patch)
tree5021daad0c4002ce9b7c89233b7c8446552b5a07 /include/channel.php
parent191cd21028ab108c2a7f982c654601d780865eff (diff)
parent571b8cc85b3a770f16aed021bb39b889e0275ed6 (diff)
downloadvolse-hubzilla-de4f9d68bdaade902a8030888f9df035fa1329ec.tar.gz
volse-hubzilla-de4f9d68bdaade902a8030888f9df035fa1329ec.tar.bz2
volse-hubzilla-de4f9d68bdaade902a8030888f9df035fa1329ec.zip
Merge branch 'dev' into perms
Diffstat (limited to 'include/channel.php')
-rw-r--r--include/channel.php25
1 files changed, 23 insertions, 2 deletions
diff --git a/include/channel.php b/include/channel.php
index 28eac9d4c..0defc3863 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -1310,13 +1310,12 @@ function get_my_address() {
* 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.
*
- * @param App &$a
*
* @hooks 'zid_init'
* string 'zid' - their zid
* string 'url' - the destination url
*/
-function zid_init(&$a) {
+function zid_init() {
$tmp_str = get_my_address();
if(validate_email($tmp_str)) {
Zotlabs\Daemon\Master::Summon(array('Gprobe',bin2hex($tmp_str)));
@@ -1343,6 +1342,28 @@ function zid_init(&$a) {
}
/**
+ * @brief
+ *
+ * If somebody arrives at our site using a zat, authenticate them
+ *
+ */
+
+function zat_init() {
+ if(local_channel() || remote_channel())
+ return;
+
+ $r = q("select * from atoken where atoken_token = '%s' limit 1",
+ dbesc($_REQUEST['zat'])
+ );
+ if($r) {
+ atoken_login($r[0]);
+ }
+
+}
+
+
+
+/**
* @brief Adds a zid parameter to a url.
*
* @param string $s