<?php
session_start();
ob_start();
?>
<?php
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // Always modified
header("Cache-Control: private, no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache"); // HTTP/1.0
?>
<?php
if (@phpversion() >= '5.0.0' && (!@ini_get('register_long_arrays') || @ini_get('register_long_arrays') == '0' || strtolower(@ini_get('register_long_arrays')) == 'off')) { // PHP5 with register_long_arrays off
$HTTP_POST_VARS = &$_POST;
$HTTP_GET_VARS = &$_GET;
$HTTP_SERVER_VARS = &$_SERVER;
$HTTP_COOKIE_VARS = &$_COOKIE;
$HTTP_ENV_VARS = &$_ENV;
$HTTP_POST_FILES = &$_FILES;
if (isset($_SESSION)) $HTTP_SESSION_VARS = &$_SESSION;
}
?>
<?php include ("ewconfig.php") ?>
<?php include ("db.php") ?>
<?php include ("autorsinfo.php") ?>
<?php include ("advsecu.php") ?>
<?php include ("phpmkrfn.php") ?>
<?php
if (!IsLoggedIn() && (@$HTTP_COOKIE_VARS[ewCookieAutoLogin] == "autologin" && @$HTTP_COOKIE_VARS[ewCookiePassword] <> "")) {
ob_end_clean();
header("Location: login.php");
exit();
}
LoadUserLevel();
$ewCurSec = (IsLoggedIn())? CurrentUserLevelPriv("autors") : GetAnonymousPriv("autors");
if (($ewCurSec & ewAllowList) <> ewAllowList) {
ob_end_clean();
header("Location: autorslist.php");
exit();
}
?>
<?php
// Get key
$x_id_autore = @$HTTP_GET_VARS["id_autore"];
if (!is_numeric($x_id_autore)) {
ob_end_clean();
header("Location: autorslist.php");
exit();
}
if (($x_id_autore == "") || ($x_id_autore == NULL)) {
ob_end_clean();
header("Location: autorslist.php");
exit();
}
$x_id_autore = (get_magic_quotes_gpc()) ? stripslashes($x_id_autore) : $x_id_autore;
$conn = phpmkr_db_connect(HOST, USER, PASS, DB, PORT);
$sFilter = ewSqlKeyWhere;
$sFilter = str_replace("@id_autore", AdjustSql($x_id_autore), $sFilter);
$sSql = ewBuildSql(ewSqlSelect, ewSqlWhere, ewSqlGroupBy, ewSqlHaving, ewSqlOrderBy, $sFilter, "");
$rs = phpmkr_query($sSql,$conn) or die("Failed to execute query at line " . __LINE__ . ": " . phpmkr_error($conn) . '<br>SQL: ' . $sSql);
if (phpmkr_num_rows($rs) > 0) {
$row = phpmkr_fetch_array($rs);
if ($row["articolo"]<> "") {
header("Content-Disposition: attachment; filename=" . $row["articolo"]);
}
ob_clean();
echo $row["articolo"];
}
phpmkr_free_result($rs);
phpmkr_db_close($conn);
?>