Local Plugin Settings - Password Field?

Local Plugin Settings - Password Field?

by Andrew Normore -
Number of replies: 3

Howdy folks, I've created a local plugin that requires a user password. What's the best way to handle this. 

My current code is: 

$password = isset( $CFG->password ) ? $CFG->password : '';
$settings->add( new admin_setting_configtext( 'password', get_string( 'password', 'local_' ), get_string( 'password_description', 'local_' ), $password ) );

However, when I edit the page, there's my password right there! How should I secure this?

Average of ratings: -
In reply to Andrew Normore

Re: Local Plugin Settings - Password Field?

by Hubert Chathi -

You can try admin_setting_configpasswordunmask instead of admin_setting_configtext.