Implemented automatic security checks in the Controller. Opened up the security class to accept an array as an argument and will great that array as if it's the array coming from func_get_args().
This commit is contained in:
parent
cf4a1307e8
commit
4dd9249ba0
2 changed files with 91 additions and 8 deletions
|
@ -135,7 +135,13 @@ class Security
|
|||
{
|
||||
if (isset($_SESSION['__pickles']['security']['level']))
|
||||
{
|
||||
foreach (func_get_args() as $access_level)
|
||||
$arguments = func_get_args();
|
||||
if (is_array($arguments[0]))
|
||||
{
|
||||
$arguments = $arguments[0];
|
||||
}
|
||||
|
||||
foreach ($arguments as $access_level)
|
||||
{
|
||||
if (self::checkLevel($access_level))
|
||||
{
|
||||
|
@ -172,7 +178,13 @@ class Security
|
|||
{
|
||||
if (isset($_SESSION['__pickles']['security']['level']))
|
||||
{
|
||||
foreach (func_get_args() as $access_level)
|
||||
$arguments = func_get_args();
|
||||
if (is_array($arguments[0]))
|
||||
{
|
||||
$arguments = $arguments[0];
|
||||
}
|
||||
|
||||
foreach ($arguments as $access_level)
|
||||
{
|
||||
if (self::checkLevel($access_level))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue