Initial commit

This commit is contained in:
2022-11-21 09:47:28 +01:00
commit 76cec83d26
11652 changed files with 1980467 additions and 0 deletions

View File

@ -0,0 +1,16 @@
<?php use PMA\libraries\Util; ?>
<label for="text_dbname"><?= __('Add privileges on the following database(s):'); ?></label>
<?php if (! empty($databases)) : ?>
<select name="pred_dbname[]" multiple="multiple">
<?php foreach ($databases as $database) : ?>
<?php $escapedDatabase = Util::escapeMysqlWildcards($database); ?>
<option value="<?= htmlspecialchars($escapedDatabase); ?>">
<?= htmlspecialchars($database); ?>
</option>
<?php endforeach; ?>
</select>
<?php endif; ?>
<input type="text" id="text_dbname" name="dbname" />
<?= Util::showHint(__('Wildcards % and _ should be escaped with a \ to use them literally.'))?>

View File

@ -0,0 +1,14 @@
<input type="hidden" name="dbname" value="<?= htmlspecialchars($database); ?>"/>
<label for="text_routinename"><?= __('Add privileges on the following routine:'); ?></label>
<?php if (! empty($routines)) : ?>
<select name="pred_routinename" class="autosubmit">
<option value="" selected="selected"><?= __('Use text field'); ?>:</option>
<?php foreach ($routines as $routine) : ?>
<option value="<?= htmlspecialchars($routine); ?>"><?= htmlspecialchars($routine); ?></option>
<?php endforeach; ?>
</select>
<?php endif; ?>
<input type="text" id="text_routinename" name="routinename" />

View File

@ -0,0 +1,14 @@
<input type="hidden" name="dbname" value="<?= htmlspecialchars($database); ?>"/>
<label for="text_tablename"><?= __('Add privileges on the following table:'); ?></label>
<?php if (! empty($tables)) : ?>
<select name="pred_tablename" class="autosubmit">
<option value="" selected="selected"><?= __('Use text field'); ?>:</option>
<?php foreach ($tables as $table) : ?>
<option value="<?= htmlspecialchars($table); ?>"><?= htmlspecialchars($table); ?></option>
<?php endforeach; ?>
</select>
<?php endif; ?>
<input type="text" id="text_tablename" name="tablename" />

View File

@ -0,0 +1,26 @@
<div id="edit_user_dialog">
<?= $header; ?>
<form class="submenu-item" name="usersForm" id="addUsersForm" action="server_privileges.php" method="post">
<?= PMA_URL_getHiddenInputs(); ?>
<input type="hidden" name="username" value="<?= htmlspecialchars($username); ?>">
<input type="hidden" name="hostname" value="<?= htmlspecialchars($hostname); ?>">
<input type="hidden" name="dbname" value="<?= htmlspecialchars($database); ?>">
<input type="hidden" name="routinename" value="<?= htmlspecialchars($routine); ?>">
<input type="hidden" name="grant_count" value="<?= $grantCount; ?>">
<fieldset id="fieldset_user_global_rights">
<legend data-submenu-label="<?= __('Routine')?>">
<?= __('Routine-specific privileges'); ?>
</legend>
<p>
<small>
<i><?= __('Note: MySQL privilege names are expressed in English.'); ?></i>
</small>
</p>
<?= $privCheckboxes; ?>
</fieldset>
<fieldset id="fieldset_user_privtable_footer" class="tblFooters">
<input type="hidden" name="update_privs" value="1">
<input type="submit" value="<?= __('Go')?>">
</fieldset>
</form>
</div>

View File

@ -0,0 +1,68 @@
<?php use PMA\libraries\Template; ?>
<form class="submenu-item" action="server_privileges.php" id="<?= $formId; ?>" method="post">
<?= PMA_URL_getHiddenInputs(); ?>
<input type="hidden" name="username" value="<?= htmlspecialchars($userName); ?>" />
<input type="hidden" name="hostname" value="<?= htmlspecialchars($hostName); ?>" />
<fieldset>
<legend data-submenu-label="<?= $subMenuLabel; ?>">
<?= $legend; ?>
</legend>
<table class="data">
<thead>
<tr>
<th><?= $typeLabel; ?></th>
<th><?= __('Privileges'); ?></th>
<th><?= __('Grant'); ?></th>
<?php if ($type == 'database') : ?>
<th><?= __('Table-specific privileges'); ?></th>
<?php elseif ($type == 'table') : ?>
<th><?= __('Column-specific privileges'); ?></th>
<?php endif; ?>
<th colspan="2"><?= __('Action'); ?></th>
</tr>
</thead>
<tbody>
<?php if (count($privileges) == 0) : ?>
<?php $colspan = ($type == 'database' ? 7 : ($type == 'table' ? 6 : 5)); ?>
<tr class="odd">
<td colspan="<?= $colspan; ?>"><center><i><?= __('None') ?></i></center></td>
</tr>
<?php else : ?>
<?php $odd = true; ?>
<?php foreach ($privileges as $privilege) : ?>
<?= Template::get('privileges/privileges_summary_row')
->render(
array_merge(
$privilege,
array(
'odd' => $odd,
'type' => $type,
)
)
); ?>
<?php $odd = !$odd; ?>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
<?php if ($type == 'database') : ?>
<?= Template::get('privileges/add_privileges_database')
->render(array('databases' => $databases)); ?>
<?php elseif ($type == 'table') : ?>
<?= Template::get('privileges/add_privileges_table')
->render(array('database' => $database, 'tables' => $tables)); ?>
<?php else: // routine ?>
<?= Template::get('privileges/add_privileges_routine')
->render(array('database' => $database, 'routines' => $routines)); ?>
<?php endif; ?>
</fieldset>
<fieldset class="tblFooters">
<input type="submit" value="<?= __('Go'); ?>" />
</fieldset>
</form>

View File

@ -0,0 +1,14 @@
<tr class="<?= ($odd ? 'odd' : 'even'); ?>">
<td><?= htmlspecialchars($name); ?></td>
<td><code><?= $privileges; ?></code></td>
<td><?= ($grant ? __('Yes') : __('No')); ?></td>
<?php if ($type == 'database') : ?>
<td><?= ($tablePrivs ? __('Yes') : __('No')); ?></td>
<?php elseif ($type == 'table') : ?>
<td><?= ($columnPrivs ? __('Yes') : __('No')); ?></td>
<?php endif; ?>
<td><?= $editLink; ?></td>
<td><?= $revokeLink; ?></td>
</tr>