[% WRAPPER _conf_frame.tt %]

<div align="center">
<form action="conf.cgi" method="POST">
<input type="hidden" name="sub" value="users">
<input type="hidden" name="action" value="change">
[% IF readonly %]
<br><font color="orange">Readonly: Make sure the config file is writable!</font>
[% END %]
  <table border="0" class='data conftoolusers'>
    <tr>
      <th colspan=2 class='data conftoolheader' style="text-align:center">select user to change</th>
    </tr>
    <tr>
      <td class='dataVar' align="left">Username</td>
      <td class='dataVal'>
        <input type="text" name="data.username" id="data.username" value="[% user_name %]"[% IF use_ajax_search %] onclick="ajax_search.init(this, 'contact', {url:'conf.cgi?action=cgi_contacts'})"[% END %] size=40>
      </td>
    </tr>
    <tr>
      <td colspan=2 class="data dataSubmit">
        <input type="button" name="cancel" value="cancel" style="width:60px" onclick="window.location='conf.cgi'">
        <input type="submit" name="send" value="show" style="width:80px">
      </td>
    </tr>
  </table>
</form>

<br><br>

[% IF show_user %]
<form action="conf.cgi" method="POST">
<input type="submit" name="send" value="save" style="display:none">
<input type="hidden" name="sub" value="users">
<input type="hidden" name="action" value="store">
<input type="hidden" name="md5" value="[% md5 %]">
<input type="hidden" name="data.username" value="[% user_name %]">
  <table border="0" class='data conftoolusers'>
    <tr>
      <td colspan=2 class='dataVar dataUserVar'>[% user_name %]</td>
    </tr>
    <tr>
      <td class='dataVar' align="left">Contact Exists</td>
      <td class='dataVal'>
        [% IF has_contact %]Yes[% ELSE %]No[% END %]
        [% IF backends_with_obj_config.keys.size > 0 %]
          [% IF has_contact %]
            - <a href="conf.cgi?sub=objects&amp;type=contact&amp;data.name=[% user_name %]">edit</a>
          [% ELSE %]
            - <a href="conf.cgi?sub=objects&amp;action=new&amp;type=contact&amp;obj.contact_name=[% user_name %]">create</a>
          [% END %]
        [% END %]
      </td>
    </tr>
    [% IF conf_config.exists('htpasswd') %]
    <tr>
      <td class='dataVar' align="left">Password Set</td>
      <td class='dataVal'>[% IF has_htpasswd_entry %]Yes <input type="submit" name="send" value="remove password">[% ELSE %]No[% END %]</td>
    </tr>
    <tr>
      <td class='dataVar' align="left">Password</td>
      <td class='dataVal'><input type="password" name="data.password" value="" size=15></td>
    </tr>
    <tr>
      <td class='dataVar' align="left">Verify Password</td>
      <td class='dataVal'><input type="password" name="data.password2" value="" size=15></td>
    </tr>
    [% END %]
    [% IF conf_config.exists('cgi.cfg') %]
    [% FOR auth = role_keys %]
    <tr>
      <td class='dataVar' align="left">[% auth %]</td>
      <td class='dataVal'>
        <input type="radio" name="data.[% auth %]" value="0"[% IF roles.$auth == 0 %] checked[% END %]> No
        <input type="radio" name="data.[% auth %]" value="1"[% IF roles.$auth == 1 %] checked[% END %]> Yes
      </td>
    </tr>
    [% END %]
    [% END %]
    <tr>
      <td colspan=2 class="data dataSubmit">
        <input type="button" name="cancel" value="cancel" style="width:60px" onclick="window.location='conf.cgi?sub=users'">
        <input type="submit" name="send" value="save" style="width:80px"[% IF readonly %] disabled[% END %]>
      </td>
    </tr>
  </table>
</form>
[% END %]

</div>

[% END %]
