blob: 438ecb77dba97fd2436253052e41e3e818a5082e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
<form class="submenu-item" action="server_privileges.php" id="{{ form_id }}" method="post">
{{ get_hidden_inputs() }}
<input type="hidden" name="username" value="{{ username }}">
<input type="hidden" name="hostname" value="{{ hostname }}">
<fieldset>
<legend data-submenu-label="{{ sub_menu_label }}">
{{ legend }}
</legend>
<table class="data">
<thead>
<tr>
<th>{{ type_label }}</th>
<th>{% trans 'Privileges' %}</th>
<th>{% trans 'Grant' %}</th>
{% if type == 'database' %}
<th>{% trans 'Table-specific privileges' %}</th>
{% elseif type == 'table' %}
<th>{% trans 'Column-specific privileges' %}</th>
{% endif %}
<th colspan="2">{% trans 'Action' %}</th>
</tr>
</thead>
<tbody>
{% if privileges|length == 0 %}
{% set colspan = type == 'database' ? 7 : (type == 'table' ? 6 : 5) %}
<tr>
<td colspan="{{ colspan }}"><center><em>{% trans 'None' %}</em></center></td>
</tr>
{% else %}
{% for privilege in privileges %}
<tr>
<td>{{ privilege['name'] }}</td>
<td><code>{{ privilege['privileges']|raw }}</code></td>
<td>{{ privilege['grant'] ? 'Yes'|trans : 'No'|trans }}</td>
{% if type == 'database' %}
<td>{{ privilege['table_privs'] ? 'Yes'|trans : 'No'|trans }}</td>
{% elseif type == 'table' %}
<td>{{ privilege['column_privs'] ? 'Yes'|trans : 'No'|trans }}</td>
{% endif %}
<td>{{ privilege['edit_link']|raw }}</td>
<td>{{ privilege['revoke_link']|raw }}</td>
</tr>
{% endfor %}
{% endif %}
</tbody>
</table>
{% if type == 'database' %}
<label for="text_dbname">{% trans 'Add privileges on the following database(s):' %}</label>
{%- if databases is not empty %}
<select name="pred_dbname[]" multiple="multiple">
{% for database in databases %}
<option value="{{ database|escape_mysql_wildcards }}">
{{ database }}
</option>
{% endfor %}
</select>
{% endif -%}
<input type="text" id="text_dbname" name="dbname">
{{ show_hint("Wildcards % and _ should be escaped with a \\ to use them literally."|trans) }}
{% elseif type == 'table' %}
<input type="hidden" name="dbname" value="{{ database }}">
<label for="text_tablename">{% trans 'Add privileges on the following table:' %}</label>
{%- if tables is not empty %}
<select name="pred_tablename" class="autosubmit">
<option value="" selected="selected">{% trans 'Use text field' %}:</option>
{% for table in tables %}
<option value="{{ table }}">{{ table }}</option>
{% endfor %}
</select>
{% endif -%}
<input type="text" id="text_tablename" name="tablename">
{% else %}
<input type="hidden" name="dbname" value="{{ database }}">
<label for="text_routinename">{% trans 'Add privileges on the following routine:' %}</label>
{%- if routines is not empty %}
<select name="pred_routinename" class="autosubmit">
<option value="" selected="selected">{% trans 'Use text field' %}:</option>
{% for routine in routines %}
<option value="{{ routine }}">{{ routine }}</option>
{% endfor %}
</select>
{% endif -%}
<input type="text" id="text_routinename" name="routinename">
{% endif %}
</fieldset>
<fieldset class="tblFooters">
<input class="btn btn-primary" type="submit" value="{% trans 'Go' %}">
</fieldset>
</form>
|