aboutsummaryrefslogtreecommitdiffstats
path: root/mod/authtest.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-12-05 15:40:50 -0800
committerfriendica <info@friendica.com>2013-12-05 15:40:50 -0800
commitd66d8ff524203ccc0fae894b483178b2f706b711 (patch)
tree97597dd54adfa7f9ad1f657589d20457bfdc561c /mod/authtest.php
parentcc1e906825dd30f74d0a30190a7dd2a26d6b1642 (diff)
downloadvolse-hubzilla-d66d8ff524203ccc0fae894b483178b2f706b711.tar.gz
volse-hubzilla-d66d8ff524203ccc0fae894b483178b2f706b711.tar.bz2
volse-hubzilla-d66d8ff524203ccc0fae894b483178b2f706b711.zip
mod_authtest --- magic-auth diagnostic for those that are too freaking important to read logs or code and expect others to be able to debug complex authentication transactions with no information beyond "it didn't work". This will provide a transaction report including both sides of the exchange that you can paste into a bug report and that a developer can actually figure out where in the transaction that things went wrong and maybe even be able to then figure out why.
Diffstat (limited to 'mod/authtest.php')
-rw-r--r--mod/authtest.php43
1 files changed, 43 insertions, 0 deletions
diff --git a/mod/authtest.php b/mod/authtest.php
new file mode 100644
index 000000000..ec32fe171
--- /dev/null
+++ b/mod/authtest.php
@@ -0,0 +1,43 @@
+<?php
+
+require_once('include/zot.php');
+require_once('mod/magic.php');
+
+function authtest_content(&$a) {
+
+
+
+ $o .= '<h3>Magic-Auth Diagnostic</h3>';
+
+ if(! local_user()) {
+ notice( t('Permission denied.') . EOL);
+ return $o;
+ }
+
+ $o .= '<form action="authtest" method="get">';
+ $o .= 'Target URL: <input type="text" style="width: 250px;" name="dest" value="' . $_GET['dest'] .'" />';
+ $o .= '<input type="submit" name="submit" value="Submit" /></form>';
+
+ $o .= '<br /><br />';
+
+ if(x($_GET,'dest')) {
+ $_REQUEST['test'] = 1;
+ $x = magic_init($a);
+ $o .= 'Local Setup returns: ' . print_r($x,true);
+
+
+
+ if($x['url']) {
+ $z = z_fetch_url($x['url'] . '&test=1');
+ if($z['success']) {
+ $j = json_decode($z['body'],true);
+ $o .= 'Remote site responded: ' . print_r($j,true);
+ }
+ else {
+ $o .= 'fetch url failure.' . print_r($z,true);
+ }
+ }
+ }
+
+ return str_replace("\n",'<br />',$o);
+}