% layout 'AdminLTE', title => "Sme server 2 - emailaccess";

% content_for 'module' => begin

<div class="card-body">

    % if (config->{debug} == 1) {
    <div>
        %= dumper $c->current_route
        %= dumper $mai_datas
    </div>
    % }
    
    % if ( stash 'error' ) {
        <br>
        <div class="">
            <%= $c->render_to_string(inline => stash 'error') %>
        </div>
    % }

    <h1><%= $title%></h1>

    <form action="/smanager/emailsettingd" method="POST">
    %#= form_for '/emailsettingd' => (method => 'POST') => begin

        <%= l 'mai_DESC_POP_ACCESS_CONTROL' %>
    
        <div>
            <%=l 'mai_LABEL_POP_ACCESS_CONTROL' %>
        </div>
        
        <div>
            % param 'POPAccess' => $c->get_current_pop3_access() unless param 'POPAccess';
            <%= select_field 'POPAccess' => $c->get_pop_opt() %>
        </div>
    
        <div>
            <%=l 'mai_DESC_IMAP_ACCESS_CONTROL' %>
        </div>
        
        <div>
            <%=l 'mai_LABEL_IMAP_ACCESS_CONTROL' %>
        </div>
        
        <div>
            % param 'IMAPAccess' => $c->get_current_imap_access() unless param 'IMAPAccess';
            <%= select_field 'IMAPAccess' => $c->get_imap_opt() %>
        </div>
    
        <div>
            <%= l 'mai_DESC_WEBMAIL' %>
        <div>
    
        <div>
            <%=l 'mai_LABEL_WEBMAIL' %>
        </div>
    
        <div>
            % param 'WebMail' => $c->get_current_webmail_status() unless param 'WebMail';
            <%= select_field 'WebMail' => $c->get_webmail_opt() %>
        </div>
    
        % my $btn = l('SAVE');
    
            <div class="row g-3 align-items-center">
                <div class="col-md-2">
                    <button type="submit" class="btn btn-primary"><%= $btn %></button>
                </div>
            </div>
        %= hidden_field 'trt' => 'ACC'

    %# end    
    </form>
    
</div>
%end
