Index: modules/user.module =================================================================== RCS file: /cvs/drupal/drupal/modules/user.module,v retrieving revision 1.509 diff -r1.509 user.module 8a9,10 > include_once './includes/form.inc'; > 518,528c520,523 < $edit = $_POST['edit']; < < // NOTE: special care needs to be taken because on pages with forms, < // such as node and comment submission pages, the $edit variable < // might already be set. < < $output .= form_textfield(t('Username'), 'name', $edit['name'], 15, 64); < $output .= form_password(t('Password'), 'pass', '', 15, 64); < $output .= form_submit(t('Log in')); < < $output = form($output, 'post', url('user/login', drupal_get_destination()), array('id' => 'user-login-form')); --- > $form['name'] = array(type => 'textfield', title => t('Username'), maxlength => 64, size => 15, required => TRUE); > $form['pass'] = array(type => 'password', title => t('Password'), maxlength => 64, size => 15, required => TRUE); > $form['submit'] = array(type => 'submit', value => t('Log in')); > $output .= drupal_get_form('user_login_block', $form, 'user_login'); 599a595,603 > > > function theme_user_login_block($form) { > $output = "
\n"; > $output .= form_render($form); > $output .= "
\n"; > return $output; > } > 815a820,821 > > 867a874 > $form['name'] = array(type => 'textfield', title => t('Username'), size => 30, maxlength => 64, required => TRUE); 869c876 < $output .= form_textfield(t('Username'), 'name', $edit['name'], 30, 64, t('Enter your %s username, or an ID from one of our affiliates: %a.', array('%s' => variable_get('site_name', 'local'), '%a' => implode(', ', user_auth_help_links())))); --- > $form['name'][description] = t('Enter your %s username, or an ID from one of our affiliates: %a.', array('%s' => variable_get('site_name', 'local'), '%a' => implode(', ', user_auth_help_links()))); 872c879,888 < $output .= form_textfield(t('Username'), 'name', $edit['name'], 30, 64, t('Enter your %s username.', array('%s' => variable_get('site_name', 'local')))); --- > $form['name'][description] = t('Enter your %s username.', array('%s' => variable_get('site_name', 'local'))); > } > $form['pass'] = array(type => 'password', title => t('Password'), size => 30, maxlength => 64, description => t('Enter the password that accompanies your username.'), required => TRUE); > $form['submit'] = array(type => 'submit', value => t('Log in'), weight => 2); > return drupal_get_form('user_login', $form); > } > > function user_login_validate($form_id, $form) { > if (!user_authenticate($form['name'][value], $form['pass'][value])) { > form_set_error($form['name'][name], t('invalid username and password')); 874,875c890 < $output .= form_password(t('Password'), 'pass', $pass, 30, 64, t('Enter the password that accompanies your username.')); < $output .= form_submit(t('Log in')); --- > } 877c892,894 < return form($output, 'post', url('user/login', drupal_get_destination())); --- > function user_login_execute($form) { > global $form_variables; > return user_login($form_variables); 1312,1315d1328 < case t('Log in'): < case 'login': < return user_login($edit); < break; 1402,1403c1415,1421 < if (drupal_is_denied($edit['type'], $edit['test'])) { < drupal_set_message(t('%test is not allowed.', array('%test' => theme('placeholder', $edit['test'])))); --- > if ($edit['user']) { > if (drupal_is_denied('user', $edit['user']['test'])) { > drupal_set_message(t('The username %name is not allowed.', array('%name' => theme('placeholder', $edit['user']['test'])))); > } > else { > drupal_set_message(t('The username %name is allowed.', array('%name' => theme('placeholder', $edit['user']['test'])))); > } 1405,1406c1423,1437 < else { < drupal_set_message(t('%test is allowed.', array('%test' => theme('placeholder', $edit['test'])))); --- > if ($edit['mail']) { > if (drupal_is_denied('mail', $edit['mail']['test'])) { > drupal_set_message(t('The e-mail address %mail is not allowed.', array('%mail' => theme('placeholder', $edit['mail']['test'])))); > } > else { > drupal_set_message(t('The e-mail address %mail is allowed.', array('%mail' => theme('placeholder', $edit['mail']['test'])))); > } > } > if ($edit['host']) { > if (drupal_is_denied('host', $edit['host']['test'])) { > drupal_set_message(t('The hostname %host is not allowed.', array('%host' => theme('placeholder', $edit['host']['test'])))); > } > else { > drupal_set_message(t('The hostname %host is allowed.', array('%host' => theme('placeholder', $edit['host']['test'])))); > } 1410,1423c1441,1460 < $form = form_textfield('', 'test', '', 30, 64, t('Enter a username to check if it will be denied or allowed.')); < $form .= form_hidden('type', 'user'); < $form .= form_submit(t('Check username')); < $output .= form_group(t('Username'), form($form)); < < $form = form_textfield('', 'test', '', 30, 64, t('Enter an e-mail address to check if it will be denied or allowed.')); < $form .= form_hidden('type', 'mail'); < $form .= form_submit(t('Check e-mail')); < $output .= form_group(t('E-mail'), form($form)); < < $form = form_textfield('', 'test', '', 30, 64, t('Enter a host to check if it will be denied or allowed.')); < $form .= form_hidden('type', 'host'); < $form .= form_submit(t('Check host')); < $output .= form_group(t('Host'), form($form)); --- > $form['user'] = array(type => 'fieldset', title => t('Username')); > $form['user']['test'] = array(type => 'textfield', title => '', description => t('Enter a username to check if it will be denied or allowed.'), width => 30, maxlength => 64); > $form['user']['type'] = array(type => 'hidden', value => 'user'); > $form['user']['submit'] = array(type => 'submit', value => t('Check username')); > $output .= drupal_get_form('check_user', $form); > unset($form); // prevent endless loop? > > $form['mail'] = array(type => 'fieldset', title => t('E-mail')); > $form['mail']['test'] = array(type => 'textfield', title => '', description => t('Enter an e-mail address to check if it will be denied or allowed.'), width => 30, maxlength => 64); > $form['mail']['type'] = array(type => 'hidden', value => 'mail'); > $form['mail']['submit'] = array(type => 'submit', value => t('Check e-mail')); > $output .= drupal_get_form('check_mail', $form); > unset($form); // prevent endless loop? > > $form['host'] = array(type => 'fieldset', title => t('Hostname')); > $form['host']['test'] = array(type => 'textfield', title => '', description => t('Enter a hostname or IP address to check if it will be denied or allowed.'), width => 30, maxlength => 64); > $form['host']['type'] = array(type => 'hidden', value => 'host'); > $form['host']['submit'] = array(type => 'submit', value => t('Check hostname')); > $output .= drupal_get_form('check_host', $form); > unset($form); // prevent endless loop?