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>";
|
2007-08-09 15:03:39 +00:00
|
|
|
$result = $mysql->query("SELECT User, Host FROM mysql.user ORDER BY Host, User");
|
|
|
|
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
|
2007-08-09 15:03:39 +00:00
|
|
|
$result = $mysql->query("SELECT SUBSTRING_INDEX(CURRENT_USER, '@', 1) AS User, SUBSTRING_INDEX(CURRENT_USER, '@', -1) AS Host");
|
2007-08-08 16:26:30 +00:00
|
|
|
}
|
2007-08-10 15:09:17 +00:00
|
|
|
echo "</p>\n";
|
2007-08-09 15:03:39 +00:00
|
|
|
echo "<table border='1' cellspacing='0' cellpadding='2'>\n";
|
|
|
|
echo "<thead><tr><th> </th><th>" . lang('Username') . "</th><th>" . lang('Server') . "</th></tr></thead>\n";
|
|
|
|
while ($row = $result->fetch_assoc()) {
|
|
|
|
echo '<tr><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";
|
|
|
|
}
|
|
|
|
echo "</table>\n";
|
|
|
|
$result->free();
|