Upgraded phpmyadmin to 4.0.4 (All Languages) - No modifications yet
[openemr.git] / phpmyadmin / libraries / display_change_password.lib.php
blobba5b012e20f24d139812364d67bd3dba666adf2f
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 $html = '<form method="post" id="change_password_form" '
33 . 'action="' . $GLOBALS['PMA_PHP_SELF'] . '" '
34 . 'name="chgPassword" '
35 . 'class="ajax" >';
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">'
48 . '<tr class="odd">'
49 . '<td colspan="2">'
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>'
54 . '</td>'
55 . '</tr>'
56 . '<tr class="even vmiddle">'
57 . '<td>'
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') . ':&nbsp;</label>'
62 . '</td>'
63 . '<td>'
64 . '<input type="password" name="pma_pw" id="text_pma_pw" size="10" '
65 . 'class="textfield"'
66 . $chg_evt_handler . '="nopass[1].checked = true" />'
67 . '&nbsp;&nbsp;' . __('Re-type') . ':&nbsp;'
68 . '<input type="password" name="pma_pw2" id="text_pma_pw2" size="10" '
69 . 'class="textfield"'
70 . $chg_evt_handler . '="nopass[1].checked = true" />'
71 . '</td>'
72 . '</tr>'
73 . '<tr class="vmiddle">'
74 . '<td>' . __('Password Hashing') . ':'
75 . '</td>'
76 . '<td>'
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&nbsp;4.1+</label>'
80 . '</td>'
81 . '</tr>'
82 . '<tr id="tr_element_before_generate_password">'
83 . '<td>&nbsp;</td>'
84 . '<td>'
85 . '<input type="radio" name="pw_hash" id="radio_pw_hash_old" '
86 . 'value="old" />'
87 . '<label for="radio_pw_hash_old">' . __('MySQL 4.0 compatible')
88 . '</label>'
89 . '</td>'
90 . '</tr>'
91 . '</table>'
92 . '</fieldset>'
93 . '<fieldset id="fieldset_change_password_footer" class="tblFooters">'
94 . '<input type="submit" name="change_pw" value="' . __('Go') . '" />'
95 . '</fieldset>'
96 . '</form>';
97 return $html;