From d66d8ff524203ccc0fae894b483178b2f706b711 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 5 Dec 2013 15:40:50 -0800 Subject: 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. --- mod/authtest.php | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 mod/authtest.php (limited to 'mod/authtest.php') 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 @@ +Magic-Auth Diagnostic'; + + if(! local_user()) { + notice( t('Permission denied.') . EOL); + return $o; + } + + $o .= '
'; + $o .= 'Target URL: '; + $o .= '
'; + + $o .= '

'; + + 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",'
',$o); +} -- cgit v1.2.3