Viewing File: /usr/local/cpanel/base/frontend/jupiter/mail/showlog.html.tt
[%
USE CPDate;
SET CPANEL.CPVAR.dprefix = "../";
SET is_webmail = ExpVar.expand('$appname') == "webmail" ? 1 : 0;
IF is_webmail && !FORM.item('account');
SET FORM.account = CPANEL.authuser;
END;
SET logdate = RAW_FORM.logdate;
IF !logdate.defined || logdate == '' || !logdate.search('^\d+$');
SET logdate = CPANEL.now();
END;
IF CPANEL.CPDATA.item('DEMO');
SET boxtrapper_showlog = locale.maketext("This feature is disabled in demo mode.");
ELSE;
SET boxtrapper_showlog = execute("BoxTrapper", "get_log", {
email => RAW_FORM.account,
date => logdate,
});
END;
%]
[% WRAPPER '_assets/master.html.tt'
app_key = 'boxtrapper'
page_stylesheets = ['mail/boxtrapper.css']
%]
<div class="body-content">
[% IF (is_webmail && !( FORM.account == CPANEL.authuser)) %]
<div class="alert alert-danger" id="logError">
<span class="glyphicon glyphicon-remove-sign" id="logErrorImg"></span>
<div class="alert-message" id="logErrorMsg">
[% locale.maketext("You are not allowed to view logs for the user “[output,strong,_1]”.", FORM.account) %]
</div>
</div>
[% ELSE %]
<div class="section">
<h2 id="acctLog">
[% locale.maketext("[asis,BoxTrapper] Log for “[output,strong,_1]”", FORM.account) %]
</h2>
[% IF !boxtrapper_showlog.status %]
[% FOREACH error IN boxtrapper_showlog.errors %]
<div class="alert alert-danger" role="alert">
<span class='glyphicon glyphicon-remove-sign' aria-hidden="true"></span>
<div class='alert-message'>
<strong class="alert-title">
[% locale.maketext('Error:') %]
</strong>
<span class="alert-body">
<span id="error-[% loop.index() %]">
[% error.html() %]
</span>
</span>
</div>
</div>
[% END %]
[% ELSE %]
[%
SET script_url = 'showlog.html';
SET current_day = logdate;
SET previous_day = current_day - 86400;
SET next_day = current_day + 86400;
%]
<table id="tblBoxTrapperLogs" class="table">
<tr>
<td class="previous-date">
[% IF previous_day >= 0 %]
<form action="[% script_url %]" method="post">
<input type="hidden" name="bxaction" value="" />
<input type="hidden" name="account" value="[% FORM.account %]" />
<input type="hidden" name="logdate" value="[% previous_day %]" />
<button id="previous-date" type="submit" class="btn btn-link pull-left">
<< [% locale.local_datetime(previous_day) %]
</button>
</form>
[% ELSE %]
N/A
[% END %]
</td>
<td class="current-date">
[% IF current_day >= 0 %]
<span id="current-date">[% locale.local_datetime(current_day) %]</span>
[% ELSE %]
N/A
[% END %]
</td>
<td class="next-date">
[% IF next_day >= 0 %]
<form action="[% script_url %]" method="post">
<input type="hidden" name="bxaction" value="" />
<input type="hidden" name="account" value="[% FORM.account %]" />
<input type="hidden" name="logdate" value="[% next_day %]" />
<button id="next-date" type="submit" class="btn btn-link pull-right">
[% locale.local_datetime(next_day) %] >>
</button>
</form>
[% ELSE %]
N/A
[% END %]
</td>
</tr>
<tr>
<td colspan="3">
<textarea readonly="readonly"
class="form-control"
rows="20"
id="txtLog">
[%- IF boxtrapper_showlog.data.lines.size() == 0 -%]
[%- locale.maketext("No log data exists for this date.") -%]
[%- ELSE -%]
[%- boxtrapper_showlog.data.lines.join("\n") -%]
[%- END -%]
</textarea>
</td>
</tr>
</table>
[% END %]
</div>
[% END %]
[% INCLUDE _assets/return_link.html.tt return_location='manage.html' post='1' formdata=FORM return_link_text=locale.maketext('Go Back') %]
</div>
[% END %]
Back to Directory
File Manager