You are here

function uc_wishlist_settings_form_validate in UC Wish List 7

Same name and namespace in other branches
  1. 6 uc_wishlist.pages.inc \uc_wishlist_settings_form_validate()

Validation handler for wish list settings form.

File

./uc_wishlist.pages.inc, line 316
Page callback and functions for wish lists.

Code

function uc_wishlist_settings_form_validate($form, &$form_state) {
  global $user;
  $wid = $form_state['values']['wid'];
  $wishlist = uc_wishlist_load($wid);
  if (!$wishlist) {
    drupal_set_message(t('Could not find the specified wish list.'), 'error');
    return FALSE;
  }
  if ($wishlist->uid != $user->uid && !user_perm('administer store')) {
    drupal_set_message(t('You do not have permission to edit this wish list.'), 'error');
    return FALSE;
  }
}