function password_toggle_init in Password toggle 6
Same name and namespace in other branches
- 7 password_toggle.module \password_toggle_init()
Implementation of hook_init().
Add the password toggle JS to specific pages.
File
- ./
password_toggle.module, line 35 - password_toggle.module 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();
}
}
}