Completed
Push — master ( cf0d01...a2ef41 )
by Michael
23s
created

function.securityToken.php ➔ smarty_function_securityToken()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 2
dl 0
loc 4
rs 10
1
<?php
2
/**
3
 * XOOPS securityToken Smarty compiler plug-in
4
 *
5
 * @copyright   XOOPS Project (http://xoops.org)
6
 * @license     GNU GPL 2 or later (http://www.gnu.org/licenses/gpl-2.0.html)
7
 * @author      Richard Griffith <[email protected]>
8
 */
9
10
/**
11
 * Inserts a XOOPS security token
12
 *
13
 * Not sure if this is a good idea (sounds like application logic, not presentation,)
14
 * but there are several token generations done in {php} tags which don't work with
15
 * Smarty 3.1
16
 *
17
 * @param $params
18
 * @param $smarty
19
 * @return null
20
 */
21
function smarty_function_securityToken($params, &$smarty)
0 ignored issues
show
Unused Code introduced by
The parameter $params is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $smarty is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
22
{
23
    echo $GLOBALS['xoopsSecurity']->getTokenHTML();
24
}
25