"Fossies" - the Fresh Open Source Software Archive

Member "phpMyAdmin-5.1.0-all-languages/templates/table/privileges/index.twig" (24 Feb 2021, 6103 Bytes) of package /linux/www/phpMyAdmin-5.1.0-all-languages.zip:


The requested HTML page contains a <FORM> tag that is unusable on "Fossies" in "automatic" (rendered) mode so that page is shown as HTML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 {% if is_superuser %}
    2   <form id="usersForm" action="{{ url('/server/privileges') }}">
    3     {{ get_hidden_inputs(db, table) }}
    4 
    5     <fieldset>
    6       <legend>
    7         {{ get_icon('b_usrcheck') }}
    8         {{ 'Users having access to "%s"'|trans|format('<a href="' ~ table_url ~ get_common({
    9           'db': db,
   10           'table': table
   11         }, '&') ~ '">' ~ db|escape('html') ~ '.' ~ table|escape('html') ~ '</a>')|raw }}
   12       </legend>
   13 
   14       <div class="table-responsive-md jsresponsive">
   15         <table class="table table-light table-striped table-hover">
   16           <thead class="thead-light">
   17             <tr>
   18               <th></th>
   19               <th>{% trans 'User name' %}</th>
   20               <th>{% trans 'Host name' %}</th>
   21               <th>{% trans 'Type' %}</th>
   22               <th>{% trans 'Privileges' %}</th>
   23               <th>{% trans 'Grant' %}</th>
   24               <th colspan="2">{% trans 'Action' %}</th>
   25             </tr>
   26           </thead>
   27 
   28           <tbody>
   29             {% for privilege in privileges %}
   30               {% set privileges_amount = privilege.privileges|length %}
   31               <tr>
   32                 <td{% if privileges_amount > 1 %} class="align-middle" rowspan="{{ privileges_amount }}"{% endif %}>
   33                   <input type="checkbox" class="checkall" name="selected_usr[]" id="checkbox_sel_users_{{ loop.index0 }}" value="
   34                     {{- privilege.user ~ '&amp;#27;' ~ privilege.host }}">
   35                 </td>
   36                 <td{% if privileges_amount > 1 %} class="align-middle" rowspan="{{ privileges_amount }}"{% endif %}>
   37                   {% if privilege.user is empty %}
   38                     <span class="text-danger">{% trans 'Any' %}</span>
   39                   {% else %}
   40                     {{ privilege.user }}
   41                   {% endif %}
   42                 </td>
   43                 <td{% if privileges_amount > 1 %} class="align-middle" rowspan="{{ privileges_amount }}"{% endif %}>
   44                   {{ privilege.host }}
   45                 </td>
   46                 {% for priv in privilege.privileges %}
   47                   <td>
   48                     {% if priv.type == 'g' %}
   49                       {% trans 'global' %}
   50                     {% elseif priv.type == 'd' %}
   51                       {% if priv.database == db|replace({'_': '\\_', '%': '\\%'}) %}
   52                         {% trans 'database-specific' %}
   53                       {% else %}
   54                         {% trans 'wildcard' %}: <code>{{ priv.database }}</code>
   55                       {% endif %}
   56                     {% elseif priv.type == 't' %}
   57                       {% trans 'table-specific' %}
   58                     {% elseif priv.type == 'r' %}
   59                       {% trans 'routine' %}
   60                     {% endif %}
   61                   </td>
   62                   <td>
   63                     <code>
   64                       {% if priv.type == 'r' %}
   65                         {{ priv.routine }}
   66                         ({{ priv.privileges|join(', ')|upper }})
   67                       {% else %}
   68                         {{ priv.privileges|join(', ')|raw }}
   69                       {% endif %}
   70                     </code>
   71                   </td>
   72                   <td>
   73                     {{ priv.has_grant ? 'Yes'|trans : 'No'|trans }}
   74                   </td>
   75                   <td>
   76                     {% if is_grantuser %}
   77                       <a class="edit_user_anchor" href="{{ url('/server/privileges', {
   78                         'username': privilege.user,
   79                         'hostname': privilege.host,
   80                         'dbname': priv.database != '*' ? priv.database,
   81                         'tablename': priv.table is defined and priv.table != '*' ? priv.table,
   82                         'routinename': priv.routine ?? ''
   83                       }) }}">
   84                         {{ get_icon('b_usredit', 'Edit privileges'|trans) }}
   85                       </a>
   86                     {% endif %}
   87                   </td>
   88                   <td class="text-center">
   89                     <a class="export_user_anchor ajax" href="{{ url('/server/privileges', {
   90                       'username': privilege.user,
   91                       'hostname': privilege.host,
   92                       'export': true,
   93                       'initial': ''
   94                     }) }}">
   95                       {{ get_icon('b_tblexport', 'Export'|trans) }}
   96                     </a>
   97                   </td>
   98                 </tr>
   99                   {% if privileges_amount > 1 %}
  100                     <tr class="noclick">
  101                   {% endif %}
  102                 {% endfor %}
  103             {% else %}
  104               <tr>
  105                 <td colspan="7">
  106                   {% trans 'No user found.' %}
  107                 </td>
  108               </tr>
  109             {% endfor %}
  110           </tbody>
  111         </table>
  112       </div>
  113 
  114       <div class="floatleft">
  115         <img class="selectallarrow" src="{{ theme_image_path }}arrow_{{ text_dir }}.png" alt="
  116           {%- trans 'With selected:' %}" width="38" height="22">
  117         <input type="checkbox" id="usersForm_checkall" class="checkall_box" title="{% trans 'Check all' %}">
  118         <label for="usersForm_checkall">{% trans 'Check all' %}</label>
  119         <em class="with-selected">{% trans 'With selected:' %}</em>
  120         <button class="btn btn-link mult_submit" type="submit" name="submit_mult" value="export" title="{% trans 'Export' %}">
  121           {{ get_icon('b_tblexport', 'Export'|trans) }}
  122         </button>
  123       </div>
  124     </fieldset>
  125   </form>
  126 {% else %}
  127   {{ 'Not enough privilege to view users.'|trans|error }}
  128 {% endif %}
  129 
  130 {% if is_createuser %}
  131   <div class="row">
  132     <div class="col-12">
  133       <fieldset id="fieldset_add_user">
  134         <legend>{% trans %}New{% context %}Create new user{% endtrans %}</legend>
  135         <a id="add_user_anchor" href="{{ url('/server/privileges', {
  136           'adduser': true,
  137           'dbname': db,
  138           'tablename': table
  139         }) }}" rel="{{ get_common({'checkprivsdb': db, 'checkprivstable': table}) }}">
  140           {{ get_icon('b_usradd', 'Add user account'|trans) }}
  141         </a>
  142       </fieldset>
  143     </div>
  144   </div>
  145 {% endif %}