- $m = 0;
- foreach($security_areas as $area =>$descr ) {
- if (($area&~0xff) != $m)
- { // features set selection
- $m = $area & ~0xff;
- label_row(sprintf(_("%s features:"), $security_modules[$m]),
- checkbox( null, 'Module'.$m, null, true,
- _("Set access to security features area")),
- "class='tableheader2'", "class='tableheader'");
- }
- if (check_value('Module'.$m)) {
+ $ext = $sec = $m = -1;
+
+ foreach(sort_areas($security_areas) as $area =>$parms ) {
+ // system setup areas are accessable only for site admins i.e.
+ // admins of first registered company
+ if (user_company() && (($parms[0]&0xff00) == SS_SADMIN)) continue;
+
+ $newsec = ($parms[0]>>8)&0xff;
+ $newext = $parms[0]>>16;
+ if ($newsec != $sec || (($newext != $ext) && ($newsec>99)))
+ { // features set selection
+ $ext = $newext;
+ $sec = $newsec;
+ $m = $parms[0] & ~0xff;
+ label_row($security_sections[$m].':',
+ checkbox( null, 'Section'.$m, null, true,
+ _("On/off set of features")),
+ "class='tableheader2'", "class='tableheader'");
+ }
+ if (check_value('Section'.$m)) {