/**
  * Validate the `acl_roles` table
  */
 function roles()
 {
     global $template, $user;
     // display extra config variables and let them check/uncheck the ones they want to add/remove
     $this->_section_data['roles'] = array('NAME' => 'ROLE_SETTINGS', 'TITLE' => 'ROWS');
     $role_rows = $existing_roles = array();
     get_role_rows($this->db_cleaner->data->acl_roles, $role_rows, $existing_roles);
     foreach ($role_rows as $name) {
         // Skip ones that are in the default install and are in the existing config
         if (isset($this->db_cleaner->data->acl_roles[$name]) && in_array($name, $existing_roles)) {
             continue;
         }
         $this->_section_data['roles']['ITEMS'][] = array('NAME' => $name, 'FIELD_NAME' => $name, 'MISSING' => !in_array($name, $existing_roles) ? true : false);
         if ($this->_has_changes === false) {
             $this->_has_changes = true;
         }
     }
     $template->assign_vars(array('NO_CHANGES_TEXT' => $user->lang['SECTION_NOT_CHANGED_EXPLAIN'][$this->db_cleaner->step_to_action[$this->db_cleaner->step]], 'NO_CHANGES_TITLE' => $user->lang['SECTION_NOT_CHANGED_TITLE'][$this->db_cleaner->step_to_action[$this->db_cleaner->step]]));
     $this->success_message = 'SYSTEM_GROUP_UPDATE_SUCCESS';
 }
 /**
  * Fix system roles
  */
 function roles(&$error, $selected)
 {
     global $umil;
     $role_rows = $existing_roles = array();
     get_role_rows($this->db_cleaner->data->acl_roles, $role_rows, $existing_roles);
     foreach ($role_rows as $name) {
         if (isset($this->db_cleaner->data->acl_roles[$name]) && in_array($name, $existing_roles)) {
             continue;
         }
         if (isset($selected[$name])) {
             if (isset($this->db_cleaner->data->acl_roles[$name]) && !in_array($name, $existing_roles)) {
                 // Add it with the default settings we've got...
                 $umil->permission_role_add($name, $this->db_cleaner->data->acl_roles[$name][1], $this->db_cleaner->data->acl_roles[$name][0]);
             } else {
                 if (!isset($this->db_cleaner->data->acl_roles[$name]) && in_array($name, $existing_roles)) {
                     // Remove it
                     $umil->permission_role_remove($name);
                 }
             }
         }
     }
 }
 /**
  * Validate the `acl_roles` table
  */
 function roles()
 {
     // display extra config variables and let them check/uncheck the ones they want to add/remove
     $this->_section_data['roles'] = array('NAME' => 'ROLE_SETTINGS', 'TITLE' => 'ROWS');
     $role_rows = $existing_roles = array();
     get_role_rows($this->db_cleaner->data->acl_roles, $role_rows, $existing_roles);
     foreach ($role_rows as $name) {
         // Skip ones that are in the default install and are in the existing config
         if (isset($this->db_cleaner->data->acl_roles[$name]) && in_array($name, $existing_roles)) {
             continue;
         }
         $this->_section_data['roles']['ITEMS'][] = array('NAME' => $name, 'FIELD_NAME' => $name, 'MISSING' => !in_array($name, $existing_roles) ? true : false);
         if ($this->_has_changes === false) {
             $this->_has_changes = true;
         }
     }
     $this->success_message = 'SYSTEM_GROUP_UPDATE_SUCCESS';
 }