Copy CodeThe code is as follows:
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;
}
The Rolesnamefield defined in the page is also invalid, so gator a line after this paragraph
Copy CodeThe code is as follows:
$rolenameField = $link->assoctdg->rolesnamefield;
Copy CodeThe code is as follows:
$rolenameField = $rolenameField? $rolenameField: ' RoleName ';
http://www.bkjia.com/PHPjc/323252.html www.bkjia.com true http://www.bkjia.com/PHPjc/323252.html techarticle Copy the code code as follows: function Fetchroles ($user) {if ($this-existslink ($this-rolesfield)) {$link = $this-getlink ($ This-rolesfield); $rolenameField = $link-assoctdg-rolesname ...