DokuWiki

It's better when it's simple

User Tools

Site Tools


auth:userinfo_debugging

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
auth:userinfo_debugging [2015-01-03 18:43]
37.200.79.27
auth:userinfo_debugging [2018-07-25 23:13] (current)
Aaron Smith Update to conform with code base 2018-07-25
Line 9: Line 9:
 Original: Original:
 <code php> <code php>
-function tpl_userinfo(){ +function tpl_userinfo() { 
-  global $lang; +    global $lang; 
-  global $INFO+    /** @var Input $INPUT */ 
-  if($_SERVER['REMOTE_USER']){ +    global $INPUT
-    print $lang['loggedinas'].''.$INFO['userinfo']['name']+ 
-    return true; +    if($INPUT->server->str('REMOTE_USER')) { 
-  +        print $lang['loggedinas'].' '.userlink()
-  return false;+        return true; 
 +    
 +    return false;
 } }
 +
 </code> </code>
  
 With extra debugging information: With extra debugging information:
 <code php> <code php>
-function tpl_userinfo(){ +function tpl_userinfo() { 
-  global $lang; +    global $lang; 
-  global $INFO+    /** @var Input $INPUT */ 
-  if($_SERVER['REMOTE_USER']){ +    global $INPUT
-    print 'Debug:<br><font size=2><pre>'.print_r($INFO['userinfo'],true).'</pre></font>'+ 
-    return true; +    if($INPUT->server->str('REMOTE_USER')) { 
-  +        print $lang['loggedinas'].' '.userlink(); 
-  return false;+        msg('Debug user info:'.print_r($USERINFO, true), -1)
 +        return true; 
 +    
 +    return false;
 } }
 </code> </code>
Line 38: Line 44:
  
 <code php> <code php>
-function tpl_userinfo(){ +function tpl_userinfo() { 
-  global $lang; +    global $conf; 
-  global $INFO+    global $lang; 
-  global $conf+    global $USERINFO
-  if($_SERVER['REMOTE_USER']){ +    /** @var Input $INPUT */ 
-    if($conf['userinfo_debug'] == 'true'+    global $INPUT
-      print 'Debug:<br><font size=2><pre>'.print_r($INFO['userinfo'],true).'</pre></font>'+  
-    } else { +    if($INPUT->server->str('REMOTE_USER')) { 
-      print $lang['loggedinas'].': '.$INFO['userinfo']['name'];+        print $lang['loggedinas'].' '.userlink(); 
 +        if($conf['userinfo_debug'] == 1msg('Debug user info:'.print_r($USERINFO, true), -1)
 +        return true;
     }     }
-    return true; +    return false;
-  } +
-  return false;+
 } }
 </code> </code>
 Now to turn on debugging, set the following in ''conf/local.php'': Now to turn on debugging, set the following in ''conf/local.php'':
 <code php> <code php>
-$conf['userinfo_debug'] = 'true';+$conf['userinfo_debug'] = 1;
 </code> </code>
 To switch off debugging, set the following in ''conf/local.php'': To switch off debugging, set the following in ''conf/local.php'':
 <code php> <code php>
-$conf['userinfo_debug'] = 'false';+$conf['userinfo_debug'] = 0;
 </code> </code>
  
auth/userinfo_debugging.txt · Last modified: 2018-07-25 23:13 by Aaron Smith