2007-08-08 16:26:30 +00:00
|
|
|
<?php
|
2007-08-09 15:03:39 +00:00
|
|
|
page_header(lang('Privileges'));
|
2007-08-10 15:09:17 +00:00
|
|
|
echo '<p><a href="' . htmlspecialchars($SELF) . 'user=">' . lang('Create user') . "</a></p>";
|
2009-05-08 05:23:03 +00:00
|
|
|
$result = $dbh->query("SELECT User, Host FROM mysql.user ORDER BY Host, User");
|
2007-08-09 15:03:39 +00:00
|
|
|
if (!$result) {
|
2007-08-10 15:09:17 +00:00
|
|
|
?>
|
|
|
|
<form action=""><p>
|
|
|
|
<?php if (strlen($_GET["server"])) { ?><input type="hidden" name="server" value="<?php echo htmlspecialchars($_GET["server"]); ?>" /><?php } ?>
|
|
|
|
<?php echo lang('Username'); ?>: <input name="user" />
|
2007-08-11 06:24:11 +00:00
|
|
|
<?php echo lang('Server'); ?>: <input name="host" value="localhost" />
|
2007-08-10 15:09:17 +00:00
|
|
|
<input type="hidden" name="grant" value="" />
|
|
|
|
<input type="submit" value="<?php echo lang('Edit'); ?>" />
|
|
|
|
</p></form>
|
|
|
|
<?php
|
2009-05-08 05:23:03 +00:00
|
|
|
$result = $dbh->query("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1) AS User, SUBSTRING_INDEX(CURRENT_USER, '@', -1) AS Host");
|
2007-08-08 16:26:30 +00:00
|
|
|
}
|
2009-05-01 10:41:33 +00:00
|
|
|
echo "<table cellspacing='0'>\n";
|
2007-08-09 15:03:39 +00:00
|
|
|
echo "<thead><tr><th> </th><th>" . lang('Username') . "</th><th>" . lang('Server') . "</th></tr></thead>\n";
|
|
|
|
while ($row = $result->fetch_assoc()) {
|
2009-04-30 15:21:31 +00:00
|
|
|
echo '<tr' . odd() . '><td><a href="' . htmlspecialchars($SELF) . 'user=' . urlencode($row["User"]) . '&host=' . urlencode($row["Host"]) . '">' . lang('edit') . '</a></td><td>' . htmlspecialchars($row["User"]) . "</td><td>" . htmlspecialchars($row["Host"]) . "</td></tr>\n";
|
2007-08-09 15:03:39 +00:00
|
|
|
}
|
|
|
|
echo "</table>\n";
|
|
|
|
$result->free();
|