3 // vim: expandtab sw=4 ts=4 sts=4:
9 $js_to_run = 'server_privileges.js';
10 require('./server_common.inc.php3');
14 * Checks if a dropdown box has been used for selecting a database / table
16 if (!empty($pred_dbname)) {
17 $dbname = $pred_dbname;
20 if (!empty($pred_tablename)) {
21 $tablename = $pred_tablename;
22 unset($pred_tablename);
27 * Checks if the user is allowed to do what he tries to...
30 include('./server_links.inc.php3');
32 . ' ' . $strPrivileges . "\n"
34 . $strNoPrivileges . "\n";
35 include('./footer.inc.php3');
41 * Extracts the privilege information of a priv table row
43 * @param array the row
44 * @param boolean add <dfn> tag with tooltips
46 * @global ressource the database connection
50 function PMA_extractPrivInfo($row = '', $enableHTML = FALSE)
55 array('Select_priv', 'SELECT', $GLOBALS['strPrivDescSelect']),
56 array('Insert_priv', 'INSERT', $GLOBALS['strPrivDescInsert']),
57 array('Update_priv', 'UPDATE', $GLOBALS['strPrivDescUpdate']),
58 array('Delete_priv', 'DELETE', $GLOBALS['strPrivDescDelete']),
59 array('Create_priv', 'CREATE', $GLOBALS['strPrivDescCreateDb']),
60 array('Drop_priv', 'DROP', $GLOBALS['strPrivDescDropDb']),
61 array('Reload_priv', 'RELOAD', $GLOBALS['strPrivDescReload']),
62 array('Shutdown_priv', 'SHUTDOWN', $GLOBALS['strPrivDescShutdown']),
63 array('Process_priv', 'PROCESS', $GLOBALS['strPrivDescProcess' . ((!empty($row) && isset($row['Super_priv'])) ||
(empty($row) && isset($GLOBALS['Super_priv'])) ?
'4' : '3')]),
64 array('File_priv', 'FILE', $GLOBALS['strPrivDescFile']),
65 array('References_priv', 'REFERENCES', $GLOBALS['strPrivDescReferences']),
66 array('Index_priv', 'INDEX', $GLOBALS['strPrivDescIndex']),
67 array('Alter_priv', 'ALTER', $GLOBALS['strPrivDescAlter']),
68 array('Show_db_priv', 'SHOW DATABASES', $GLOBALS['strPrivDescShowDb']),
69 array('Super_priv', 'SUPER', $GLOBALS['strPrivDescSuper']),
70 array('Create_tmp_table_priv', 'CREATE TEMPORARY TABLES', $GLOBALS['strPrivDescCreateTmpTable']),
71 array('Lock_tables_priv', 'LOCK TABLES', $GLOBALS['strPrivDescLockTables']),
72 array('Execute_priv', 'EXECUTE', $GLOBALS['strPrivDescExecute']),
73 array('Repl_slave_priv', 'REPLICATION SLAVE', $GLOBALS['strPrivDescReplSlave']),
74 array('Repl_client_priv', 'REPLICATION CLIENT', $GLOBALS['strPrivDescReplClient'])
76 if (!empty($row) && isset($row['Table_priv'])) {
77 $sql_query = 'SHOW COLUMNS FROM `tables_priv` LIKE "Table_priv";';
78 $res = PMA_mysql_query($sql_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), $sql_query);
80 $row1 = PMA_mysql_fetch_array($res, MYSQL_ASSOC
);
81 mysql_free_result($res);
82 $av_grants = explode ('\',\'' , substr($row1['Type'], 5, strlen($row1['Type']) - 7));
84 $users_grants = explode(',', $row['Table_priv']);
85 while (list(, $current_grant) = each($av_grants)) {
86 $row[$current_grant . '_priv'] = in_array($current_grant, $users_grants) ?
'Y' : 'N';
88 unset($current_grant);
93 $allPrivileges = TRUE;
94 while (list(, $current_grant) = each($grants)) {
95 if ((!empty($row) && isset($row[$current_grant[0]])) ||
(empty($row) && isset($GLOBALS[$current_grant[0]]))) {
96 if ((!empty($row) && $row[$current_grant[0]] == 'Y') ||
(empty($row) && ($GLOBALS[$current_grant[0]] == 'Y' ||
(is_array($GLOBALS[$current_grant[0]]) && count($GLOBALS[$current_grant[0]]) == $GLOBALS['column_count'] && empty($GLOBALS[$current_grant[0] . '_none']))))) {
98 $privs[] = '<dfn title="' . $current_grant[2] . '">' . str_replace(' ', ' ', $current_grant[1]) . '</dfn>';
100 $privs[] = $current_grant[1];
102 } else if (!empty($GLOBALS[$current_grant[0]]) && is_array($GLOBALS[$current_grant[0]]) && empty($GLOBALS[$current_grant[0] . '_none'])) {
104 $priv_string = '<dfn title="' . $current_grant[2] . '">' . str_replace(' ', ' ', $current_grant[1]) . '</dfn>';
106 $priv_string = $current_grant[1];
108 $privs[] = $priv_string . ' (`' . join('`, `', $GLOBALS[$current_grant[0]]) . '`)';
110 $allPrivileges = FALSE;
116 $privs[] = '<dfn title="' . $GLOBALS['strPrivDescUsage'] . '">USAGE</dfn>';
120 } else if ($allPrivileges && (!isset($GLOBALS['grant_count']) ||
count($privs) == $GLOBALS['grant_count'])) {
122 $privs = array('<dfn title="' . $GLOBALS['strPrivDescAllPrivileges'] . '">ALL PRIVILEGES</dfn>');
124 $privs = array('ALL PRIVILEGES');
128 } // end of the 'PMA_extractPrivInfo()' function
131 * Displays the privileges form table
133 * @param string the database
134 * @param string the table
135 * @param boolean wheather to display the submit button or not
136 * @param int the indenting level of the code
138 * @global array the phpMyAdmin configuration
139 * @global ressource the database connection
143 function PMA_displayPrivTable($db = '*', $table = '*', $submit = TRUE, $indent = 0)
145 global $cfg, $userlink;
151 for ($i = 0; $i < $indent; $i++
) {
154 if (isset($GLOBALS['username'])) {
155 $username = $GLOBALS['username'];
156 if (empty($GLOBALS['hostname'])) {
159 $hostname = $GLOBALS['hostname'];
162 $sql_query = 'SELECT * FROM `user` WHERE `User` = "' . $username . '" AND `Host` = "' . $hostname . '";';
163 } else if ($table == '*') {
164 $sql_query = 'SELECT * FROM `db` WHERE `User` = "' . $username . '" AND `Host` = "' . $hostname . '" AND `Db` = "' . $db . '";';
166 $sql_query = 'SELECT `Table_priv` FROM `tables_priv` WHERE `User` = "' . $username . '" AND `Host` = "' . $hostname . '" AND `Db` = "' . $db . '" AND `Table_name` = "' . $table . '";';
168 $res = PMA_mysql_query($sql_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), $sql_query);
170 $row = PMA_mysql_fetch_array($res, MYSQL_ASSOC
);
172 @mysql_free_result
($res);
177 $sql_query = 'SHOW COLUMNS FROM `mysql`.`user`;';
178 } else if ($table == '*') {
179 $sql_query = 'SHOW COLUMNS FROM `mysql`.`db`;';
181 $res = PMA_mysql_query($sql_query, $userlink)
182 or PMA_mysqlDie(PMA_mysql_error($userlink), $sql_query);
183 while ($row1 = PMA_mysql_fetch_row($res)) {
184 if (substr($row1[0], 0, 4) == 'max_') {
187 $row[$row1[0]] = 'N';
190 mysql_free_result($res);
192 $row = array('Table_priv' => '');
195 if (isset($row['Table_priv'])) {
196 $sql_query = 'SHOW COLUMNS FROM `tables_priv` LIKE "Table_priv";';
197 $res = PMA_mysql_query($sql_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), $sql_query);
199 $row1 = PMA_mysql_fetch_array($res, MYSQL_ASSOC
);
200 mysql_free_result($res);
201 $av_grants = explode ('\',\'' , substr($row1['Type'], 5, strlen($row1['Type']) - 7));
203 $users_grants = explode(',', $row['Table_priv']);
204 while (list(, $current_grant) = each($av_grants)) {
205 $row[$current_grant . '_priv'] = in_array($current_grant, $users_grants) ?
'Y' : 'N';
207 unset($row['Table_priv']);
208 unset($current_grant);
210 unset($users_grants);
211 if ($res = PMA_mysql_query('SHOW COLUMNS FROM `' . $db . '`.`' . $table . '`;', $userlink)) {
213 while ($row1 = PMA_mysql_fetch_row($res)) {
214 $columns[$row1[0]] = array(
218 'References' => FALSE
221 mysql_free_result($res);
226 if (!empty($columns)) {
227 $sql_query = 'SELECT `Column_name`, `Column_priv` FROM `columns_priv` WHERE `User` = "' . $username . '" AND `Host` = "' . $hostname . '" AND `Db` = "' . $db . '" AND `Table_name` = "' . $table . '";';
228 $res = PMA_mysql_query($sql_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), $sql_query);
229 while ($row1 = PMA_mysql_fetch_row($res)) {
230 $row1[1] = explode(',', $row1[1]);
231 while (list(, $current) = each($row1[1])) {
232 $columns[$row1[0]][$current] = TRUE;
235 mysql_free_result($res);
239 echo $spaces . '<input type="hidden" name="grant_count" value="' . count($row) . '" />' . "\n"
240 . $spaces . '<input type="hidden" name="column_count" value="' . count($columns) . '" />' . "\n"
241 . $spaces . '<table border="0">' . "\n"
242 . $spaces . ' <tr>' . "\n"
243 . $spaces . ' <th colspan="6"> ' . $GLOBALS['strTblPrivileges'] . ' </th>' . "\n"
244 . $spaces . ' </tr>' . "\n"
245 . $spaces . ' <tr>' . "\n"
246 . $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '" colspan="6"><small><i>' . $GLOBALS['strEnglishPrivileges'] . '</i></small></td>' . "\n"
247 . $spaces . ' </tr>' . "\n"
248 . $spaces . ' <tr>' . "\n"
249 . $spaces . ' <td bgcolor="' . $cfg['BgcolorOne'] . '"> <tt><dfn title="' . $GLOBALS['strPrivDescSelect'] . '">SELECT</dfn></tt> </td>' . "\n"
250 . $spaces . ' <td bgcolor="' . $cfg['BgcolorOne'] . '"> <tt><dfn title="' . $GLOBALS['strPrivDescInsert'] . '">INSERT</dfn></tt> </td>' . "\n"
251 . $spaces . ' <td bgcolor="' . $cfg['BgcolorOne'] . '"> <tt><dfn title="' . $GLOBALS['strPrivDescUpdate'] . '">UPDATE</dfn></tt> </td>' . "\n"
252 . $spaces . ' <td bgcolor="' . $cfg['BgcolorOne'] . '"> <tt><dfn title="' . $GLOBALS['strPrivDescReferences'] . '">REFERENCES</dfn></tt> </td>' . "\n";
253 list($current_grant, $current_grant_value) = each($row);
254 while (in_array(substr($current_grant, 0, (strlen($current_grant) - 5)), array('Select', 'Insert', 'Update', 'References'))) {
255 list($current_grant, $current_grant_value) = each($row);
257 echo $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"><input type="checkbox" name="' . $current_grant . '" id="checkbox_' . $current_grant . '" value="Y" ' . ($current_grant_value == 'Y' ?
'checked="checked" ' : '') . 'title="' . (isset($GLOBALS['strPrivDesc' . substr($current_grant, 0, (strlen($current_grant) - 5))]) ?
$GLOBALS['strPrivDesc' . substr($current_grant, 0, (strlen($current_grant) - 5))] : $GLOBALS['strPrivDesc' . substr($current_grant, 0, (strlen($current_grant) - 5)) . 'Tbl']) . '"/></td>' . "\n"
258 . $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"><label for="checkbox_' . $current_grant . '"><tt><dfn title="' . (isset($GLOBALS['strPrivDesc' . substr($current_grant, 0, (strlen($current_grant) - 5))]) ?
$GLOBALS['strPrivDesc' . substr($current_grant, 0, (strlen($current_grant) - 5))] : $GLOBALS['strPrivDesc' . substr($current_grant, 0, (strlen($current_grant) - 5)) . 'Tbl']) . '">' . strtoupper(substr($current_grant, 0, strlen($current_grant) - 5)) . '</dfn></tt></label></td>' . "\n"
259 . $spaces . ' </tr>' . "\n"
260 . $spaces . ' <tr>' . "\n";
261 $rowspan = count($row) - 5;
262 echo $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '" rowspan="' . $rowspan . '" valign="top">' . "\n"
263 . $spaces . ' <select name="Select_priv[]" multiple="multiple">' . "\n";
264 while (list($current_column, $current_column_privileges) = each($columns)) {
265 echo $spaces . ' <option value="' . htmlspecialchars($current_column) . '"';
266 if ($row['Select_priv'] == 'Y' ||
$current_column_privileges['Select']) {
267 echo ' selected="selected"';
269 echo '>' . htmlspecialchars($current_column) . '</option>' . "\n";
271 echo $spaces . ' </select><br />' . "\n"
272 . $spaces . ' <i>' . $GLOBALS['strOr'] . '</i><br />' . "\n"
273 . $spaces . ' <input type="checkbox" name="Select_priv_none" id="checkbox_Select_priv_none" title="' . $GLOBALS['strNone'] . '" />' . "\n"
274 . $spaces . ' <label for="checkbox_Select_priv_none">' . $GLOBALS['strNone'] . '</label>' . "\n"
275 . $spaces . ' </td>' . "\n"
276 . $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '" rowspan="' . $rowspan . '" valign="top">' . "\n"
277 . $spaces . ' <select name="Insert_priv[]" multiple="multiple">' . "\n";
279 while (list($current_column, $current_column_privileges) = each($columns)) {
280 echo $spaces . ' <option value="' . htmlspecialchars($current_column) . '"';
281 if ($row['Insert_priv'] == 'Y' ||
$current_column_privileges['Insert']) {
282 echo ' selected="selected"';
284 echo '>' . htmlspecialchars($current_column) . '</option>' . "\n";
286 echo $spaces . ' </select><br />' . "\n"
287 . $spaces . ' <i>' . $GLOBALS['strOr'] . '</i><br />' . "\n"
288 . $spaces . ' <input type="checkbox" name="Insert_priv_none" id="checkbox_Insert_priv_none" title="' . $GLOBALS['strNone'] . '" />' . "\n"
289 . $spaces . ' <label for="checkbox_Insert_priv_none">' . $GLOBALS['strNone'] . '</label>' . "\n"
290 . $spaces . ' </td>' . "\n"
291 . $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '" rowspan="' . $rowspan . '" valign="top">' . "\n"
292 . $spaces . ' <select name="Update_priv[]" multiple="multiple">' . "\n";
294 while (list($current_column, $current_column_privileges) = each($columns)) {
295 echo $spaces . ' <option value="' . htmlspecialchars($current_column) . '"';
296 if ($row['Update_priv'] == 'Y' ||
$current_column_privileges['Update']) {
297 echo ' selected="selected"';
299 echo '>' . htmlspecialchars($current_column) . '</option>' . "\n";
301 echo $spaces . ' </select><br />' . "\n"
302 . $spaces . ' <i>' . $GLOBALS['strOr'] . '</i><br />' . "\n"
303 . $spaces . ' <input type="checkbox" name="Update_priv_none" id="checkbox_Update_priv_none" title="' . $GLOBALS['strNone'] . '" />' . "\n"
304 . $spaces . ' <label for="checkbox_Update_priv_none">' . $GLOBALS['strNone'] . '</label>' . "\n"
305 . $spaces . ' </td>' . "\n"
306 . $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '" rowspan="' . $rowspan . '" valign="top">' . "\n"
307 . $spaces . ' <select name="References_priv[]" multiple="multiple">' . "\n";
309 while (list($current_column, $current_column_privileges) = each($columns)) {
310 echo $spaces . ' <option value="' . htmlspecialchars($current_column) . '"';
311 if ($row['References_priv'] == 'Y' ||
$current_column_privileges['References']) {
312 echo ' selected="selected"';
314 echo '>' . htmlspecialchars($current_column) . '</option>' . "\n";
316 echo $spaces . ' </select><br />' . "\n"
317 . $spaces . ' <i>' . $GLOBALS['strOr'] . '</i><br />' . "\n"
318 . $spaces . ' <input type="checkbox" name="References_priv_none" id="checkbox_References_priv_none" title="' . $GLOBALS['strNone'] . '" />' . "\n"
319 . $spaces . ' <label for="checkbox_References_priv_none">' . $GLOBALS['strNone'] . '</label>' . "\n"
320 . $spaces . ' </td>' . "\n";
322 list($current_grant, $current_grant_value) = each($row);
323 while (in_array(substr($current_grant, 0, (strlen($current_grant) - 5)), array('Select', 'Insert', 'Update', 'References'))) {
324 list($current_grant, $current_grant_value) = each($row);
326 echo $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"><input type="checkbox" name="' . $current_grant . '" id="checkbox_' . $current_grant . '" value="Y" ' . ($current_grant_value == 'Y' ?
'checked="checked" ' : '') . 'title="' . (isset($GLOBALS['strPrivDesc' . substr($current_grant, 0, (strlen($current_grant) - 5))]) ?
$GLOBALS['strPrivDesc' . substr($current_grant, 0, (strlen($current_grant) - 5))] : $GLOBALS['strPrivDesc' . substr($current_grant, 0, (strlen($current_grant) - 5)) . 'Tbl']) . '"/></td>' . "\n"
327 . $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"><label for="checkbox_' . $current_grant . '"><tt><dfn title="' . (isset($GLOBALS['strPrivDesc' . substr($current_grant, 0, (strlen($current_grant) - 5))]) ?
$GLOBALS['strPrivDesc' . substr($current_grant, 0, (strlen($current_grant) - 5))] : $GLOBALS['strPrivDesc' . substr($current_grant, 0, (strlen($current_grant) - 5)) . 'Tbl']) . '">' . strtoupper(substr($current_grant, 0, strlen($current_grant) - 5)) . '</dfn></tt></label></td>' . "\n"
328 . $spaces . ' </tr>' . "\n";
329 while (list($current_grant, $current_grant_value) = each($row)) {
330 if (in_array(substr($current_grant, 0, (strlen($current_grant) - 5)), array('Select', 'Insert', 'Update', 'References'))) {
333 echo $spaces . ' <tr>' . "\n"
334 . $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"><input type="checkbox" name="' . $current_grant . '" id="checkbox_' . $current_grant . '" value="Y" ' . ($current_grant_value == 'Y' ?
'checked="checked" ' : '') . 'title="' . (isset($GLOBALS['strPrivDesc' . substr($current_grant, 0, (strlen($current_grant) - 5))]) ?
$GLOBALS['strPrivDesc' . substr($current_grant, 0, (strlen($current_grant) - 5))] : $GLOBALS['strPrivDesc' . substr($current_grant, 0, (strlen($current_grant) - 5)) . 'Tbl']) . '"/></td>' . "\n"
335 . $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"><label for="checkbox_' . $current_grant . '"><tt><dfn title="' . (isset($GLOBALS['strPrivDesc' . substr($current_grant, 0, (strlen($current_grant) - 5))]) ?
$GLOBALS['strPrivDesc' . substr($current_grant, 0, (strlen($current_grant) - 5))] : $GLOBALS['strPrivDesc' . substr($current_grant, 0, (strlen($current_grant) - 5)) . 'Tbl']) . '">' . strtoupper(substr($current_grant, 0, strlen($current_grant) - 5)) . '</dfn></tt></label></td>' . "\n"
336 . $spaces . ' </tr>' . "\n";
339 $privTable[0] = array(
340 array('Select', 'SELECT', $GLOBALS['strPrivDescSelect']),
341 array('Insert', 'INSERT', $GLOBALS['strPrivDescInsert']),
342 array('Update', 'UPDATE', $GLOBALS['strPrivDescUpdate']),
343 array('Delete', 'DELETE', $GLOBALS['strPrivDescDelete'])
346 $privTable[0][] = array('File', 'FILE', $GLOBALS['strPrivDescFile']);
348 $privTable[1] = array(
349 array('Create', 'CREATE', ($table == '*' ?
$GLOBALS['strPrivDescCreateDb'] : $GLOBALS['strPrivDescCreateTbl'])),
350 array('Alter', 'ALTER', $GLOBALS['strPrivDescAlter']),
351 array('Index', 'INDEX', $GLOBALS['strPrivDescIndex']),
352 array('Drop', 'DROP', ($table == '*' ?
$GLOBALS['strPrivDescDropDb'] : $GLOBALS['strPrivDescDropTbl']))
354 if (isset($row['Create_tmp_table_priv'])) {
355 $privTable[1][] = array('Create_tmp_table', 'CREATE TEMPORARAY TABLES', $GLOBALS['strPrivDescCreateTmpTable']);
357 $privTable[2] = array();
358 if (isset($row['Grant_priv'])) {
359 $privTable[2][] = array('Grant', 'GRANT', $GLOBALS['strPrivDescGrant']);
362 if (isset($row['Super_priv'])) {
363 $privTable[2][] = array('Super', 'SUPER', $GLOBALS['strPrivDescSuper']);
364 $privTable[2][] = array('Process', 'PROCESS', $GLOBALS['strPrivDescProcess4']);
366 $privTable[2][] = array('Process', 'PROCESS', $GLOBALS['strPrivDescProcess3']);
368 $privTable[2][] = array('Reload', 'RELOAD', $GLOBALS['strPrivDescReload']);
369 $privTable[2][] = array('Shutdown', 'SHUTDOWN', $GLOBALS['strPrivDescShutdown']);
370 if (isset($row['Show_db_priv'])) {
371 $privTable[2][] = array('Show_db', 'SHOW DATABASES', $GLOBALS['strPrivDescShowDb']);
373 if (isset($row['Lock_tables_priv'])) {
374 $privTable[2][] = array('Lock_tables', 'LOCK TABLES', $GLOBALS['strPrivDescLockTables']);
377 $privTable[2][] = array('References', 'REFERENCES', $GLOBALS['strPrivDescReferences']);
379 if (isset($row['Execute_priv'])) {
380 $privTable[2][] = array('Execute', 'EXECUTE', $GLOBALS['strPrivDescExecute']);
382 if (isset($row['Repl_client_priv'])) {
383 $privTable[2][] = array('Repl_client', 'REPLICATION CLIENT', $GLOBALS['strPrivDescReplClient']);
385 if (isset($row['Repl_slave_priv'])) {
386 $privTable[2][] = array('Repl_slave', 'REPLICATION SLAVE', $GLOBALS['strPrivDescReplSlave']);
389 echo $spaces . '<input type="hidden" name="grant_count" value="' . (count($privTable[0]) +
count($privTable[1]) +
count($privTable[2]) - (isset($row['Grant_priv']) ?
1 : 0)) . '" />' . "\n"
390 . $spaces . '<table border="0">' . "\n"
391 . $spaces . ' <tr>' . "\n"
392 . $spaces . ' <th colspan="6"> ' . ($db == '*' ?
$GLOBALS['strGlobalPrivileges'] : ($table == '*' ?
$GLOBALS['strDbPrivileges'] : $GLOBALS['strTblPrivileges'])) . ' </th>' . "\n"
393 . $spaces . ' </tr>' . "\n"
394 . $spaces . ' <tr>' . "\n"
395 . $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '" colspan="6"><small><i>' . $GLOBALS['strEnglishPrivileges'] . '</i></small></td>' . "\n"
396 . $spaces . ' </tr>' . "\n"
397 . $spaces . ' <tr>' . "\n"
398 . $spaces . ' <td bgcolor="' . $cfg['BgcolorOne'] . '" colspan="2"> <b><i>' . $GLOBALS['strData'] . '</i></b> </td>' . "\n"
399 . $spaces . ' <td bgcolor="' . $cfg['BgcolorOne'] . '" colspan="2"> <b><i>' . $GLOBALS['strStructure'] . '</i></b> </td>' . "\n"
400 . $spaces . ' <td bgcolor="' . $cfg['BgcolorOne'] . '" colspan="2"> <b><i>' . $GLOBALS['strAdministration'] . '</i></b> </td>' . "\n"
401 . $spaces . ' </tr>' . "\n";
403 for ($i = 0; isset($privTable[0][$i]) ||
isset($privTable[1][$i]) ||
isset($privTable[2][$i]); $i++
) {
404 echo $spaces . ' <tr>' . "\n";
405 for ($j = 0; $j < 3; $j++
) {
406 if (isset($privTable[$j][$i])) {
407 echo $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"><input type="checkbox" name="' . $privTable[$j][$i][0] . '_priv" id="checkbox_' . $privTable[$j][$i][0] . '_priv" value="Y" ' . ($row[$privTable[$j][$i][0] . '_priv'] == 'Y' ?
'checked="checked" ' : '') . 'title="' . $privTable[$j][$i][2] . '"/></td>' . "\n"
408 . $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"><label for="checkbox_' . $privTable[$j][$i][0] . '_priv"><tt><dfn title="' . $privTable[$j][$i][2] . '">' . $privTable[$j][$i][1] . '</dfn></tt></label></td>' . "\n";
409 } else if ($db == '*' && !isset($privTable[0][$i]) && !isset($privTable[1][$i])
410 && isset($row['max_questions']) && isset($row['max_updates']) && isset($row['max_connections'])
412 echo $spaces . ' <td colspan="4" rowspan="' . (count($privTable[2]) - $i) . '">' . "\n"
413 . $spaces . ' <table border="0">' . "\n"
414 . $spaces . ' <tr>' . "\n"
415 . $spaces . ' <th colspan="2"> ' . $GLOBALS['strResourceLimits'] . ' </th>' . "\n"
416 . $spaces . ' </tr>' . "\n"
417 . $spaces . ' <tr>' . "\n"
418 . $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '" colspan="2"><small><i>' . $GLOBALS['strZeroRemovesTheLimit'] . '</i></small></td>' . "\n"
419 . $spaces . ' </tr>' . "\n"
420 . $spaces . ' <tr>' . "\n"
421 . $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"><label for="text_max_questions"><tt><dfn title="' . $GLOBALS['strPrivDescMaxQuestions'] . '">MAX QUERIES PER HOUR</dfn></tt></label></td>' . "\n"
422 . $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"><input type="text" name="max_questions" id="text_max_questions" value="' . $row['max_questions'] . '" size="11" maxlength="11" title="' . $GLOBALS['strPrivDescMaxQuestions'] . '" /></td>' . "\n"
423 . $spaces . ' </tr>' . "\n"
424 . $spaces . ' <tr>' . "\n"
425 . $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"><label for="text_max_updates"><tt><dfn title="' . $GLOBALS['strPrivDescMaxUpdates'] . '">MAX UPDATES PER HOUR</dfn></tt></label></td>' . "\n"
426 . $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"><input type="text" name="max_updates" id="text_max_updates" value="' . $row['max_updates'] . '" size="11" maxlength="11" title="' . $GLOBALS['strPrivDescMaxUpdates'] . '" /></td>' . "\n"
427 . $spaces . ' </tr>' . "\n"
428 . $spaces . ' <tr>' . "\n"
429 . $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"><label for="text_max_connections"><tt><dfn title="' . $GLOBALS['strPrivDescMaxConnections'] . '">MAX CONNECTIONS PER HOUR</dfn></tt></label></td>' . "\n"
430 . $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"><input type="text" name="max_connections" id="text_max_connections" value="' . $row['max_connections'] . '" size="11" maxlength="11" title="' . $GLOBALS['strPrivDescMaxConnections'] . '" /></td>' . "\n"
431 . $spaces . ' </tr>' . "\n"
432 . $spaces . ' </table>' . "\n"
433 . $spaces . ' </td>' . "\n";
435 } else if (!$limitTable) {
436 echo $spaces . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '" colspan="2"> </td>' . "\n";
440 echo $spaces . ' </tr>' . "\n";
443 echo $spaces . ' <tr>' . "\n"
444 . $spaces . ' <td colspan="6" align="center">' . "\n"
445 . $spaces . ' <input type="submit" name="update_privs" value="' . $GLOBALS['strGo'] . '" />' . "\n"
446 . $spaces . ' </td>' . "\n"
447 . $spaces . ' </tr>' . "\n";
449 echo $spaces . '</table>' . "\n";
450 } // end of the 'PMA_displayPrivTable()' function
456 if (!empty($adduser_submit)) {
458 if ($pred_username == 'any') {
461 switch ($pred_hostname) {
466 $hostname = 'localhost';
469 $res = PMA_mysql_query('SELECT USER();', $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), 'SELECT USER();');
470 $row = PMA_mysql_fetch_row($res);
471 mysql_free_result($res);
473 $hostname = substr($row[0], (strrpos($row[0], '@') +
1));
477 $local_query = 'SELECT "foo" FROM `user` WHERE `User` = "' . $username . '" AND `Host` = "' . $hostname . '";';
478 $res = PMA_mysql_query($local_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), $local_query);
480 if (mysql_affected_rows($userlink) == 1) {
481 $message = sprintf($strUserAlreadyExists, '<i>\'' . $username . '\'@\'' . $hostname . '\'</i>');
484 if (PMA_MYSQL_INT_VERSION
>= 32211) {
485 $real_sql_query = 'GRANT ' . join(', ', PMA_extractPrivInfo()) . ' ON *.* TO "' . $username . '"@"' . $hostname . '"';
486 if ($pred_password != 'none') {
488 for ($i = 0; $i < strlen($pma_pw); $i++
) {
489 $pma_pw_hidden .= '*';
491 $sql_query = $real_sql_query . ' IDENTIFIED BY "' . $pma_pw_hidden . '"';
492 $real_sql_query .= ' IDENTIFIED BY "' . $pma_pw . '"';
494 $sql_query = $real_sql_query;
496 if ((isset($Grant_priv) && $Grant_priv == 'Y') ||
isset($max_questions) ||
isset($max_connections) ||
isset($max_updates)) {
497 $real_sql_query .= 'WITH';
498 $sql_query .= 'WITH';
499 if (isset($Grant_priv) && $Grant_priv == 'Y') {
500 $real_sql_query .= ' GRANT OPTION';
501 $sql_query .= ' GRANT OPTION';
503 if (isset($max_questions)) {
504 $real_sql_query .= ' MAX_QUERIES_PER_HOUR ' . (int)$max_questions;
505 $sql_query .= ' MAX_QUERIES_PER_HOUR ' . (int)$max_questions;
507 if (isset($max_connections)) {
508 $real_sql_query .= ' MAX_CONNECTIONS_PER_HOUR ' . (int)$max_connections;
509 $sql_query .= ' MAX_CONNECTIONS_PER_HOUR ' . (int)$max_connections;
511 if (isset($max_updates)) {
512 $real_sql_query .= ' MAX_UPDATES_PER_HOUR ' . (int)$max_updates;
513 $sql_query .= ' MAX_UPDATES_PER_HOUR ' . (int)$max_updates;
516 $real_sql_query .= ';';
518 PMA_mysql_query($real_sql_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink));
519 unset($real_sql_query);
520 $message = $strAddUserMessage;
522 $privileges = PMA_extractPrivInfo();
523 $real_sql_query = 'INSERT INTO `user` SET `Host` = "' . $hostname . '", `User` = "' . $username . '"';
524 if ($pred_password != 'none') {
526 for ($i = 0; $i < strlen($pma_pw); $i++
) {
527 $pma_pw_hidden .= '*';
529 $sql_query = $real_sql_query . ', `Password` = PASSWORD("' . $pma_pw_hidden . '")';
530 $real_sql_query .= ', `Password` = PASSWORD("' . $pma_pw . '")';
532 $sql_query = $real_sql_query;
534 while (list(, $priv) = each($privileges)) {
535 $real_sql_query .= ', `' . substr($priv, 0, 1) . strtolower(substr($priv, 1)) . '_priv` = "Y"';
536 $sql_query .= ', `' . substr($priv, 0, 1) . strtolower(substr($priv, 1)) . '_priv` = "Y"';
538 PMA_mysql_query($real_sql_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink));
539 unset($real_sql_query);
540 $message = $strAddUserMessage . '<br />' . "\n" . $strRememberReload;
542 mysql_free_result($res);
551 if (!empty($update_privs)) {
552 if (empty($hostname)) {
555 if (PMA_MYSQL_INT_VERSION
>= 32211) {
556 $db_and_table = empty($dbname) ?
'*.*' : PMA_backquote($dbname) . '.' . (empty($tablename) ?
'*' : PMA_backquote($tablename));
557 $sql_query0 = 'REVOKE ALL PRIVILEGES ON ' . $db_and_table . ' FROM "' . $username . '"@"' . $hostname . '";';
558 $sql_query1 = 'REVOKE GRANT OPTION ON ' . $db_and_table . ' FROM "' . $username . '"@"' . $hostname . '";';
559 $sql_query2 = 'GRANT ' . join(', ', PMA_extractPrivInfo()) . ' ON ' . $db_and_table . ' TO "' . $username . '"@"' . $hostname . '"';
560 if ((isset($Grant_priv) && $Grant_priv == 'Y') ||
(empty($dbname) && (isset($max_questions) ||
isset($max_connections) ||
isset($max_updates)))) {
561 $sql_query2 .= 'WITH';
562 if (isset($Grant_priv) && $Grant_priv == 'Y') {
563 $sql_query2 .= ' GRANT OPTION';
565 if (isset($max_questions)) {
566 $sql_query2 .= ' MAX_QUERIES_PER_HOUR ' . (int)$max_questions;
568 if (isset($max_connections)) {
569 $sql_query2 .= ' MAX_CONNECTIONS_PER_HOUR ' . (int)$max_connections;
571 if (isset($max_updates)) {
572 $sql_query2 .= ' MAX_UPDATES_PER_HOUR ' . (int)$max_updates;
576 PMA_mysql_query($sql_query0, $userlink); // this query may fail, but this does not matter :o)
577 PMA_mysql_query($sql_query1, $userlink); // this one may fail, too...
578 PMA_mysql_query($sql_query2, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), $sql_query2);
579 $sql_query = $sql_query0 . ' ' . $sql_query1 . ' ' . $sql_query2;
580 $message = sprintf($strUpdatePrivMessage, '\'' . $username . '\'@\'' . $hostname . '\'');
582 $sql_query = 'SHOW COLUMNS FROM `user`;';
583 $res = PMA_mysql_query($sql_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink));
585 while ($row = PMA_mysql_fetch_row($res)) {
586 if (substr($row[0], -5) == '_priv') {
587 $grants[] = PMA_backquote($row[0]) . ' = "' . (empty($
$row[0]) ?
'N' : 'Y') . '"';
590 mysql_free_result($res);
593 $sql_query = 'UPDATE `user` SET ' . join(', ', $grants) . ' WHERE `User` = "' . $username . '" AND `Host` = "' . $hostname . '";';
594 PMA_mysql_query($sql_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink));
595 $message = sprintf($strUpdatePrivMessage, '\'' . $username . '\'@\'' . $hostname . '\'') . '<br />' . "\n" . $strRememberReload;
603 if (!empty($revokeall)) {
604 if (empty($hostname)) {
607 if (PMA_MYSQL_INT_VERSION
>= 32211) {
608 $db_and_table = PMA_backquote($dbname) . '.' . (empty($tablename) ?
'*' : PMA_backquote($tablename));
609 $sql_query0 = 'REVOKE ALL PRIVILEGES ON ' . $db_and_table . ' FROM "' . $username . '"@"' . $hostname . '";';
610 $sql_query1 = 'REVOKE GRANT OPTION ON ' . $db_and_table . ' FROM "' . $username . '"@"' . $hostname . '";';
611 PMA_mysql_query($sql_query0, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), $sql_query0);
612 PMA_mysql_query($sql_query1, $userlink); // this one may fail, too...
613 $sql_query = $sql_query0 . ' ' . $sql_query1;
614 $message = sprintf($strRevokeMessage, '\'' . $username . '\'@\'' . $hostname . '\'');
616 if (empty($tablename)) {
625 * Updates the password
627 if (!empty($change_pw)) {
628 if (empty($hostname)) {
632 $sql_query = 'SET PASSWORD FOR "' . $username . '"@"' . $hostname . '" = ""';
633 PMA_mysql_query($sql_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink));
634 $message = sprintf($strPasswordChanged, '\'' . $username . '\'@\'' . $hostname . '\'');
635 } else if (empty($pma_pw) ||
empty($pma_pw2)) {
636 $message = $strPasswordEmpty;
637 } else if ($pma_pw != $pma_pw2) {
638 $message = $strPasswordNotSame;
641 for ($i = 0; $i < strlen($pma_pw); $i++
) {
644 $local_query = 'SET PASSWORD FOR "' . $username . '"@"' . $hostname . '" = PASSWORD("' . $pma_pw . '")';
645 $sql_query = 'SET PASSWORD FOR "' . $username . '"@"' . $hostname . '" = PASSWORD("' . $hidden_pw . '")';
646 PMA_mysql_query($local_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink));
647 $message = sprintf($strPasswordChanged, '\'' . $username . '\'@\'' . $hostname . '\'');
655 if (!empty($delete)) {
657 for ($i = 0; isset($selected_usr[$i]); $i++
) {
658 list($this_user, $this_host) = explode('@', $selected_usr[$i]);
659 $queries[] = '# ' . sprintf($strDeleting, '\'' . $this_user . '\'@\'' . $this_host . '\'') . ' ...';
661 // The SHOW GRANTS query may fail if the user has not been loaded
663 $res = PMA_mysql_query('SHOW GRANTS FOR "' . $this_user . '"@"' . $this_host . '";', $userlink);
665 $queries[] = 'REVOKE ALL PRIVILEGES ON *.* FROM "' . $this_user . '"@"' . $this_host . '";';
666 while ($row = PMA_mysql_fetch_row($res)) {
667 $this_table = substr($row[0], (strpos($row[0], 'ON') +
3), -(9 +
strlen($this_user . $this_host)));
668 if ($this_table != '*.*') {
669 $queries[] = 'REVOKE ALL PRIVILEGES ON ' . $this_table . ' FROM "' . $this_user . '"@"' . $this_host . '";';
673 mysql_free_result($res);
677 $queries[] = 'DELETE FROM `user` WHERE `User` = "' . $this_user . '" AND `Host` = "' . $this_host . '";';
679 // If we REVOKE the table grants, we should not need to modify the
680 // `db`, `tables_priv` and `columns_priv` tables manually...
681 $queries[] = 'DELETE FROM `db` WHERE `User` = "' . $this_user . '" AND `Host` = "' . $this_host . '";';
682 $queries[] = 'DELETE FROM `tables_priv` WHERE `User` = "' . $this_user . '" AND `Host` = "' . $this_host . '";';
683 $queries[] = 'DELETE FROM `columns_priv` WHERE `User` = "' . $this_user . '" AND `Host` = "' . $this_host . '";';
685 if (!empty($drop_users_db)) {
686 $queries[] = 'DROP DATABASE IF EXISTS ' . PMA_backquote($this_user) . ';';
689 if (empty($queries)) {
690 $message = $strError . ': ' . $strDeleteNoUsersSelected;
693 $queries[] = '# ' . $strReloadingThePrivileges . ' ...';
694 $queries[] = 'FLUSH PRIVILEGES;';
696 while (list(, $sql_query) = each($queries)) {
697 if (substr($sql_query, 0, 1) != '#') {
698 PMA_mysql_query($sql_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink));
701 $sql_query = join("\n", $queries);
702 $message = $strUsersDeleted;
709 * Reloads the privilege tables into memory
711 if (!empty($flush_privileges)) {
712 $sql_query = 'FLUSH PRIVILEGES';
713 if (@PMA_mysql_query
($sql_query, $userlink)) {
714 $message = $strPrivilegesReloaded;
716 PMA_mysqlDie(PMA_mysql_error($userlink));
724 require('./server_links.inc.php3');
730 if (empty($adduser)) {
731 if (!isset($username)) {
732 // No username is given --> display the overview
734 . ' ' . $strUserOverview . "\n"
736 $oldPrivTables = FALSE;
737 if (PMA_MYSQL_INT_VERSION
>= 40002) {
738 $res = PMA_mysql_query('SELECT `User`, `Host`, IF(`Password` = "", "N", "Y") AS "Password", `Select_priv`, `Insert_priv`, `Update_priv`, `Delete_priv`, `Create_priv`, `Drop_priv`, `Reload_priv`, `Shutdown_priv`, `Process_priv`, `File_priv`, `Grant_priv`, `References_priv`, `Index_priv`, `Alter_priv`, `Show_db_priv`, `Super_priv`, `Create_tmp_table_priv`, `Lock_tables_priv`, `Execute_priv`, `Repl_slave_priv`, `Repl_client_priv` FROM `user` ORDER BY `User` ASC, `Host` ASC;', $userlink);
740 // the query failed! This may have two reasons:
741 // - the user has not enough privileges
742 // - the privilege tables use a structure of an earlier version.
743 $oldPrivTables = TRUE;
746 if (empty($res) ||
(PMA_MYSQL_INT_VERSION
>= 32211 && PMA_MYSQL_INT_VERSION
< 40002)) {
747 $res = PMA_mysql_query('SELECT `User`, `Host`, IF(`Password` = "", "N", "Y") AS "Password", `Select_priv`, `Insert_priv`, `Update_priv`, `Delete_priv`, `Index_priv`, `Alter_priv`, `Create_priv`, `Drop_priv`, `Grant_priv`, `References_priv`, `Reload_priv`, `Shutdown_priv`, `Process_priv`, `File_priv` FROM `user` ORDER BY `User` ASC, `Host` ASC;', $userlink);
749 // the query failed! This may have two reasons:
750 // - the user has not enough privileges
751 // - the privilege tables use a structure of an earlier version.
752 $oldPrivTables = TRUE;
755 if (empty($res) || PMA_MYSQL_INT_VERSION
< 32211) {
756 $res = PMA_mysql_query('SELECT * FROM `user` ORDER BY `User` ASC, `Host` ASC;', $userlink);
759 echo '<i>' . $strNoPrivileges . '</i>' . "\n";
760 @mysql_free_result
($res);
763 if ($oldPrivTables) {
764 // rabus: This message is hardcoded because I will replace it by
765 // a automatic repair feature soon.
766 echo '<div class="warning">' . "\n"
767 . ' Warning: Your privilege table structure seem to be older than this MySQL version!<br />' . "\n"
768 . ' Please run the script <tt>mysql_fix_privilege_tables</tt> that should be included in your MySQL server distribution to solve this problem!' . "\n"
769 . '</div><br />' . "\n";
771 echo '<form name="usersForm" action="server_privileges.php3" method="post" />' . "\n"
772 . PMA_generate_common_hidden_inputs('', '', 1)
773 . ' <table border="0">' . "\n"
775 . ' <th></th>' . "\n"
776 . ' <th> ' . $strUser . ' </th>' . "\n"
777 . ' <th> ' . $strHost . ' </th>' . "\n"
778 . ' <th> ' . $strPassword . ' </th>' . "\n"
779 . ' <th> ' . $strGlobalPrivileges . ' </th>' . "\n"
780 . ' <th> ' . $strGrantOption . ' </th>' . "\n"
781 . ' <th> ' . $strAction . ' </th>' . "\n";
782 echo ' </tr>' . "\n";
783 $useBgcolorOne = TRUE;
784 for ($i = 0; $row = PMA_mysql_fetch_array($res, MYSQL_ASSOC
); $i++
) {
786 . ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '"><input type="checkbox" name="selected_usr[]" id="checkbox_sel_users_' . $i . '" value="' . htmlspecialchars($row['User'] . '@' . $row['Host']) . '"' . (empty($checkall) ?
'' : ' checked="checked"') . ' /></td>' . "\n"
787 . ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '"><label for="checkbox_sel_users_' . $i . '">' . (empty($row['User']) ?
'<span style="color: #FF0000">' . $strAny . '</span>' : htmlspecialchars($row['User'])) . '</label></td>' . "\n"
788 . ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . htmlspecialchars($row['Host']) . '</td>' . "\n";
789 $privs = PMA_extractPrivInfo($row, TRUE);
790 echo ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . ($row['Password'] == 'Y' ?
$strYes : '<span style="color: #FF0000">' . $strNo . '</span>') . '</td>' . "\n"
791 . ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '"><tt>' . "\n"
792 . ' ' . join(',' . "\n" . ' ', $privs) . "\n"
793 . ' </tt></td>' . "\n"
794 . ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . ($row['Grant_priv'] == 'Y' ?
$strYes : $strNo) . '</td>' . "\n"
795 . ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '"><a href="server_privileges.php3?' . $url_query . '&username=' . urlencode($row['User']) . ($row['Host'] == '%' ?
'' : '&hostname=' . urlencode($row['Host'])) . '">' . $strEdit . '</a></td>' . "\n"
797 $useBgcolorOne = !$useBgcolorOne;
799 @mysql_free_result
($res);
803 . ' <td></td>' . "\n"
804 . ' <td colspan="5">' . "\n"
805 . ' <i>' . $strEnglishPrivileges . '</i> ' . "\n"
809 . ' <td colspan="6" valign="bottom">' . "\n"
810 . ' <img src="./images/arrow_' . $text_dir . '.gif" border="0" width="38" height="22" alt="' . $strWithChecked . '" />' . "\n"
811 . ' <a href="./server_privileges.php3?' . $url_query . '&checkall=1" onclick="setCheckboxes(\'usersForm\', \'selected_usr\', true); return false;">' . $strCheckAll . '</a>' . "\n"
812 . ' / ' . "\n"
813 . ' <a href="server_privileges.php3' . $url_query . '" onclick="setCheckboxes(\'usersForm\', \'selected_usr\', false); return false;">' . $strUncheckAll . '</a>' . "\n"
819 . ' <b><a href="server_privileges.php3?' . $url_query . '&adduser=1">' . $strAddUser . '</a></b><br />' . "\n"
820 . ' </li><br /><br />' . "\n"
822 . ' <b>' . $strRemoveSelectedUsers . '</b><br>' . "\n"
823 . ' <input type="radio" title="' . $strJustDelete . ' ' . $strJustDeleteDescr . '" name="mode" id="radio_mode_1" value="1" checked="checked" />' . "\n"
824 . ' <label for="radio_mode_1" title="' . $strJustDelete . ' ' . $strJustDeleteDescr . '">' . "\n"
825 . ' ' . $strJustDelete . "\n"
826 . ' </label><br />' . "\n";
827 if (PMA_MYSQL_INT_VERSION
>= 32304) {
828 echo ' <input type="radio" title="' . $strRevokeAndDelete . ' ' . $strRevokeAndDeleteDescr . '" name="mode" id="radio_mode_2" value="2" />' . "\n"
829 . ' <label for="radio_mode_2" title="' . $strRevokeAndDelete . ' ' . $strRevokeAndDeleteDescr . '">' . "\n"
830 . ' ' . $strRevokeAndDelete . "\n"
831 . ' </label><br />' . "\n";
833 echo ' <input type="radio" title="' . $strDeleteAndFlush . ' ' . $strDeleteAndFlushDescr . '" name="mode" id="radio_mode_3" value="3" />' . "\n"
834 . ' <label for="radio_mode_3" title="' . $strDeleteAndFlush . ' ' . $strDeleteAndFlushDescr . '">' . "\n"
835 . ' ' . $strDeleteAndFlush . "\n"
836 . ' </label><br />' . "\n"
837 . ' <input type="checkbox" title="' . $strDropUsersDb . '" name="drop_users_db" id="checkbox_drop_users_db" />' . "\n"
838 . ' <label for="checkbox_drop_users_db" title="' . $strDropUsersDb . '">' . "\n"
839 . ' ' . $strDropUsersDb . "\n"
840 . ' </label><br />' . "\n"
841 . ' <input type="submit" name="delete" value="' . $strGo . '" />' . "\n"
846 . ' ' . sprintf($strFlushPrivilegesNote, '<a href="server_privileges.php3?' . $url_query . '&flush_privileges=1">', '</a>') . "\n"
850 // A user was selected -> display the user's properties
851 if (!isset($hostname)) {
855 . ' ' . $strUser . ' <i><a class="h2" href="server_privileges.php3?' . $url_query . '&username=' . urlencode($username) . ($hostname == '%' ?
'' : '&hostname=' . urlencode($hostname)) . '">\'' . htmlspecialchars($username) . '\'@\'' . htmlspecialchars($hostname) . '\'</a></i>' . "\n";
856 if (!empty($dbname)) {
857 echo ' - ' . $strDatabase . ' <i><a class="h2" href="' . $cfg['DefaultTabDatabase'] . '?' . $url_query . '&db=' . urlencode($dbname) . '&reload=1">' . htmlspecialchars($dbname) . '</a></i>' . "\n";
858 if (!empty($tablename)) {
859 echo ' - ' . $strTable . ' <i><a class="h2" href="' . $cfg['DefaultTabTable'] . '?' . $url_query . '&db=' . urlencode($dbname) . '&table=' . urlencode($tablename) . '&reload=1">' . htmlspecialchars($tablename) . '</a></i>' . "\n";
863 $res = PMA_mysql_query('SELECT "foo" FROM `user` WHERE `User` = "' . $username . '" AND `Host` = "' . $hostname . '";', $userlink);
864 if (mysql_affected_rows($userlink) <= 0) {
865 echo $strUserNotFound;
866 include('./footer.inc.php3');
869 mysql_free_result($res);
873 . ' <form action="server_privileges.php3" method="post">' . "\n"
874 . PMA_generate_common_hidden_inputs('', '', 3)
875 . ' <input type="hidden" name="username" value="' . htmlspecialchars($username) . '" />' . "\n";
876 if ($hostname != '%') {
877 echo ' <input type="hidden" name="hostname" value="' . htmlspecialchars($hostname) . '" />' . "\n";
879 if (!empty($dbname)) {
880 echo ' <input type="hidden" name="dbname" value="' . htmlspecialchars($dbname) . '" />' . "\n";
881 if (!empty($tablename)) {
882 echo ' <input type="hidden" name="tablename" value="' . htmlspecialchars($tablename) . '" />' . "\n";
885 echo ' <b>' . $strEditPrivileges . '</b><br />' . "\n";
886 PMA_displayPrivTable((empty($dbname) ?
'*' : $dbname), ((empty($dbname) ||
empty($tablename)) ?
'*' : $tablename), TRUE, 3);
887 echo ' </form>' . "\n"
889 if (empty($tablename)) {
891 . ' <b>' . (empty($dbname) ?
$strDbPrivileges : $strTblPrivileges) . '</b><br />' . "\n"
892 . ' <table border="0">' . "\n"
894 . ' <th> ' . (empty($dbname) ?
$strDatabase : $strTable) . ' </th>' . "\n"
895 . ' <th> ' . $strPrivileges . ' </th>' . "\n";
896 if (PMA_MYSQL_INT_VERSION
>= 32211) {
897 echo ' <th> ' . $strGrantOption . ' </th>' . "\n";
899 echo ' <th> ' . (empty($dbname) ?
$strTblPrivileges : $strColumnPrivileges) . ' </th>' . "\n"
900 . ' <th colspan="2"> ' . $strAction . ' </th>' . "\n"
902 if (empty($dbname)) {
903 $sql_query = 'SELECT * FROM `db` WHERE `Host` = "' . $hostname . '" AND `User` = "' . $username . '" ORDER BY `Db` ASC;';
905 $sql_query = 'SELECT `Table_name`, `Table_priv`, IF(`Column_priv` = "", 0, 1) AS "Column_priv" FROM `tables_priv` WHERE `Host` = "' . $hostname . '" AND `User` = "' . $username . '" AND `Db` = "' . $dbname . '" ORDER BY `Table_name` ASC;';
907 $res = PMA_mysql_query($sql_query, $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), $sql_query);
908 if (mysql_affected_rows($userlink) == 0) {
910 . ' <td bgcolor="' . $cfg['BgcolorOne'] . '" colspan="' .(PMA_MYSQL_INT_VERSION
>= 32211 ?
'6' : '5') . '"><center><i>' . $strNone . '</i></center></td>' . "\n"
913 $useBgcolorOne = TRUE;
914 if (empty($dbname)) {
915 $res2 = PMA_mysql_query('SELECT `Db` FROM `tables_priv` WHERE `Host` = "' . $hostname . '" AND `User` = "' . $username . '" GROUP BY `Db` ORDER BY `Db` ASC;') or PMA_mysqlDie(PMA_mysql_error($userlink), 'SELECT `Db` FROM `tables_priv` WHERE `Host` = "' . $hostname . '" AND `User` = "' . $username . '" GROUP BY `Db` ORDER BY `Db` ASC;');
916 $row2 = PMA_mysql_fetch_array($res2, MYSQL_ASSOC
);
918 $found_rows = array();
919 while ($row = PMA_mysql_fetch_array($res, MYSQL_ASSOC
)) {
920 while (empty($dbname) && $row2 && $row['Db'] > $row2['Db']) {
921 $found_rows[] = $row2['Db'];
923 . ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . htmlspecialchars($row2['Db']) . '</td>' . "\n"
924 . ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '"><tt>' . "\n"
925 . ' <dfn title="' . $strPrivDescUsage . '">USAGE</dfn>' . "\n"
926 . ' </tt></td>' . "\n";
927 if (PMA_MYSQL_INT_VERSION
>= 32211) {
928 echo ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . $strNo . '</td>' . "\n";
930 echo ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . $strYes . '</td>' . "\n"
931 . ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '"><a href="server_privileges.php3?' . $url_query . '&username=' . urlencode($username) . ($hostname == '%' ?
'' : '&hostname=' . urlencode($hostname)) . '&dbname=' . urlencode($row2['Db']) . '">' . $strEdit . '</a></td>' . "\n"
932 . ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '"><a href="server_privileges.php3?' . $url_query . '&username=' . urlencode($username) . ($hostname == '%' ?
'' : '&hostname=' . urlencode($hostname)) . '&dbname=' . urlencode($row2['Db']) . '&revokeall=1">' . $strRevoke . '</a></td>' . "\n"
934 $row2 = PMA_mysql_fetch_array($res2, MYSQL_ASSOC
);
935 $useBgcolorOne = !$useBgcolorOne;
937 $found_rows[] = empty($dbname) ?
$row['Db'] : $row['Table_name'];
939 . ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . htmlspecialchars(empty($dbname) ?
$row['Db'] : $row['Table_name']) . '</td>' . "\n"
940 . ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '"><tt>' . "\n"
941 . ' ' . join(',' . "\n" . ' ', PMA_extractPrivInfo($row, TRUE)) . "\n"
942 . ' </tt></td>' . "\n";
943 if (PMA_MYSQL_INT_VERSION
>= 32211) {
944 echo ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . (((empty($dbname) && $row['Grant_priv'] == 'Y') ||
(!empty($dbname) && in_array('Grant', explode(',', $row['Table_priv'])))) ?
$strYes : $strNo) . '</td>' . "\n";
946 echo ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">';
947 if ((empty($dbname) && $row2 && $row['Db'] == $row2['Db'])
948 ||
(!empty($dbname) && $row['Column_priv'])) {
950 if (empty($dbname)) {
951 $row2 = PMA_mysql_fetch_array($res2, MYSQL_ASSOC
);
957 . ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '"><a href="server_privileges.php3?' . $url_query . '&username=' . urlencode($username) . ($hostname == '%' ?
'' : '&hostname=' . urlencode($hostname)) . '&dbname=' . (empty($dbname) ?
urlencode($row['Db']) : urlencode($dbname) . '&tablename=' . urlencode($row['Table_name'])) . '">' . $strEdit . '</a></td>' . "\n"
958 . ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '"><a href="server_privileges.php3?' . $url_query . '&username=' . urlencode($username) . ($hostname == '%' ?
'' : '&hostname=' . urlencode($hostname)) . '&dbname=' . (empty($dbname) ?
urlencode($row['Db']) : urlencode($dbname) . '&tablename=' . urlencode($row['Table_name'])) . '&revokeall=1">' . $strRevoke . '</a></td>' . "\n"
960 $useBgcolorOne = !$useBgcolorOne;
962 while (empty($dbname) && $row2 = PMA_mysql_fetch_array($res2, MYSQL_ASSOC
)) {
963 $found_rows[] = $row2['Db'];
965 . ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . htmlspecialchars($row2['Db']) . '</td>' . "\n"
966 . ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '"><tt>' . "\n"
967 . ' <dfn title="' . $strPrivDescUsage . '">USAGE</dfn>' . "\n"
968 . ' </tt></td>' . "\n";
969 if (PMA_MYSQL_INT_VERSION
>= 32211) {
970 echo ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . $strNo . '</td>' . "\n";
972 echo ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '">' . $strYes . '</td>' . "\n"
973 . ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '"><a href="server_privileges.php3?' . $url_query . '&username=' . urlencode($username) . ($hostname == '%' ?
'' : '&hostname=' . urlencode($hostname)) . '&dbname=' . urlencode($row2['Db']) . '">' . $strEdit . '</a></td>' . "\n"
974 . ' <td bgcolor="' . ($useBgcolorOne ?
$cfg['BgcolorOne'] : $cfg['BgcolorTwo']) . '"><a href="server_privileges.php3?' . $url_query . '&username=' . urlencode($username) . ($hostname == '%' ?
'' : '&hostname=' . urlencode($hostname)) . '&dbname=' . urlencode($row2['Db']) . '&revokeall=1">' . $strRevoke . '</a></td>' . "\n"
976 $row2 = PMA_mysql_fetch_array($res2, MYSQL_ASSOC
);
977 $useBgcolorOne = !$useBgcolorOne;
979 if (empty($dbname)) {
980 mysql_free_result($res2);
985 mysql_free_result($res);
989 . ' <td colspan="' .(PMA_MYSQL_INT_VERSION
>= 32211 ?
'5' : '4') . '">' . "\n"
990 . ' <form action="server_privileges.php3" method="post">' . "\n"
991 . PMA_generate_common_hidden_inputs('', '', 6)
992 . ' <input type="hidden" name="username" value="' . htmlspecialchars($username) . '" />' . "\n";
993 if ($hostname != '%') {
994 echo ' <input type="hidden" name="hostname" value="' . htmlspecialchars($hostname) . '" />' . "\n";
996 if (empty($dbname)) {
997 echo ' <label for="text_dbname">' . $strAddPrivilegesOnDb . ':</label>' . "\n";
998 $res = PMA_mysql_query('SHOW DATABASES;', $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW DATABASES;');
999 $pred_db_array = array();
1000 while ($row = PMA_mysql_fetch_row($res)) {
1001 if (!isset($found_rows) ||
!in_array($row[0], $found_rows)) {
1002 $pred_db_array[] = $row[0];
1005 mysql_free_result($res);
1008 if (!empty($pred_db_array)) {
1009 echo ' <select name="pred_dbname" class="textfield" onchange="this.form.submit();">' . "\n"
1010 . ' <option value="" selected="selected">' . $strUseTextField . ':</option>' . "\n";
1011 while (list(, $current_db) = each($pred_db_array)) {
1012 echo ' <option value="' . htmlspecialchars($current_db) . '">' . htmlspecialchars($current_db) . '</option>' . "\n";
1014 echo ' </select>' . "\n";
1016 echo ' <input type="text" id="text_dbname" name="dbname" class="textfield" />' . "\n";
1018 echo ' <input type="hidden" name="dbname" value="' . htmlspecialchars($dbname) . '"/>' . "\n"
1019 . ' <label for="text_tablename">' . $strAddPrivilegesOnTbl . ':</label>' . "\n";
1020 if ($res = @PMA_mysql_query
('SHOW TABLES FROM ' . PMA_backquote($dbname) . ';', $userlink)) {
1021 $pred_tbl_array = array();
1022 while ($row = PMA_mysql_fetch_row($res)) {
1023 if (!isset($found_rows) ||
!in_array($row[0], $found_rows)) {
1024 $pred_tbl_array[] = $row[0];
1027 mysql_free_result($res);
1030 if (!empty($pred_tbl_array)) {
1031 echo ' <select name="pred_tablename" class="textfield" onchange="this.form.submit();">' . "\n"
1032 . ' <option value="" selected="selected">' . $strUseTextField . ':</option>' . "\n";
1033 while (list(, $current_table) = each($pred_tbl_array)) {
1034 echo ' <option value="' . htmlspecialchars($current_table) . '">' . htmlspecialchars($current_table) . '</option>' . "\n";
1036 echo ' </select>' . "\n";
1041 echo ' <input type="text" id="text_tablename" name="tablename" class="textfield" />' . "\n";
1043 echo ' <input type="submit" value="' . $strGo . '" />' . "\n"
1047 . ' </table><br />' . "\n"
1050 if (empty($dbname)) {
1052 . ' <form action="server_privileges.php3" method="post" onsubmit="checkPassword(this);">' . "\n"
1053 . PMA_generate_common_hidden_inputs('', '', 3)
1054 . ' <input type="hidden" name="username" value="' . htmlspecialchars($username) . '" />' . "\n";
1055 if ($hostname != '%') {
1056 echo ' <input type="hidden" name="hostname" value="' . htmlspecialchars($hostname) . '" />' . "\n";
1058 echo ' <b>' . $strChangePassword . '</b><br />' . "\n"
1059 . ' <table border="0">' . "\n"
1061 . ' <td bgcolor="' . $cfg['BgcolorOne'] . '"><input type="radio" name="nopass" value="1" id="radio_nopass_1" onclick="pma_pw.value=\'\'; pma_pw2.value=\'\';" /></td>' . "\n"
1062 . ' <td bgcolor="' . $cfg['BgcolorOne'] . '" colspan="2"><label for="radio_nopass_1">' . $strNoPassword . '</label></td>' . "\n"
1065 . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"><input type="radio" name="nopass" value="0" id="radio_nopass_0" onclick="document.getElementById(\'pw_pma_pw\').focus();" /></td>' . "\n"
1066 . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"><label for="radio_nopass_0">' . $strPassword . ':</label></td>' . "\n"
1067 . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"><input type="password" name="pma_pw" id="pw_pma_pw" class="textfield" onchange="nopass[1].checked = true;" /></td>' . "\n"
1070 . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"> </td>' . "\n"
1071 . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"><label for="pw_pma_pw2">' . $strReType . ':</label></td>' . "\n"
1072 . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"><input type="password" name="pma_pw2" id="pw_pma_pw2" class="textfield" onchange="nopass[1].checked = true;" /></td>' . "\n"
1075 . ' <td colspan="3" align="center">' . "\n"
1076 . ' <input type="submit" name="change_pw" value="' . $strGo . '" />' . "\n"
1079 . ' </table>' . "\n"
1083 echo '</ul>' . "\n";
1088 . ' ' . $strAddUser . "\n"
1090 . '<form action="server_privileges.php3" method="post" onsubmit="return checkAddUser(this);">' . "\n"
1091 . PMA_generate_common_hidden_inputs('', '', 1)
1092 . ' <table border="0">' . "\n"
1094 . ' <th colspan="3">' . "\n"
1095 . ' ' . $strLoginInformation . "\n"
1099 . ' <td bgcolor="' . $cfg['BgcolorOne'] . '">' . "\n"
1100 . ' <label for="select_pred_username">' . "\n"
1101 . ' ' . $strUserName . ':' . "\n"
1102 . ' </label>' . "\n"
1104 . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '">' . "\n"
1105 . ' <select name="pred_username" id="select_pred_username" title="' . $strUserName . '" class="textfield"' . "\n"
1106 . ' onchange="if (this.value == \'any\') { username.value = \'\'; } else if (this.value == \'userdefined\') { username.focus(); username.select(); }">' . "\n"
1107 . ' <option value="any"' . ((isset($pred_username) && $pred_username == 'any') ?
' selected="selected"' : '') . '>' . $strAnyUser . '</option>' . "\n"
1108 . ' <option value="userdefined"' . ((!isset($pred_username) ||
$pred_username == 'userdefined') ?
' selected="selected"' : '') . '>' . $strUseTextField . ':</option>' . "\n"
1109 . ' </select>' . "\n"
1111 . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '">' . "\n"
1112 . ' <input type="text" name="username" class="textfield" title="' . $strUserName . '"' . (empty($username) ?
'' : ' value="' . $username . '"') . ' onchange="pred_username.value = \'userdefined\';" />' . "\n"
1116 . ' <td bgcolor="' . $cfg['BgcolorOne'] . '">' . "\n"
1117 . ' <label for="select_pred_hostname">' . "\n"
1118 . ' ' . $strHost . ':' . "\n"
1119 . ' </label>' . "\n"
1121 . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '">' . "\n"
1122 . ' <select name="pred_hostname" id="select_pred_hostname" title="' . $strHost . '" class="textfield"' . "\n";
1123 $res = PMA_mysql_query('SELECT USER();', $userlink);
1124 $row = @PMA_mysql_fetch_row
($res);
1125 @mysql_free_result
($res);
1127 if (!empty($row[0])) {
1128 $thishost = str_replace("'", '', substr($row[0], (strrpos($row[0], '@') +
1)));
1129 if ($thishost == 'localhost' ||
$thishost == '127.0.0.1') {
1133 echo ' onchange="if (this.value == \'any\') { hostname.value = \'%\'; } else if (this.value == \'localhost\') { hostname.value = \'localhost\'; } '
1134 . (empty($thishost) ?
'' : 'else if (this.value == \'thishost\') { hostname.value = \'' . addslashes(htmlspecialchars($thishost)) . '\'; } ')
1135 . 'else if (this.value == \'userdefined\') { hostname.focus(); hostname.select(); }">' . "\n";
1137 echo ' <option value="any"' . ((isset($pred_hostname) && $pred_hostname == 'any') ?
' selected="selected"' : '') . '>' . $strAnyHost . '</option>' . "\n"
1138 . ' <option value="localhost"' . ((isset($pred_hostname) && $pred_hostname == 'localhost') ?
' selected="selected"' : '') . '>' . $strLocalhost . '</option>' . "\n";
1139 if (!empty($thishost)) {
1140 echo ' <option value="thishost"' . ((isset($pred_hostname) && $pred_hostname == 'thishost') ?
' selected="selected"' : '') . '>' . $strThisHost . '</option>' . "\n";
1143 echo ' <option value="userdefined"' . ((isset($pred_hostname) && $pred_hostname == 'userdefined') ?
' selected="selected"' : '') . '>' . $strUseTextField . ':</option>' . "\n"
1144 . ' </select>' . "\n"
1146 . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '">' . "\n"
1147 . ' <input type="text" name="hostname" value="' . (empty($hostname) ?
'%' : $hostname) . '" class="textfield" title="' . $strHost . '" onchange="pred_hostname.value = \'userdefined\';" />' . "\n"
1151 . ' <td bgcolor="' . $cfg['BgcolorOne'] . '">' . "\n"
1152 . ' <label for="select_pred_password">' . "\n"
1153 . ' ' . $strPassword . ':' . "\n"
1154 . ' </label>' . "\n"
1156 . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '">' . "\n"
1157 . ' <select name="pred_password" id="select_pred_password" title="' . $strPassword . '" class="textfield"' . "\n"
1158 . ' onchange="if (this.value == \'none\') { pma_pw.value = \'\'; pma_pw2.value = \'\'; } else if (this.value == \'userdefined\') { pma_pw.focus(); pma_pw.select(); }">' . "\n"
1159 . ' <option value="none">' . $strNoPassword . '</option>' . "\n"
1160 . ' <option value="userdefined" selected="selected">' . $strUseTextField . ':</option>' . "\n"
1161 . ' </select>' . "\n"
1163 . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '">' . "\n"
1164 . ' <input type="password" name="pma_pw" class="textfield" title="' . $strPassword . '" onchange="pred_password.value = \'userdefined\';" />' . "\n"
1168 . ' <td bgcolor="' . $cfg['BgcolorOne'] . '">' . "\n"
1169 . ' <label for="text_pma_pw2">' . "\n"
1170 . ' ' . $strReType . ':' . "\n"
1171 . ' </label>' . "\n"
1173 . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '"> </td>' . "\n"
1174 . ' <td bgcolor="' . $cfg['BgcolorTwo'] . '">' . "\n"
1175 . ' <input type="password" name="pma_pw2" id="text_pma_pw2" class="textfield" title="' . $strReType . '" onchange="pred_password.value = \'userdefined\';" />' . "\n"
1178 . ' </table><br />' . "\n";
1179 PMA_displayPrivTable('*', '*', FALSE, 1);
1180 echo ' <br />' . "\n"
1181 . ' <input type="submit" name="adduser_submit" value="' . $strGo . '" />' . "\n"
1183 } // end if (empty($adduser)) ... else ...
1187 * Displays the footer
1190 require('./footer.inc.php3');