// definicia dB define("DATABASE_NAME","kovmat"); define("DATABASE_USER","ummsoldo"); define("DATABASE_PASSWORD","kovmat157"); define("DATABASE_HOST",""); require('./db_mysql.php'); $db = new DB_Sql(); $db->Database = DATABASE_NAME; $db->User = DATABASE_USER; $db->Password = DATABASE_PASSWORD; $db->Host = DATABASE_HOST; // koniec definicie switch ( $_SERVER["REMOTE_ADDR"] ) { // case "147.213.226.29": // break; default: $passwd = $_SERVER["PHP_AUTH_PW"]; $login = $_SERVER["PHP_AUTH_USER"]; $logint = "-"; if(IsSet($_SERVER["PHP_AUTH_USER"])) { if(($login=="KMoldo") && ($passwd=="")) $logint="o"; $where = "where login='". $login ."'"; $db->query("select * from users ".$where); $db->next_record(); $user_login = $db->f(login); $user_passwd = $db->f(password); if ( StrLen($user_login) > 1 ) { if(($login == $user_login) && ($passwd == $user_passwd)) $logint="o"; } } // IsSet if ($logint=="-") { $logint="o"; $login ="free_user"; // jen free users 10.05.2017 } // login = "-" } // end case ["REMOTE_ADDR"] ?> if ($logint=="o") { $rr = $_GET["rr"]; $cc = $_GET["cc"]; $ss = $_GET["ss"]; // Odstranenie SQL Injection settype($rr, 'integer'); settype($cc, 'integer'); settype($ss, 'integer'); if ($rr == "" or $cc == "" or $ss == 0) {die;} // podmienka $where = "where rocnik=".$rr." and cislo=".$cc." and strana=".$ss; $db->query("select * from clanky ".$where); $db->next_record(); List($aut1, $tmp) = Explode(",", $db->f(autor)); $article = $rr ."_". $cc ."_". $aut1 .".pdf"; // PDF-ak !!! $farticle = "./full/". $article; if ( ! File_Exists ($farticle) ) // +$ss { $article = $rr ."_". $cc ."_". $aut1 ."_". $ss .".pdf"; // PDF-ak !!! $farticle = "./full/". $article; } if ( File_Exists ($farticle) ) // velkost pdf-clanku { $size = FileSize ( $farticle ); } if ($size > 0) { header("Expires: 0"); // We'll be outputting a PDF header('Content-type: application/pdf'); // header("Content-Length: $size"); // It will be called downloaded.pdf header("Content-Disposition: attachment; filename=$article;"); // header("Content-Disposition: inline; filename=$article"); // header("Author: (c) OldSoft - 2004"); /* ?>