<div class="row spacer clear">
    <div class="description group">User Information</div>
    <label for="user_add_input" class="name">Username</label>
    <div class="value">
        <%if user.username%><b><%user.username%></b>
        <input type="hidden" name="u" value="<%user.username%>" />
        <%else%>
        <input type="text" id="user_add_input" name="mod_username" value="<%if in.mod_username%><%in.mod_username%><%endif%>" class="text" onkeyup="document.getElementById('root_name').value = this.value" /> *
        <%endif%>
    </div>
</div>
<div class="row spacer clear">
    <label for="mod_password" class="name">Password</label>
    <div class="value"><input type="password" id="mod_password" name="mod_password" value="<%if in.mod_password%><%in.mod_password%><%endif%>" class="text" /><%ifnot user.username%> *<%endif%></div>
</div>
<div class="row spacer clear">
    <label for="mod_type" class="name">Type</label>
    <div class="value">
        <select id="mod_type" name="mod_type"<%if session.user.username eq $user.username%> disabled="disabled"<%endif%>>
            <option value="0"<%ifnot in.mod_type%> selected="selected"<%elsif user.type ne '1'%> selected="selected"<%endif%>>User</option>
            <option value="1"<%if in.mod_type%> selected="selected"<%elsif user.type eq '1'%> selected="selected"<%endif%>>Administrator</option>
        </select>
    </div>
</div>
<div class="row spacer clear">
    <label for="mod_email" class="name">E-mail</label>
    <div class="value"><input type="text" id="mod_email" name="mod_email" value="<%if in.mod_email%><%in.mod_email%><%elsif user.email%><%user.email%><%endif%>" class="text longtext" /> *</div>
</div>
<div class="row spacer clear">
    <label for="mod_name" class="name">Name</label>
    <div class="value"><input type="text" id="mod_name" name="mod_name" value="<%if in.name%><%in.name%><%elsif user.name%><%user.name%><%endif%>" class="text longtext" /></div>
</div>
<div id="user_section"<%if user.type or in.mod_type%> class="hide"<%endif%>>
    <div class="row spacer clear">
        <label for="mod_allowed_space" class="name">Allowed Space</label>
        <div class="value">
            <input type="text" id="mod_allowed_space" name="mod_allowed_space" value="<%if in.mod_allowed_space%><%in.mod_allowed_space%><%elsif user.allowed_space%><%user.allowed_space%><%else%><%cfg.default.allowed_space%><%endif%>" maxlength="10" class="text" /> KB<br />
            <span class="note">Enter "0" to not create a limit.</span>
        </div>
    </div>
    <%ifnot user.username%>
    <div class="row spacer clear">
        <label for="root_name" class="name">Directory Name</label>
        <div class="value">
            <input type="text" id="root_name" name="root_name" value="<%if in.root_name%><%in.root_name%><%endif%>" class="text" /><br />
            <input type="checkbox" id="create_userdir" name="create_userdir" value="1"<%if in.create_userdir%> checked="checked"<%endif%> /><label for="create_userdir">Create User Directory</label>
        </div>
    </div>
    <%endif%>
    <div class="row clear spacer">
        <div class="description group">Define command permissions and access directories</div>
        <label class="name">Permissions</label>
        <div class="value">
            <table>
                <tr>
                    <td>
                        <input type="checkbox" id="search" name="perm_search" value="1"<%if user.username%><%if user.permission.search%> checked="checked"<%endif%><%elsif cfg.default.permission.search%> checked="checked"<%endif%> class="checkbox" /><label for="search">Search</label><br />
                        <input type="checkbox" id="replace" name="perm_replace" value="1"<%if user.username%><%if user.permission.replace%> checked="checked"<%endif%><%elsif cfg.default.permission.replace%> checked="checked"<%endif%> class="checkbox" /><label for="replace">Replace</label><br />
                        <input type="checkbox" id="command" name="perm_command" value="1"<%if user.username%><%if user.permission.command%> checked="checked"<%endif%><%elsif cfg.default.permission.command%> checked="checked"<%endif%> class="checkbox" /><label for="command">Command</label><br />
                        <input type="checkbox" id="upload" name="perm_upload" value="1"<%if user.username%><%if user.permission.upload%> checked="checked"<%endif%><%elsif cfg.default.permission.upload%> checked="checked"<%endif%> class="checkbox" /><label for="upload">Upload</label>
                    </td>
                    <td>
                        <input type="checkbox" id="newfile" name="perm_newfile" value="1"<%if user.username%><%if user.permission.newfile%> checked="checked"<%endif%><%elsif cfg.default.permission.newfile%> checked="checked"<%endif%> class="checkbox" /><label for="newfile">New File</label><br />
                        <input type="checkbox" id="makedir" name="perm_makedir" value="1"<%if user.username%><%if user.permission.makedir%> checked="checked"<%endif%><%elsif cfg.default.permission.makedir%> checked="checked"<%endif%> class="checkbox" /><label for="makedir">New Folder</label><br />
                        <input type="checkbox" id="protect" name="perm_protect" value="1"<%if user.username%><%if user.permission.protect%> checked="checked"<%endif%><%elsif cfg.default.permission.protect%> checked="checked"<%endif%> class="checkbox" /><label for="protect">Protect</label><br />
                        <input type="checkbox" id="preferences" name="perm_preferences" value="1"<%if user.username%><%if user.permission.preferences%> checked="checked"<%endif%><%elsif cfg.default.permission.preferences%> checked="checked"<%endif%> class="checkbox" /><label for="preferences">Preferences</label>
                    </td>
                    <td>
                        <input type="checkbox" id="edit" name="perm_edit" value="1"<%if user.username%><%if user.permission.edit%> checked="checked"<%endif%><%elsif cfg.default.permission.edit%> checked="checked"<%endif%> class="checkbox" /><label for="edit">Edit File</label><br />
                        <input type="checkbox" id="download" name="perm_download" value="1"<%if user.username%><%if user.permission.download%> checked="checked"<%endif%><%elsif cfg.default.permission.download%> checked="checked"<%endif%> class="checkbox" /><label for="download">Download</label><br />
                        <input type="checkbox" id="symlink" name="perm_symlink" value="1"<%if user.username%><%if user.permission.symlink%> checked="checked"<%endif%><%elsif cfg.default.permission.symlink%> checked="checked"<%endif%> class="checkbox" /><label for="symlink">Symlink</label><br />
                        <input type="checkbox" id="copy" name="perm_copy" value="1"<%if user.username%><%if user.permission.copy%> checked="checked"<%endif%><%elsif cfg.default.permission.copy%> checked="checked"<%endif%> class="checkbox" /><label for="copy">Copy</label>
                    </td>
                    <td>
                        <input type="checkbox" id="move" name="perm_move" value="1"<%if user.username%><%if user.permission.move%> checked="checked"<%endif%><%elsif cfg.default.permission.move%> checked="checked"<%endif%> class="checkbox" /><label for="move">Move</label><br />
                        <input type="checkbox" id="rename" name="perm_rename" value="1"<%if user.username%><%if user.permission.rename%> checked="checked"<%endif%><%elsif cfg.default.permission.rename%> checked="checked"<%endif%> class="checkbox" /><label for="rename">Rename</label><br />
                        <input type="checkbox" id="delete" name="perm_delete" value="1"<%if user.username%><%if user.permission.delete%> checked="checked"<%endif%><%elsif cfg.default.permission.delete%> checked="checked"<%endif%> class="checkbox" /><label for="delete">Delete</label><br />
                        <input type="checkbox" id="compress" name="perm_compress" value="1"<%if user.username%><%if user.permission.compress%> checked="checked"<%endif%><%elsif cfg.default.permission.compress%> checked="checked"<%endif%> class="checkbox" /><label for="compress">Compress</label>
                    </td>
                    <td>
                        <input type="checkbox" id="chmod" name="perm_chmod" value="1"<%if user.username%><%if user.permission.chmod%> checked="checked"<%endif%><%elsif cfg.default.permission.chmod%> checked="checked"<%endif%> class="checkbox" /><label for="chmod">Chmod</label><br />
                        <input type="checkbox" id="tail" name="perm_tail" value="1"<%if user.username%><%if user.permission.tail%> checked="checked"<%endif%><%elsif cfg.default.permission.tail%> checked="checked"<%endif%> class="checkbox" /><label for="tail">Tail</label><br />
                        <input type="checkbox" id="perl" name="perm_perl" value="1"<%if user.username%><%if user.permission.perl%> checked="checked"<%endif%><%elsif cfg.default.permission.perl%> checked="checked"<%endif%> class="checkbox" /><label for="perl">Perl</label><br />
                        <input type="checkbox" id="diff" name="perm_diff" value="1"<%if user.username%><%if user.permission.diff%> checked="checked"<%endif%><%elsif cfg.default.permission.diff%> checked="checked"<%endif%> class="checkbox" /><label for="diff">Diff</label><br />
                    </td>
                </tr>
            </table>
        </div>
    </div>
    <div class="row clear">
        <label class="name">Access Directories</label>
        <div class="value">
            <input type="button" name="button-browse" value="Browse..." class="button" /><br />
            <textarea id="access_directories" name="access_directories" class="user-access" readonly>
                <%~if in.access_directories%>
                <%~in.access_directories%>
                <%~elsif user.accesses_loop.length%>
                <%~loop user.accesses_loop%>
<%disp%>
                <%~endloop%>
                <%~endif~%>
            </textarea>
        </div>
    </div>
</div>
