2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * Displays form for password change
8 if (! defined('PHPMYADMIN')) {
13 * Get HTML for the Change password dialog
15 * @param string $username username
16 * @param string $hostname hostname
18 * @return string html snippet
20 function PMA_getHtmlForChangePassword($username, $hostname)
23 * autocomplete feature of IE kills the "onchange" event handler and it
24 * must be replaced by the "onpropertychange" one in this case
26 $chg_evt_handler = (PMA_USR_BROWSER_AGENT
== 'IE'
27 && PMA_USR_BROWSER_VER
>= 5
28 && PMA_USR_BROWSER_VER
< 7)
32 $html = '<form method="post" id="change_password_form" '
33 . 'action="' . $GLOBALS['PMA_PHP_SELF'] . '" '
34 . 'name="chgPassword" '
37 $html .= PMA_generate_common_hidden_inputs();
39 if (strpos($GLOBALS['PMA_PHP_SELF'], 'server_privileges') !== false) {
40 $html .= '<input type="hidden" name="username" '
41 . 'value="' . htmlspecialchars($username) . '" />'
42 . '<input type="hidden" name="hostname" '
43 . 'value="' . htmlspecialchars($hostname) . '" />';
45 $html .= '<fieldset id="fieldset_change_password">'
46 . '<legend>' . __('Change password') . '</legend>'
47 . '<table class="data noclick">'
50 . '<input type="radio" name="nopass" value="1" id="nopass_1" '
51 . 'onclick="pma_pw.value = \'\'; pma_pw2.value = \'\'; '
52 . 'this.checked = true" />'
53 . '<label for="nopass_1">' . __('No Password') . '</label>'
56 . '<tr class="even vmiddle">'
58 . '<input type="radio" name="nopass" value="0" id="nopass_0" '
59 . 'onclick="document.getElementById(\'text_pma_pw\').focus();" '
60 . 'checked="checked " />'
61 . '<label for="nopass_0">' . __('Password') . ': </label>'
64 . '<input type="password" name="pma_pw" id="text_pma_pw" size="10" '
66 . $chg_evt_handler . '="nopass[1].checked = true" />'
67 . ' ' . __('Re-type') . ': '
68 . '<input type="password" name="pma_pw2" id="text_pma_pw2" size="10" '
70 . $chg_evt_handler . '="nopass[1].checked = true" />'
73 . '<tr class="vmiddle">'
74 . '<td>' . __('Password Hashing') . ':'
77 . '<input type="radio" name="pw_hash" id="radio_pw_hash_new" '
78 . 'value="new" checked="checked" />'
79 . '<label for="radio_pw_hash_new">MySQL 4.1+</label>'
82 . '<tr id="tr_element_before_generate_password">'
85 . '<input type="radio" name="pw_hash" id="radio_pw_hash_old" '
87 . '<label for="radio_pw_hash_old">' . __('MySQL 4.0 compatible')
93 . '<fieldset id="fieldset_change_password_footer" class="tblFooters">'
94 . '<input type="submit" name="change_pw" value="' . __('Go') . '" />'