// Initialize local parameters $showSystemCategory = false; // only users with the special right are allowed to manage roles if (!$gCurrentUser->manageRoles()) { $gMessage->show($gL10n->get('SYS_NO_RIGHTS')); } if ($getRoleId > 0) { $headline = $gL10n->get('ROL_EDIT_ROLE'); } else { $headline = $gL10n->get('SYS_CREATE_ROLE'); } $gNavigation->addUrl(CURRENT_URL, $headline); // Rollenobjekt anlegen $role = new TableRoles($gDb); if ($getRoleId > 0) { $role->readDataById($getRoleId); // Pruefung, ob die Rolle zur aktuellen Organisation gehoert if ($role->getValue('cat_org_id') != $gCurrentOrganization->getValue('org_id') && $role->getValue('cat_org_id') > 0) { $gMessage->show($gL10n->get('SYS_NO_RIGHTS')); } // Rolle Webmaster darf nur vom Webmaster selber erstellt oder gepflegt werden if ($role->getValue('rol_webmaster') == 1 && !$gCurrentUser->isWebmaster()) { $gMessage->show($gL10n->get('SYS_NO_RIGHTS')); } // hidden roles can also see hidden categories if ($role->getValue('cat_system') == 1) { $showSystemCategory = true; } } else { $role->setValue('rol_this_list_view', '1'); $role->setValue('rol_mail_this_role', '2');
$act_group_short = '(' . $gL10n->get('SYS_FORMER_PL') . ')'; $act_number = '-1'; } elseif ($act_or === 2) { $act_group = $gL10n->get('SYS_ROLES') . ' (' . $gL10n->get('LST_ACTIVE_FORMER_MEMBERS') . ')'; $act_group_short = '(' . $gL10n->get('MSG_ACTIVE_FORMER_SHORT') . ')'; $act_number = '-2'; } else { $act_group = $gL10n->get('SYS_ROLES') . ' (' . $gL10n->get('LST_ACTIVE_MEMBERS') . ')'; $act_number = ''; } // list array with all roles where user is allowed to send mail to $send_roles = $gCurrentUser->getAllMailRoles(); foreach ($send_roles as &$allowed_role) { // Rollenobjekt anlegen $role = new TableRoles($gDb); $role->readDataById($allowed_role); if ($act_number == '' || $role->hasFormerMembers($allowed_role) > 0 && $gPreferences['mail_show_former'] == 1) { $list[] = array('groupID: ' . $allowed_role . $act_number, $role->getValue('rol_name') . ' ' . $act_group_short, $act_group); $list_rol_id_array[] = $allowed_role; } } } foreach (array_unique($list_rol_id_array) as $key) { if (isset($list_rol_id)) { $list_rol_id .= ", '" . $key . "'"; } else { $list_rol_id = "'" . $key . "'"; } } // select Users $sql = 'SELECT usr_id, first_name.usd_value as first_name, last_name.usd_value as last_name,