You are here

function privatemsg_rename_folder_form_validate in Privatemsg 5

Same name and namespace in other branches
  1. 5.3 privatemsg.module \privatemsg_rename_folder_form_validate()

File

./privatemsg.module, line 1320

Code

function privatemsg_rename_folder_form_validate($form_id, $form_values) {
  global $user;
  if (!empty($form_values['new_name']) && $form_values['new_name'] != $form_values['old_name'] && db_result(db_query("SELECT name FROM {privatemsg_folder} WHERE name = '%s' AND uid = %d", $form_values['new_name'], $user->uid))) {
    form_set_error('new_name', t('A folder with this name already exists.'));
  }
  if (empty($form_values['new_name'])) {
    form_set_error('new_name', t('You must specify a name for the new folder.'));
  }
}