phpMyFAQ PHP Cross Reference Customer Relationship Management

Source: /admin/stat.show.php - 89 lines - 2703 bytes - Summary - Text - Print

Description: Show the session

   1  <?php
   2  /**
   3   * Show the session
   4   *
   5   * PHP Version 5.3
   6   *
   7   * This Source Code Form is subject to the terms of the Mozilla Public License,
   8   * v. 2.0. If a copy of the MPL was not distributed with this file, You can
   9   * obtain one at http://mozilla.org/MPL/2.0/.
  10   *
  11   * @category  phpMyFAQ
  12   * @package   Administration
  13   * @author    Thorsten Rinne <thorsten@phpmyfaq.de>
  14   * @copyright 2003-2014 phpMyFAQ Team
  15   * @license   http://www.mozilla.org/MPL/2.0/ Mozilla Public License Version 2.0
  16   * @link      http://www.phpmyfaq.de
  17   * @since     2003-02-24
  18   */
  19  
  20  if (!defined('IS_VALID_PHPMYFAQ')) {
  21      $protocol = 'http';
  22      if (isset($_SERVER['HTTPS']) && strtoupper($_SERVER['HTTPS']) === 'ON'){
  23          $protocol = 'https';
  24      }
  25      header('Location: ' . $protocol . '://' . $_SERVER['HTTP_HOST'] . dirname($_SERVER['SCRIPT_NAME']));
  26      exit();
  27  }
  28  
  29  if ($permission['viewlog']) {
  30  
  31      $sid = PMF_Filter::filterInput(INPUT_GET, 'id', FILTER_VALIDATE_INT);
  32  
  33      printf('<header><h2><i class="icon-tasks"></i> %s "<span style="color: Red;">%d</span>"</h2></header>',
  34          $PMF_LANG['ad_sess_session'],
  35          $sid);
  36  
  37      $session = new PMF_Session($faqConfig);
  38      $time    = $session->getTimeFromSessionId($sid);
  39  
  40      $trackingdata = explode("\n", file_get_contents(PMF_ROOT_DIR.'/data/tracking'.date('dmY', $time)));
  41  ?>
  42          <table class="table table-striped">
  43          <tfoot>
  44              <tr>
  45                  <td colspan="2"><a href="?action=viewsessions"><?php echo $PMF_LANG["ad_sess_back"]; ?></a></td>
  46              </tr>
  47          </tfoot>
  48          <tbody>
  49  <?php
  50          $num = 0;
  51          foreach ($trackingdata as $line) {
  52              $data = explode(';', $line);
  53              if ($data[0] == $sid) {
  54                  $num++;
  55  ?>
  56              <tr>
  57                  <td><?php echo date("Y-m-d H:i:s", $data[7]); ?></td>
  58                  <td><?php echo $data[1]; ?> (<?php echo $data[2]; ?>)</td>
  59              </tr>
  60  <?php
  61                  if ($num == 1) {
  62  ?>
  63              <tr>
  64                  <td><?php echo $PMF_LANG["ad_sess_referer"]; ?></td>
  65                  <td>
  66                      <a href="<?php echo $data[5]; ?>" target="_blank">
  67                          <?php echo str_replace("?", "? ", $data[5]); ?>
  68                      </a>
  69                  </td>
  70              </tr>
  71              <tr>
  72                  <td><?php echo $PMF_LANG["ad_sess_browser"]; ?></td>
  73                  <td><?php echo $data[6]; ?></td>
  74              </tr>
  75              <tr>
  76                  <td><?php echo $PMF_LANG["ad_sess_ip"]; ?>:</td>
  77                  <td><?php echo $data[3]; ?></td>
  78              </tr>
  79  <?php
  80                  }
  81              }
  82          }
  83  ?>
  84          </tbody>
  85          </table>
  86  <?php
  87  } else {
  88      echo $PMF_LANG['err_NotAuth'];
  89  }

title

Description

title

Description

title

Description

title

title

Body