added japanese language
[openemr.git] / phpmyadmin / libraries / display_change_password.lib.php
blobc93fcab6b17459eb136e65d1da74503364316ea4
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * Displays form for password change
6 * @package PhpMyAdmin
7 */
8 if (! defined('PHPMYADMIN')) {
9 exit;
12 /**
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)
22 /**
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)
29 ? 'onpropertychange'
30 : 'onchange';
32 $is_privileges = basename($_SERVER['SCRIPT_NAME']) === 'server_privileges.php';
34 $html = '<form method="post" id="change_password_form" '
35 . 'action="' . $GLOBALS['PMA_PHP_SELF'] . '" '
36 . 'name="chgPassword" '
37 . 'class="ajax'
38 . ($is_privileges ? ' submenu-item' : '')
39 . '">';
41 $html .= PMA_URL_getHiddenInputs();
43 if (strpos($GLOBALS['PMA_PHP_SELF'], 'server_privileges') !== false) {
44 $html .= '<input type="hidden" name="username" '
45 . 'value="' . htmlspecialchars($username) . '" />'
46 . '<input type="hidden" name="hostname" '
47 . 'value="' . htmlspecialchars($hostname) . '" />';
49 $html .= '<fieldset id="fieldset_change_password">'
50 . '<legend'
51 . ($is_privileges ? ' data-submenu-label="' . __('Change password') . '"' : '')
52 . '>' . __('Change password') . '</legend>'
53 . '<table class="data noclick">'
54 . '<tr class="odd">'
55 . '<td colspan="2">'
56 . '<input type="radio" name="nopass" value="1" id="nopass_1" '
57 . 'onclick="pma_pw.value = \'\'; pma_pw2.value = \'\'; '
58 . 'this.checked = true" />'
59 . '<label for="nopass_1">' . __('No Password') . '</label>'
60 . '</td>'
61 . '</tr>'
62 . '<tr class="even vmiddle">'
63 . '<td>'
64 . '<input type="radio" name="nopass" value="0" id="nopass_0" '
65 . 'onclick="document.getElementById(\'text_pma_pw\').focus();" '
66 . 'checked="checked " />'
67 . '<label for="nopass_0">' . __('Password:') . '&nbsp;</label>'
68 . '</td>'
69 . '<td>'
70 . '<input type="password" name="pma_pw" id="text_pma_pw" size="10" '
71 . 'class="textfield"'
72 . $chg_evt_handler . '="nopass[1].checked = true" />'
73 . '&nbsp;&nbsp;' . __('Re-type:') . '&nbsp;'
74 . '<input type="password" name="pma_pw2" id="text_pma_pw2" size="10" '
75 . 'class="textfield"'
76 . $chg_evt_handler . '="nopass[1].checked = true" />'
77 . '</td>'
78 . '</tr>'
79 . '<tr class="vmiddle">'
80 . '<td>' . __('Password Hashing:')
81 . '</td>'
82 . '<td>'
83 . '<input type="radio" name="pw_hash" id="radio_pw_hash_new" '
84 . 'value="new" checked="checked" />'
85 . '<label for="radio_pw_hash_new">MySQL&nbsp;4.1+</label>'
86 . '</td>'
87 . '</tr>'
88 . '<tr id="tr_element_before_generate_password">'
89 . '<td>&nbsp;</td>'
90 . '<td>'
91 . '<input type="radio" name="pw_hash" id="radio_pw_hash_old" '
92 . 'value="old" />'
93 . '<label for="radio_pw_hash_old">' . __('MySQL 4.0 compatible')
94 . '</label>'
95 . '</td>'
96 . '</tr>'
97 . '</table>'
98 . '</fieldset>'
99 . '<fieldset id="fieldset_change_password_footer" class="tblFooters">'
100 . '<input type="submit" name="change_pw" value="' . __('Go') . '" />'
101 . '</fieldset>'
102 . '</form>';
103 return $html;