X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Fsecurity_roles.php;h=7e68d3734854b6c45f647f021bfce8f9c1fec8cb;hb=bbb034b7e0ab111ce200d81ab5a9b56ad9ad880c;hp=885acd774429cc856b8584d1675d109ceee552c2;hpb=d1babda7c01b314d35fb89f2d195553b55936532;p=fa-stable.git diff --git a/admin/security_roles.php b/admin/security_roles.php index 885acd77..7e68d373 100644 --- a/admin/security_roles.php +++ b/admin/security_roles.php @@ -97,21 +97,13 @@ if (get_post('addupdate')) } // $areas = sort_areas($areas); - $sections = array_values($sections); + write_security_role($_POST['role'], $_POST['name'], $_POST['description'], + $sections, $areas, get_post('inactive')); - if ($new_role) - { - add_security_role($_POST['name'], $_POST['description'], $sections, $areas); - display_notification(_("New security role has been added.")); - } else - { - update_security_role($_POST['role'], $_POST['name'], $_POST['description'], - $sections, $areas); - update_record_status($_POST['role'], get_post('inactive'), - 'security_roles', 'id'); - - display_notification(_("Security role has been updated.")); - } + if ($new_role) + display_notification(_("New security role has been added.")); + else + display_notification(_("Security role has been updated.")); $new_role = true; clear_data(); $Ajax->activate('_page_body'); @@ -147,9 +139,6 @@ if (!isset($_POST['role']) || get_post('clone') || list_updated('role')) { $row = get_security_role($id); $_POST['description'] = $row['description']; $_POST['name'] = $row['role']; -// if ($row['inactive'] -// $_POST['inactive'] = 1; - $_POST['inactive'] = $row['inactive']; $access = $row['areas']; $sections = $row['sections']; @@ -214,8 +203,6 @@ end_table(1); $ext = $newext; $sec = $newsec; $m = $parms[0] & ~0xff; -// if(!isset($security_sections[$m])) -// display_error(sprintf("Bad section %X:", $m)); label_row($security_sections[$m].':', checkbox( null, 'Section'.$m, null, true, _("On/off set of features")),