Latest Reform commit: Exclude UID 1

Here is the latest commit for one of my Drupal module, Reform.

But first, what is Reform module?

Perhaps sometimes you want something simple, such as limiting the minimum length and maximum length of a username. This module allows you to do simple things like that.
function reform_name_validate($form, &$form_state) {
  global $user;
  if (isset($form_state['values']['name'])) {
    if ($user->uid != 1) {
      if ($error = reform_validate_name($form_state['values']['name'])) {
        form_set_error('name', $error);
      }
    }
  }
}

UID 1 will always be able to pass through all the long and the short boundaries of username. Read the release note for Reform 7.x-1.0-alpha2.


Author: danpros

A self-proclaimed geek, business owner, and part-time blogger.

Comments on “Latest Reform commit: Exclude UID 1”