You are here

function password_toggle_init in Password toggle 7

Same name and namespace in other branches
  1. 6 password_toggle.module \password_toggle_init()

Implements hook_init().

Add the password toggle JS and CSS to specific pages.

File

./password_toggle.module, line 35
Simple module that adds a checkbox to toggle password masking on login forms.

Code

function password_toggle_init() {
  global $user;

  // Only act for anonymous users.
  if ($user->uid == 0) {

    // Pages where this should show:
    // The login page.
    if (arg(0) == 'user' && arg(1) == NULL) {
      password_toggle_add_js_and_css();
    }
  }
}