init web ems all

This commit is contained in:
agtuser
2024-09-27 17:13:36 +08:00
parent 81c97acbe9
commit 5cc56f8078
4263 changed files with 798779 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
<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="{{ Util_escapeMysqlWildcards(database) }}">
{{ database }}
</option>
{% endfor %}
</select>
{% endif -%}
<input type="text" id="text_dbname" name="dbname" />
{{ Util_showHint("Wildcards % and _ should be escaped with a \\ to use them literally."|trans) }}

View File

@@ -0,0 +1,14 @@
<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" />

View File

@@ -0,0 +1,14 @@
<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" />

View File

@@ -0,0 +1,8 @@
<fieldset id="fieldset_add_user">
<legend>{% trans %}New{% context %}Create new user{% endtrans %}</legend>
<a id="add_user_anchor" href="server_privileges.php{{ Url_getCommon(url_params) }}"
{% if rel_params is not empty %}
rel="{{ Url_getCommon(rel_params) }}"
{% endif %}>
{{ Util_getIcon('b_usradd') }}{% trans 'Add user account' %}</a>
</fieldset>

View File

@@ -0,0 +1,9 @@
<form class="ajax" id="changeUserGroupForm" action="server_privileges.php" method="post">
{{ Url_getHiddenInputs(params) }}
<fieldset id="fieldset_user_group_selection">
<legend>{% trans 'User group' %}</legend>
{% trans 'User group' %}:
{{ Util_getDropdown('userGroup', all_user_groups, user_group, 'userGroup_select') }}
<input type="hidden" name="changeUserGroup" value="1">
</fieldset>
</form>

View File

@@ -0,0 +1,24 @@
<div class="item" id="div_item_{{ name }}">
<label for="select_{{ name }}_priv">
<code><dfn title="{{ name_for_dfn }}">{{ priv_for_header }}</dfn></code>
</label>
<select id="select_{{ name }}_priv" name="{{ name_for_select }}[]" multiple="multiple" size="8">
{% for curr_col, curr_col_privs in columns %}
<option value="{{ curr_col }}"
{% if row[name_for_select] == 'Y' or curr_col_privs[name_for_current] %}
selected="selected"
{% endif %}>
{{ curr_col }}
</option>
{% endfor %}
</select>
<em>{% trans 'Or' %}</em>
<label for="checkbox_{{ name_for_select }}_none">
<input type="checkbox" name="{{ name_for_select }}_none"
id="checkbox_{{ name_for_select }}_none"
title="{% trans %}None{% context %}None privileges{% endtrans %}" />
{% trans %}None{% context %}None privileges{% endtrans %}
</label>
</div>

View File

@@ -0,0 +1,17 @@
<fieldset id="fieldset_delete_user">
<legend>
{{ Util_getIcon('b_usrdrop') }}{% trans 'Remove selected user accounts' %}
</legend>
<input type="hidden" name="mode" value="2" />
<p>({% trans 'Revoke all active privileges from the users and delete them afterwards.' %})</p>
<input type="checkbox" title="{% trans 'Drop the databases that have the same names as the users.' %}"
name="drop_users_db" id="checkbox_drop_users_db" />
<label for="checkbox_drop_users_db"
title="{% trans 'Drop the databases that have the same names as the users.' %}">
{% trans 'Drop the databases that have the same names as the users.' %}
</label>
</fieldset>
<fieldset id="fieldset_delete_user_footer" class="tblFooters">
<input type="submit" name="delete" value="{% trans 'Go' %}" id="buttonGo" class="ajax" />
</fieldset>

View File

@@ -0,0 +1,26 @@
<div id="edit_user_dialog">
{{ header|raw }}
<form class="submenu-item" name="usersForm" id="addUsersForm" action="server_privileges.php" method="post">
{{ Url_getHiddenInputs() }}
<input type="hidden" name="username" value="{{ username }}">
<input type="hidden" name="hostname" value="{{ hostname }}">
<input type="hidden" name="dbname" value="{{ database }}">
<input type="hidden" name="routinename" value="{{ routine }}">
<input type="hidden" name="grant_count" value="{{ grant_count }}">
<fieldset id="fieldset_user_global_rights">
<legend data-submenu-label="{% trans 'Routine' %}">
{% trans 'Routine-specific privileges' %}
</legend>
<p>
<small>
<em>{% trans 'Note: MySQL privilege names are expressed in English.' %}</em>
</small>
</p>
{{ priv_checkboxes|raw }}
</fieldset>
<fieldset id="fieldset_user_privtable_footer" class="tblFooters">
<input type="hidden" name="update_privs" value="1">
<input type="submit" value="{% trans 'Go' %}">
</fieldset>
</form>
</div>

View File

@@ -0,0 +1,18 @@
{% for key, table in priv_table %}
<fieldset>
<legend>
<input type="checkbox" class="sub_checkall_box" id="checkall_{{ priv_table_names[key] }}_priv"
title="{% trans 'Check all' %}" />
<label for="checkall_{{ priv_table_names[key] }}_priv">{{ priv_table_names[key] }}</label>
</legend>
{% for priv in table %}
{% set checked = row[priv[0] ~ '_priv'] is defined and row[priv[0] ~ '_priv'] == 'Y' ? ' checked="checked"' %}
{% set formatted_priv = ServerPrivileges_formatPrivilege(priv, true) %}
{% include 'privileges/global_priv_tbl_item.twig' with {
'checked': checked,
'formatted_priv': formatted_priv,
'priv': priv
} only %}
{% endfor %}
</fieldset>
{% endfor %}

View File

@@ -0,0 +1,9 @@
<div class="item">
<input type="checkbox" class="checkall" name="{{ priv[0] }}_priv" id="checkbox_{{ priv[0] }}_priv"
value="Y" title="{{ priv[2] }}" {{ checked }} />
<label for="checkbox_{{ priv[0] }}_priv">
<code>
{{ formatted_priv|raw }}
</code>
</label>
</div>

View File

@@ -0,0 +1,26 @@
<table id="initials_table" cellspacing="5">
<tr>
{% for tmp_initial, initial_was_found in array_initials %}
{% if tmp_initial is not same as(null) %}
{% if initial_was_found %}
<td>
<a class="ajax
{{- initial is defined and initial is same as(tmp_initial) ? ' active' -}}
" href="server_privileges.php
{{- Url_getCommon({'initial': tmp_initial}) }}">
{{- tmp_initial|raw -}}
</a>
</td>
{% else %}
<td>{{ tmp_initial|raw }}</td>
{% endif %}
{% endif %}
{% endfor %}
<td>
<a href="server_privileges.php
{{- Url_getCommon({'showall': 1}) }}" class="nowrap">
{% trans 'Show all' %}
</a>
</td>
</tr>
</table>

View File

@@ -0,0 +1,62 @@
<form class="submenu-item" action="server_privileges.php" id="{{ form_id }}" method="post">
{{ Url_getHiddenInputs() }}
<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 %}
{% include 'privileges/privileges_summary_row.twig' with
privilege|merge({'type': type})
only %}
{% endfor %}
{% endif %}
</tbody>
</table>
{% if type == 'database' %}
{% include 'privileges/add_privileges_database.twig' with {
'databases': databases
} only %}
{% elseif type == 'table' %}
{% include 'privileges/add_privileges_table.twig' with {
'database': database,
'tables': tables
} only %}
{% else %}
{% include 'privileges/add_privileges_routine.twig' with {
'database': database,
'routines': routines
} only %}
{% endif %}
</fieldset>
<fieldset class="tblFooters">
<input type="submit" value="{% trans 'Go' %}" />
</fieldset>
</form>

View File

@@ -0,0 +1,14 @@
<tr>
<td>{{ name }}</td>
<td><code>{{ privileges|raw }}</code></td>
<td>{{ grant ? 'Yes'|trans : 'No'|trans }}</td>
{% if type == 'database' %}
<td>{{ table_privs ? 'Yes'|trans : 'No'|trans }}</td>
{% elseif type == 'table' %}
<td>{{ column_privs ? 'Yes'|trans : 'No'|trans }}</td>
{% endif %}
<td>{{ edit_link|raw }}</td>
<td>{{ revoke_link|raw }}</td>
</tr>

View File

@@ -0,0 +1,14 @@
<fieldset>
<legend>SSL</legend>
<div id="require_ssl_div">
{% for require_option in require_options %}
{% if require_option['name'] is same as('ssl_cipher') %}
<div id="specified_div" style="padding-left:20px;">
{% endif %}
{% include 'privileges/require_options_item.twig' with {
'require_option': require_option
} only %}
{% endfor %}
</div>{# END specified_div #}
</div>{# END require_ssl_div #}
</fieldset>

View File

@@ -0,0 +1,23 @@
<div class="item">
{% if require_option['radio'] %}
<input type="radio" name="ssl_type"
id="{{ require_option['name'] }}_{{ require_option['value'] }}"
title="{{ require_option['description'] }}"
value="{{ require_option['value'] }}" {{ require_option['checked']|raw -}}
/>
<label for="{{ require_option['name'] }}_{{ require_option['value'] }}">
<code>{{ require_option['label'] }}</code>
</label>
{% else %}
<label for="text_{{ require_option['name'] }}">
<code>{{ require_option['label'] }}</code>
</label>
<input type="text" name="{{ require_option['name'] }}"
id="text_{{ require_option['name'] }}" value="{{ require_option['value'] }}"
size="80" title="{{ require_option['description'] }}"
{%- if require_option['disabled'] %}
disabled
{%- endif -%}
/>
{% endif %}
</div>

View File

@@ -0,0 +1,11 @@
<div class="item">
<label for="text_{{ limit['input_name'] }}">
<code>
<dfn title="{{ limit['description'] }}">
{{ limit['name_main'] }}
</dfn>
</code>
</label>
<input type="number" name="{{ limit['input_name'] }}" id="text_{{ limit['input_name'] }}"
value="{{ limit['value'] }}" title="{{ limit['description'] }}" />
</div>

View File

@@ -0,0 +1,13 @@
<fieldset>
<legend>{% trans 'Resource limits' %}</legend>
<p>
<small>
<em>{% trans 'Note: Setting these options to 0 (zero) removes the limit.' %}</em>
</small>
</p>
{% for limit in limits %}
{% include 'privileges/resource_limit_item.twig' with {
'limit': limit
} only %}
{% endfor %}
</fieldset>