Beispiel #1
0
<?php

header('Content-type: application/json');
require dirname(__FILE__) . '/../classes/headstart/personalization/DBConnectionPersonalization.php';
require_once dirname(__FILE__) . '/../classes/headstart/library/CommUtils.php';
require_once dirname(__FILE__) . '/../classes/headstart/library/toolkit.php';
use headstart\library;
$INI_DIR = dirname(__FILE__) . "/../preprocessing/conf/";
$ini_array = library\Toolkit::loadIni($INI_DIR);
$user_id = library\CommUtils::getParameter($_GET, "user_id");
$conference_id = library\CommUtils::getParameter($_GET, "content_id");
$connection = new headstart\personalization\DBConnectionPersonalization($ini_array);
$connection->establishConnection();
$bookmarking_data = $connection->removePersonalBookmark($user_id, $conference_id);
$jsonData = json_encode($bookmarking_data);
library\CommUtils::echoOrCallback($jsonData, $_GET);
<?php

header('Content-type: application/json');
require_once dirname(__FILE__) . '/../classes/headstart/evaluation/logger/FileLogger.php';
require_once dirname(__FILE__) . '/../classes/headstart/library/CommUtils.php';
use headstart\evaluation\logger;
use headstart\library;
$user_id = library\CommUtils::getParameter($_GET, "user");
$serverData = array("addr" => $_SERVER['REMOTE_ADDR'], "user_agent" => $_SERVER['HTTP_USER_AGENT'], "user_id" => $user_id);
$logData = array_merge($serverData, $_GET);
if ($_POST != null) {
    $logData = array_merge($logData, $_POST);
}
$logger = new logger\FileLogger(dirname(__FILE__) . '/../../log/', null);
$logger->writeToLog($logData);
$jsonData = json_encode($logData);
library\CommUtils::echoOrCallback($jsonData, $_GET["jsoncallback"]);