Minor - Remove unused function

pull/2715/head
Julio 7 years ago
parent f4292bcc6f
commit 205637b2d1
  1. 3
      index.php
  2. 39
      main/inc/lib/events.lib.php

@ -98,9 +98,6 @@ if (!empty($_POST['submitAuth'])) {
}
}
}
} else {
// Only if login form was not sent because if the form is sent the user was already on the page.
Event::open();
}
if (!api_is_anonymous()) {

@ -13,45 +13,6 @@ use ChamiloSession as Session;
*/
class Event
{
/**
* @author Sebastien Piraux <piraux_seb@hotmail.com>
* @desc Record information for open event (when homepage is opened)
*/
public static function open()
{
global $_configuration;
global $TABLETRACK_OPEN;
// @getHostByAddr($_SERVER['REMOTE_ADDR']) : will provide host and country information
// $_SERVER['HTTP_USER_AGENT'] : will provide browser and os information
// $_SERVER['HTTP_REFERER'] : provide information about refering url
if (isset($_SERVER['HTT_REFERER'])) {
$referer = Database::escape_string($_SERVER['HTTP_REFERER']);
} else {
$referer = '';
}
// record informations only if user comes from another site
//if(!eregi($_configuration['root_web'],$referer))
$pos = strpos($referer, $_configuration['root_web']);
if ($pos === false && $referer != '') {
$ip = api_get_real_ip();
$remhost = @gethostbyaddr($ip);
if ($remhost == $ip) {
$remhost = "Unknown";
} // don't change this
$reallyNow = api_get_utc_datetime();
$params = [
'open_remote_host' => Database::escape_string($remhost),
'open_agent' => $_SERVER['HTTP_USER_AGENT'],
'open_referer' => $referer,
'open_date' => $reallyNow,
];
Database::insert($TABLETRACK_OPEN, $params);
}
return 1;
}
/**
* @author Sebastien Piraux <piraux_seb@hotmail.com> old code
* @author Julio Montoya

Loading…
Cancel
Save