| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- <?php
- if(file_exists('config'.DIRECTORY_SEPARATOR.'config.php')){
- $pageSettingsSettingsLogs = '
- <script>
- $(document).on("click", ".swapLog", function(e) {
- var log = $(this).attr(\'data-name\')+\'Div\';
- $(\'.logTable\').addClass(\'hidden\');
- $(\'.\'+log).addClass(\'show\').removeClass(\'hidden\');
- $(\'.swapLog\').removeClass(\'active\');
- $(this).addClass(\'active\');
- });
- </script>
- <div class="btn-group m-b-20 pull-left">
- <button type="button" class="btn btn-default btn-outline waves-effect bg-org swapLog active" data-name="loginLog" data-path="'.$GLOBALS['organizrLoginLog'].'" lang="en">Login Log</button>
- <button type="button" class="btn btn-default btn-outline waves-effect bg-org swapLog" data-name="orgLog" data-path="'.$GLOBALS['organizrLog'].'" lang="en">Organizr Log</button>
- </div>
- <button class="btn btn-danger btn-sm waves-effect waves-light pull-right purgeLog" type="button"><span class="btn-label"><i class="fa fa-trash"></i></span>Purge Log</button>
- <div class="clearfix"></div>
- <div class="white-box bg-org logTable loginLogDiv">
- <h3 class="box-title m-b-0" lang="en">Login Logs</h3>
- <div class="table-responsive">
- <table id="loginLogTable" class="table table-striped">
- <thead>
- <tr>
- <th lang="en">Date</th>
- <th lang="en">Username</th>
- <th lang="en">IP Address</th>
- <th lang="en">Type</th>
- </tr>
- </thead>
- <tfoot>
- <tr>
- <th lang="en">Date</th>
- <th lang="en">Username</th>
- <th lang="en">IP Address</th>
- <th lang="en">Type</th>
- </tr>
- </tfoot>
- <tbody></tbody>
- </table>
- </div>
- </div>
- <div class="white-box bg-org logTable orgLogDiv hidden">
- <h3 class="box-title m-b-0" lang="en">Organizr Logs</h3>
- <div class="table-responsive">
- <table id="organizrLogTable" class="table table-striped">
- <thead>
- <tr>
- <th lang="en">Date</th>
- <th lang="en">Username</th>
- <th lang="en">IP Address</th>
- <th lang="en">Message</th>
- <th lang="en">Type</th>
- </tr>
- </thead>
- <tfoot>
- <tr>
- <th lang="en">Date</th>
- <th lang="en">Username</th>
- <th lang="en">IP Address</th>
- <th lang="en">Message</th>
- <th lang="en">Type</th>
- </tr>
- </tfoot>
- <tbody></tbody>
- </table>
- </div>
- </div>
- <!-- /.container-fluid -->
- <script>
- //$.fn.dataTable.moment(\'DD-MMM-Y HH:mm:ss\');
- $("#loginLogTable").DataTable( {
- "ajax": "api/?v1/login_log",
- "columns": [
- { data: \'utc_date\',
- render: function ( data, type, row ) {
- if ( type === \'display\' || type === \'filter\' ) {
- var m = moment.tz(data, activeInfo.timezone);
- return moment(m).format(\'LLL\');
- }
- return data;
- }
- },
- { "data": "username" },
- { "data": "ip" },
- { data: \'auth_type\',
- render: function ( data, type, row ) {
- if ( type === \'display\' || type === \'filter\' ) {
- return logIcon(data);
- }
- return logIcon(data);
- }
- }
- ],
- "order": [[ 0, \'desc\' ]],
- } );
- $("#organizrLogTable").DataTable( {
- "ajax": "api/?v1/organizr_log",
- "columns": [
- { data: \'utc_date\',
- render: function ( data, type, row ) {
- // If display or filter data is requested, format the date
- if ( type === \'display\' || type === \'filter\' ) {
- var m = moment.tz(data, activeInfo.timezone);
- return moment(m).format(\'LLL\');
- }
- // Otherwise the data type requested (`type`) is type detection or
- // sorting data, for which we want to use the integer, so just return
- // that, unaltered
- return data;}
- },
- { "data": "username" },
- { "data": "ip" },
- { "data": "message" },
- { data: \'type\',
- render: function ( data, type, row ) {
- if ( type === \'display\' || type === \'filter\' ) {
- return logIcon(data);
- }
- return logIcon(data);
- }
- }
- ],
- "order": [[ 0, \'desc\' ]],
- } );
- </script>
- ';
- }
|