Revision: 89
http://sourceforge.net/p/beeframework/code/89
Author: m_plomer
Date: 2013-09-16 20:30:50 +0000 (Mon, 16 Sep 2013)
Log Message:
-----------
- fixed smarty block function bee_auth_has_role
Modified Paths:
--------------
trunk/framework/resources/smarty/block.bee_auth_has_role.php
Modified: trunk/framework/resources/smarty/block.bee_auth_has_role.php
===================================================================
--- trunk/framework/resources/smarty/block.bee_auth_has_role.php 2013-09-16 20:15:39 UTC (rev 88)
+++ trunk/framework/resources/smarty/block.bee_auth_has_role.php 2013-09-16 20:30:50 UTC (rev 89)
@@ -35,15 +35,15 @@
if($repeat) {
$roles = Bee_Security_Helper::getRoles();
- $requiredRoles = array_map('trim', explode(',', $params['all']));
- $possibleRoles = array_map('trim', explode(',', $params['any']));
- $forbiddenRoles = array_map('trim', explode(',', $params['none']));
+ $requiredRoles = array_filter(array_map('trim', explode(',', $params['all'])));
+ $possibleRoles = array_filter(array_map('trim', explode(',', $params['any'])));
+ $forbiddenRoles = array_filter(array_map('trim', explode(',', $params['none'])));
// check if all required roles present
$repeat = array_intersect($roles, $requiredRoles) === $requiredRoles;
// check if any of the possible roles are present
- $repeat = $repeat && count($possibleRoles) > 0 ? count(array_intersect($roles, $possibleRoles)) > 0 : true;
+ $repeat = $repeat && (count($possibleRoles) > 0 ? count(array_intersect($roles, $possibleRoles)) > 0 : true);
// check that none of the forbidden roles are present
$repeat = $repeat && count(array_intersect($roles, $forbiddenRoles)) === 0;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|