You are here

function backup_migrate_destination_files::edit_form_validate in Backup and Migrate 6.2

Same name and namespace in other branches
  1. 8.2 includes/destinations.file.inc \backup_migrate_destination_files::edit_form_validate()
  2. 8.3 includes/destinations.file.inc \backup_migrate_destination_files::edit_form_validate()
  3. 6.3 includes/destinations.file.inc \backup_migrate_destination_files::edit_form_validate()
  4. 7.3 includes/destinations.file.inc \backup_migrate_destination_files::edit_form_validate()
  5. 7.2 includes/destinations.file.inc \backup_migrate_destination_files::edit_form_validate()

Validate the form for the settings for the files destination.

Overrides backup_migrate_item::edit_form_validate

File

includes/destinations.file.inc, line 152
A destination type for saving locally to the server.

Class

backup_migrate_destination_files
A destination type for saving locally to the server.

Code

function edit_form_validate($form, &$form_state) {
  $values = $form_state['values'];
  if (isset($values['settings']['chmod']) && !empty($values['settings']['chmod']) && !preg_match('/0?[0-7]{3}/', $values['settings']['chmod'])) {
    form_set_error('chmod', t('You must enter a valid chmod octal value (e.g. 644 or 0644) in the change mode field, or leave it blank.'));
  }
  parent::edit_form_validate($form, $form_state);
}