- 2005年12月22日 13:00
- Perl / CGI
LoginToboggan モジュール
http://drupal.org/node/34309
1. Allow users to login using either their username OR their email address.
2. Allow users to define their own password during registration.
3. Allow users to login immediately after registration.
4. Provide a login form on Access Denied pages for non-logged-in (anonymous) users.
5. The module provides two login block options: One uses DHTML to display the form immediately upon clicking "log in". The other brings the user to a separate page, but returns the user to their original page upon login completion.
ただ、pre- and post- new-forms-api HEAD versions で動作するらしくうまく動かない。
Log in with E-mail パッチ
http://drupal.org/node/35110
これもまた古くなっていて動作せず。
そこで、user.module を以下のように修正。
(+の行を追加する)960行目前後
// Try to log in the user locally:
$user = user_load(array('name' => $name, 'pass' => $pass, 'status' => 1));
+ // Try to log in the user locally with E-Mail
+ if(!$user->uid) {
+ $user = user_load(array('mail' => $name, 'pass' => $pass, 'status' => 1));
+ }
// Strip name and server from ID:
if ($server = strrchr($name, '@')) {
$name = substr($name, 0, strlen($name) - strlen($server));
$server = substr($server, 1);
}
メールアドレスでログインできた。

