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. Therefore, add more lines after the following section.
Copy codeThe Code is as follows:
$ RolenameField = $ link-> assocTDG-> rolesNameField;
Copy codeThe Code is as follows:
$ RolenameField = $ rolenameField? $ RolenameField: 'rolename ';