2020-08-14 13:36:36 +02:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
|
|
|
<!-- <link rel="stylesheet" type="text/css" href="upload.css">-->
|
|
|
|
|
|
|
|
|
|
|
|
<?php
|
2021-02-11 09:52:23 +01:00
|
|
|
|
|
|
|
|
2021-03-09 14:13:34 +01:00
|
|
|
include_once('../../../function.php');
|
2021-02-11 09:52:23 +01:00
|
|
|
|
|
|
|
// Ce imamo v GET-u lang naložimo jezikovno datoteko
|
|
|
|
if(isset($_GET['lang'])){
|
|
|
|
$language = ($_GET['lang'] == 'en') ? '2' : '1';
|
|
|
|
$file = '../../../lang/'.$language.'.php';
|
|
|
|
include($file);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-08-14 13:36:36 +02:00
|
|
|
//Prikaže možnost za IMAGE UPLOAD
|
|
|
|
if (!isset ($_POST['posted']) && (isset ($_GET['image']) && $_GET['image'] == 1)) {
|
2021-02-11 09:52:23 +01:00
|
|
|
|
2020-08-14 13:36:36 +02:00
|
|
|
if (isset($_GET['error']) && $_GET['error'] == 1)
|
|
|
|
echo "<strong style='font-family: Arial; font-size: 12px; color: red; font-weight: bold;'>" . $lang['upload_img_exe'] . "</strong>";
|
|
|
|
?>
|
|
|
|
<body style="margin-top: 0px; top: 0px; margin-left: 0px; left: 0px; padding-top: 0px;">
|
|
|
|
<form name="uploader" method="post" enctype="multipart/form-data"
|
2021-03-09 14:13:34 +01:00
|
|
|
action="<?= $site_url ?>editors/ckeditor_4_4/uploader/EnkaUploader.php" style="height: 15px;">
|
2020-08-14 13:36:36 +02:00
|
|
|
<input type="hidden" name="posted" value="1"/>
|
|
|
|
<input type="hidden" name="urlsrc" value="<?= $_GET['url'] ?>"/>
|
|
|
|
<input type="hidden" name="type" value="image"/>
|
|
|
|
<!-- Podatki o sliki, ki jo nalagamo -->
|
|
|
|
<!-- <input type="hidden" value="eitorSlika" name="-->
|
|
|
|
<?php //echo ini_get("session.upload_progress.name"); ?><!--">-->
|
|
|
|
<strong style="font-family: Arial; font-size: 12px; font-weight: bold;"><?= $lang['upload_img'] ?></strong><input
|
|
|
|
type="file" name="eitorSlika" onChange="submit();"/>
|
|
|
|
</form>
|
|
|
|
<!-- <script type="text/javascript" src="upload.js"></script>-->
|
|
|
|
<?php
|
|
|
|
}elseif (!isset ($_POST['posted']) && (!isset ($_GET['image']) || $_GET['image'] != "1")) {
|
|
|
|
?>
|
|
|
|
<body style="margin-top: 0px; top: 0px; margin-left: 0px; left: 0px; padding-top: 0px;">
|
|
|
|
<form name="uploader" method="post" enctype="multipart/form-data"
|
2021-03-09 14:13:34 +01:00
|
|
|
action="<?= $site_url ?>editors/ckeditor_4_4/uploader/EnkaUploader.php" style="height: 15px;">
|
2020-08-14 13:36:36 +02:00
|
|
|
<input type="hidden" name="posted" value="1"/>
|
|
|
|
<input type="hidden" name="urlsrc" value="<?= $_GET['url'] ?>"/>
|
|
|
|
<input type="hidden" name="type" value="file"/>
|
|
|
|
<strong style="font-family: Arial; font-size: 12px; font-weight: bold;"><?= $lang['upload_select_file'] ?></strong>
|
|
|
|
<br/>
|
|
|
|
<input type="file" name="editorDatoteka" style="width: 100%;" onChange="submit();"/>
|
|
|
|
</form>
|
|
|
|
<?php
|
|
|
|
}elseif ($_POST['type'] == "file") {
|
2021-02-11 09:52:23 +01:00
|
|
|
|
2020-08-14 13:36:36 +02:00
|
|
|
if (isset ($_FILES['editorDatoteka']['name'])) {
|
|
|
|
$ime = preg_replace ("/[^a-zA-Z0-9_\.\-]/", "", $_FILES['editorDatoteka']['name']);
|
|
|
|
if (strpos (strtolower ($ime), ".exe")!==false || strpos (strtolower ($ime), ".bat")!==false || strpos (strtolower ($ime), ".com")!==false ||
|
|
|
|
strpos (strtolower ($ime), ".vbs")!==false || strpos (strtolower ($ime), ".pl")!==false || strpos (strtolower ($ime), ".php")!==false || strpos (strtolower ($ime), ".php3")!==false) {
|
|
|
|
?>
|
|
|
|
<strong style="font-family: Arial; font-size: 12px; color: red; font-weight: bold;"><?=$lang['upload_exe']?></strong>
|
|
|
|
<?php
|
|
|
|
}else {
|
|
|
|
$nakljucno = time();
|
|
|
|
$final = $nakljucno .$ime;
|
2021-07-05 14:22:58 +02:00
|
|
|
|
|
|
|
// Preverimo protokol in ga ustrezno replacamo
|
2021-07-05 14:44:21 +02:00
|
|
|
$upload_protocol = (strpos($site_url, 'https://') !== FALSE) ? 'https://' : 'http://';
|
2021-07-05 14:22:58 +02:00
|
|
|
$file_url = str_replace($upload_protocol, "", $site_url).'uploadi/editor/doc/'.$final;
|
|
|
|
|
2020-08-14 13:36:36 +02:00
|
|
|
if (move_uploaded_file($_FILES['editorDatoteka']['tmp_name'], $site_path .'uploadi/editor/doc/' .$final)) {
|
|
|
|
?>
|
2021-07-05 14:22:58 +02:00
|
|
|
<body bgcolor="#ebebeb" onload="
|
|
|
|
parent.document.getElementById(parent.urlsrc).value='<?=$file_url?>';
|
|
|
|
if(parent.document.getElementById('cke_75_select')){
|
|
|
|
parent.document.getElementById('cke_75_select').value = '<?=$upload_protocol?>';
|
|
|
|
}
|
|
|
|
window.location.href='<?= $site_url ?>editors/ckeditor_4_4/uploader/EnkaUploader.php';
|
|
|
|
">
|
2020-08-14 13:36:36 +02:00
|
|
|
<strong style="font-family: Arial; font-size: 12px; font-weight: bold;"><?=$lang['upload_done']?></strong>
|
|
|
|
<?php
|
|
|
|
}else {
|
|
|
|
if (!file_exists($site_path .'uploadi/editor/doc/')) {
|
|
|
|
mkdir($site_path .'uploadi/editor/doc/', 0755, true);
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
<strong style="font-family: Arial; font-size: 12px; color: red; font-weight: bold;"><?=$lang['upload_not_ok']?></strong>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
unset ($_POST['posted']);
|
|
|
|
unset ($_POST['type']);
|
|
|
|
unset ($_FILES['ul']['name']);
|
|
|
|
}else {
|
|
|
|
//
|
|
|
|
// IMG HANDLER
|
|
|
|
//
|
|
|
|
include_once('upload_class.php');
|
|
|
|
include_once('imageresizer.class.php');
|
|
|
|
|
|
|
|
if (isset ($_FILES['eitorSlika']['name'])) {
|
|
|
|
$ime = preg_replace("/[^a-zA-Z0-9_\.\-]/", "", $_FILES['eitorSlika']['name']);
|
|
|
|
$ime = strtolower($ime);
|
|
|
|
if (strpos($ime, ".jpg") === false && strpos($ime, ".jpeg") === false && strpos($ime, ".gif") === false &&
|
|
|
|
strpos($ime, ".png") === false && strpos($ime, ".bmp") === false && strpos($ime, ".svg") === false) {
|
|
|
|
?>
|
2021-03-09 14:13:34 +01:00
|
|
|
<body onload="window.location.href='<?= $site_url ?>editors/ckeditor_4_4/uploader/EnkaUploader.php?image=1&error=1';">
|
2020-08-14 13:36:36 +02:00
|
|
|
<?php
|
|
|
|
}else {
|
|
|
|
$nakljucno = time();
|
|
|
|
$final = $nakljucno . $ime;
|
|
|
|
$UF_obj = new Upload();
|
|
|
|
$UF_obj->File = $_FILES['eitorSlika'];
|
2021-03-09 14:13:34 +01:00
|
|
|
$UF_obj->SavePath = $site_path . '/uploadi/editor';
|
2020-08-14 13:36:36 +02:00
|
|
|
$UF_obj->NewName = $_FILES['eitorSlika']['name'];
|
|
|
|
|
|
|
|
//Širina in višina slike nastavimo
|
2022-08-03 09:26:47 +02:00
|
|
|
$UF_obj->NewWidth = 1920;
|
|
|
|
$UF_obj->NewHeight = 1920;
|
2020-08-14 13:36:36 +02:00
|
|
|
|
|
|
|
$ime = $UF_obj->NameCase = 'lower';
|
|
|
|
$UF_obj->OverWrite = false;
|
|
|
|
$Error = $UF_obj->UploadFile();
|
|
|
|
if (empty($Error)) {
|
|
|
|
?>
|
2021-03-09 14:13:34 +01:00
|
|
|
<body onload="parent.document.getElementById(parent.urlsrc).value='<?= $site_url ?>uploadi/editor/<?= $final ?>'; parent.document.querySelector('img[id$=_previewImage]').src='<?= $site_url ?>uploadi/editor/<?= $final ?>'; parent.document.querySelector('img[id$=_previewImage]').style.display='block'; window.location.href='<?= $site_url ?>editors/ckeditor_4_4/uploader/EnkaUploader.php?image=1';">
|
2020-08-14 13:36:36 +02:00
|
|
|
<strong style="font-family: Arial; font-size: 12px; font-weight: bold;"><?= $lang['upload_img_done'] ?></strong>
|
|
|
|
<?php
|
|
|
|
}else {
|
|
|
|
?>
|
|
|
|
<strong style="font-family: Arial; font-size: 12px; color: blue; font-weight: bold;"><?= $lang['upload_img_not_ok'] ?></strong>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
unset ($_POST['posted']);
|
|
|
|
unset ($_POST['type']);
|
|
|
|
unset ($_FILES['eitorSlika']);
|
|
|
|
echo '<body style="margin-top: 0px; top: 0px; margin-left: 0px; left: 0px; padding-top: 0px;">';
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|