} if ($GROUP['name'] == null) { $ERRORS[] = 'No name specified.'; } elseif (strlen($GROUP['name']) > 50) { $ERRORS[] = 'There is a maxlength=50 on that field for a reason.'; } if ($GROUP['description'] == null) { $ERRORS[] = 'No description specified.'; } if (in_array($GROUP['show'], array_keys($Y_N)) == false) { $ERRORS[] = 'Invalid option for show on staff list specified.'; } if (sizeof($ERRORS) > 0) { draw_errors($ERRORS); } else { $group->setGroupName($GROUP['name']); $group->setGroupDescr($GROUP['description']); $group->setOrderBy($GROUP['order_by']); $group->setShowStaffGroup($GROUP['show']); $group->save(); $group->updatePermissions($_POST['group']['permissions']); $_SESSION['permission_notice'] = "You have saved <strong>{$group->getGroupName()}</strong>."; redirect('admin-permissions'); } // end no errors break; // end save } // end state switch } // end no errors