1
banned
Smarty debug only for Admin
  • 2004/12/6 14:21

  • banned

  • Not too shy to talk

  • Posts: 159

  • Since: 2004/5/16


I want to allow the smarty debug mode just for admin.

<?php

/*
 * Smarty plugin
 * -------------------------------------------------------------
 * Type:     function
 * Name:     debug
 * Version:  1.0
 * Date:     July 1, 2002
 * Author:     Monte Ohrt <monte@ispi.net>
 * Purpose:  popup debug window
 * -------------------------------------------------------------
 */
function smarty_function_debug($params, &$smarty)
{
    if(
$params['output']) && ($xoopsUser->isAdmin)) {
        
$smarty->assign('_smarty_debug_output',$params['output']);
    }
    return 
$smarty->_generate_debug_output();
}

/* vim: set expandtab: */

?>

file: /class/smarty/plugins/fuction.debug.php
added: && ($xoopsUser->isAdmin))

Don't work. How to fix?

2
ackbarr
Re: Smarty debug only for Admin

Try this:
<?php

/*
 * Smarty plugin
 * -------------------------------------------------------------
 * Type:     function
 * Name:     debug
 * Version:  1.0
 * Date:     July 1, 2002
 * Author:     Monte Ohrt <monte@ispi.net>
 * Purpose:  popup debug window
 * -------------------------------------------------------------
 */
function smarty_function_debug($params, &$smarty)
{
    global 
$xoopsUser;
    
$bAdmin = (isset($xoopsUser) && $xoopsUser->isAdmin());

    if(
$params['output']) && $bAdmin) {
        
$smarty->assign('_smarty_debug_output',$params['output']);
    }
    return 
$smarty->_generate_debug_output();
}

/* vim: set expandtab: */

?>

3
banned
Re: Smarty debug only for Admin
  • 2004/12/7 3:15

  • banned

  • Not too shy to talk

  • Posts: 159

  • Since: 2004/5/16


Thanks

Login

Who's Online

122 user(s) are online (88 user(s) are browsing Support Forums)


Members: 0


Guests: 122


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits