fleaphp rolesNameField bug解决方法
代码如下:
function fetchRoles($user) { if ($this->existsLink($this->rolesField)) { $link =& $this->getLink($this->rolesField); $rolenameField = $link->assocTDG->rolesNameField; } else { $rolenameField = 'rolename'; } if (!isset($user[$this->rolesField]) || !is_array($user[$this->rolesField])) { return array(); } $roles = array(); foreach ($user[$this->rolesField] as $role) { if (!is_array($role)) { return array($user[$this->rolesField][$rolenameField]); } $roles[] = $role[$rolenameField]; } return $roles; }
在页面中定义了rolesNameField 也无效,因此在下面这段后面加多一行
代码如下:
$rolenameField = $link->assocTDG->rolesNameField;
代码如下:
$rolenameField = $rolenameField ? $rolenameField : 'rolename';
相关推荐
LaputaSpring 2012-02-09
laj0 2009-06-01
记录学习备忘人生 2012-12-12
hualicc 2011-11-17
SwingGUI 2011-04-08
VincentDrW 2008-04-02