You are here

function _login_security_valid_user in Login Security 6

Same name and namespace in other branches
  1. 7 login_security.admin.inc \_login_security_valid_user()
1 string reference to '_login_security_valid_user'
login_security_admin_settings in ./login_security.admin.inc
Build a form body for the configuration settings.

File

./login_security.admin.inc, line 208
login_security.menu.inc

Code

function _login_security_valid_user($element, &$form_state) {
  if ($element['#value'] !== '') {
    $count = db_result(db_query("SELECT COUNT(*) FROM {users} WHERE name = '%s'", $element['#value']));
    if (intval($count) != 1) {
      form_error($element, t('The !field field should be a valid username.', array(
        '!field' => $element['#title'],
      )));
    }
  }
}