/[drupal]/contributions/modules/nocase/nocase.module
ViewVC logotype

Contents of /contributions/modules/nocase/nocase.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download) (as text)
Wed Oct 24 18:33:17 2007 UTC (2 years, 1 month ago) by karthik
Branch: MAIN
CVS Tags: HEAD
Branch point for: DRUPAL-5
File MIME type: text/x-php
Initial commit: nocase is a simple module that allows for case insensitive Drupal passwords.
1 <?php
2 // $Id$
3
4 /**
5 * @file
6 * The nocase module allows for case insensitive Drupal passwords.
7 *
8 * @author Karthik Kumar ( http://drupal.org/user/21209 )
9 */
10
11 /**
12 * Implementation of hook_form_alter.
13 */
14 function nocase_form_alter($form_id, &$form) {
15 if ($form['#base'] == 'user_login' || $form_id == 'user_register') {
16 // Give nocase module's validate function preference over user_login.
17 $form['#validate'] = array('nocase_login_validate' => array()) + $form['#validate'];
18 }
19 }
20
21 /**
22 * Validation handler for the user_login and user_register forms.
23 */
24 function nocase_login_validate($form_id, $form_values) {
25 // Convert password to lowercase.
26 form_set_value(array('#parents' => array('pass')), strtolower(trim($form_values['pass'])));
27 }

  ViewVC Help
Powered by ViewVC 1.1.2