Ejemplo n.º 1
0
    function outputHtml()
    {
        global $_ERROR;
        global $_START_TIME;
        ?>
<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php 
        print $this->getConfig('lang');
        ?>
" lang="<?php 
        print $this->getConfig('lang');
        ?>
">
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=<?php 
        print $this->getConfig('charset');
        ?>
">
<?php 
        css();
        ?>
<!-- <meta charset="<?php 
        print $this->getConfig('charset');
        ?>
" /> -->
<?php 
        if ($this->getConfig('log_file') != null && strlen($this->getConfig('log_file')) > 0 || $this->getConfig('thumbnails') != null && $this->getConfig('thumbnails') == true && $this->mobile == false || GateKeeper::isDeleteAllowed()) {
            ?>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
<?php 
            if (GateKeeper::isDeleteAllowed()) {
                ?>
	$('td.del a').click(function(){
		var answer = confirm('Are you sure you want to delete : \'' + $(this).attr("data-name") + "\' ?");
		return answer;
	});
<?php 
            }
            if ($this->logging == true) {
                ?>
		function logFileClick(path)
		{
			 $.ajax({
					async: false,
					type: "POST",
					data: {log: path},
					contentType: "application/x-www-form-urlencoded; charset=UTF-8",
					cache: false
				});
		}

		$("a.file").click(function(){
			logFileClick("<?php 
                print $this->location->getDir(true, true, false, 0);
                ?>
" + $(this).html());
			return true;
		});
<?php 
            }
            if (EncodeExplorer::getConfig("thumbnails") == true && $this->mobile == false) {
                ?>
		function positionThumbnail(e) {
			xOffset = 30;
			yOffset = 10;
			$("#thumb").css("left",(e.clientX + xOffset) + "px");

			diff = 0;
			if(e.clientY + $("#thumb").height() > $(window).height())
				diff = e.clientY + $("#thumb").height() - $(window).height();

			$("#thumb").css("top",(e.pageY - yOffset - diff) + "px");
		}

		$("a.thumb").hover(function(e){
			$("#thumb").remove();
			$("body").append("<div id=\"thumb\"><img src=\"?thumb="+ $(this).attr("href") +"\" alt=\"Preview\" \/><\/div>");
			positionThumbnail(e);
			$("#thumb").fadeIn("medium");
		},
		function(){
			$("#thumb").remove();
		});

		$("a.thumb").mousemove(function(e){
			positionThumbnail(e);
			});

		$("a.thumb").click(function(e){$("#thumb").remove(); return true;});
<?php 
            }
            ?>
	});
//]]>
</script>
<?php 
        }
        ?>
<title><?php 
        if (EncodeExplorer::getConfig('main_title') != null) {
            print EncodeExplorer::getConfig('main_title');
        }
        ?>
</title>
</head>
<body class="<?php 
        print $this->mobile == true ? "mobile" : "standard";
        ?>
">
<?php 
        //
        // Print the error (if there is something to print)
        //
        if (isset($_ERROR) && strlen($_ERROR) > 0) {
            print "<div id=\"error\">" . $_ERROR . "</div>";
        }
        ?>
<div id="frame">
<?php 
        if (EncodeExplorer::getConfig('show_top') == true) {
            ?>
<div id="top">
	<a href="<?php 
            print $this->makeLink(false, false, null, null, null, "");
            ?>
"><span><?php 
            if (EncodeExplorer::getConfig('main_title') != null) {
                print EncodeExplorer::getConfig('main_title');
            }
            ?>
</span></a>
<?php 
            if (EncodeExplorer::getConfig("secondary_titles") != null && is_array(EncodeExplorer::getConfig("secondary_titles")) && count(EncodeExplorer::getConfig("secondary_titles")) > 0 && $this->mobile == false) {
                $secondary_titles = EncodeExplorer::getConfig("secondary_titles");
                print "<div class=\"subtitle\">" . $secondary_titles[array_rand($secondary_titles)] . "</div>\n";
            }
            ?>
</div>
<?php 
        }
        // Checking if the user is allowed to access the page, otherwise showing the login box
        if (!GateKeeper::isAccessAllowed()) {
            $this->printLoginBox();
        } else {
            if ($this->mobile == false && EncodeExplorer::getConfig("show_path") == true) {
                ?>
<div class="breadcrumbs">
<a href="?dir="><?php 
                print $this->getString("root");
                ?>
</a>
<?php 
                for ($i = 0; $i < count($this->location->path); $i++) {
                    print "&gt; <a href=\"" . $this->makeLink(false, false, null, null, null, $this->location->getDir(false, true, false, count($this->location->path) - $i - 1)) . "\">";
                    print $this->location->getPathLink($i, true);
                    print "</a>\n";
                }
                ?>
</div>
<?php 
            }
            ?>

<!-- START: List table -->
<table class="table">
<?php 
            if ($this->mobile == false) {
                ?>
<tr class="row one header">
	<td class="icon"> </td>
	<td class="name"><?php 
                print $this->makeArrow("name");
                ?>
</td>
	<td class="size"><?php 
                print $this->makeArrow("size");
                ?>
</td>
	<td class="changed"><?php 
                print $this->makeArrow("mod");
                ?>
</td>
	<?php 
                if ($this->mobile == false && GateKeeper::isDeleteAllowed()) {
                    ?>
	<td class="del"><?php 
                    print EncodeExplorer::getString("del");
                    ?>
</td>
	<?php 
                }
                ?>
</tr>
<?php 
            }
            ?>
<tr class="row two">
	<td class="icon"><img alt="dir" src="?img=directory" /></td>
	<td colspan="<?php 
            print $this->mobile == true ? 1 : (GateKeeper::isDeleteAllowed() ? 4 : 3);
            ?>
" class="long">
		<a class="item" href="<?php 
            print $this->makeLink(false, false, null, null, null, $this->location->getDir(false, true, false, 1));
            ?>
">..</a>
	</td>
</tr>
<?php 
            //
            // Ready to display folders and files.
            //
            $row = 1;
            //
            // Folders first
            //
            if ($this->dirs) {
                foreach ($this->dirs as $dir) {
                    $row_style = $row ? "one" : "two";
                    print "<tr class=\"row " . $row_style . "\">\n";
                    print "<td class=\"icon\"><img alt=\"dir\" src=\"?img=directory\" /></td>\n";
                    print "<td class=\"name\" colspan=\"" . ($this->mobile == true ? 1 : 2) . "\">\n";
                    print "<a href=\"" . $this->makeLink(false, false, null, null, null, $this->location->getDir(false, true, false, 0) . $dir->getNameEncoded()) . "\" class=\"item dir\">";
                    print $dir->getNameHtml();
                    print "</a>\n";
                    print "</td>\n";
                    if ($this->mobile != true) {
                        print "<td class=\"changed\">" . $this->formatModTime($dir->getModTime()) . "</td>\n";
                    }
                    if ($this->mobile == false && GateKeeper::isDeleteAllowed()) {
                        print "<td class=\"del\"><a data-name=\"" . htmlentities($dir->getName()) . "\" href=\"" . $this->makeLink(false, false, null, null, $this->location->getDir(false, true, false, 0) . $dir->getNameEncoded(), $this->location->getDir(false, true, false, 0)) . "\"><img src=\"?img=del\" alt=\"Delete\" /></a></td>";
                    }
                    print "</tr>\n";
                    $row = !$row;
                }
            }
            //
            // Now the files
            //
            if ($this->files) {
                $count = 0;
                foreach ($this->files as $file) {
                    $row_style = $row ? "one" : "two";
                    print "<tr class=\"row " . $row_style . (++$count == count($this->files) ? " last" : "") . "\">\n";
                    print "<td class=\"icon\"><img alt=\"" . $file->getType() . "\" src=\"" . $this->makeIcon($file->getType()) . "\" /></td>\n";
                    print "<td class=\"name\" colspan=\"1\">\n";
                    print "\t\t<a href=\"" . $this->location->getDir(false, true, false, 0) . $file->getNameEncoded() . "\"";
                    if (EncodeExplorer::getConfig('open_in_new_window') == true) {
                        print "target=\"_blank\"";
                    }
                    print " class=\"item file";
                    if ($file->isValidForThumb()) {
                        print " thumb";
                    }
                    print "\">";
                    print $file->getNameHtml();
                    if ($this->mobile == true) {
                        print "<span class =\"size\">" . $this->formatSize($file->getSize()) . "</span>";
                    }
                    print "</a>\n";
                    print "</td>\n";
                    if ($this->mobile != true) {
                        print "<td class=\"size\">" . $this->formatSize($file->getSize()) . "</td>\n";
                        print "<td class=\"changed\">" . $this->formatModTime($file->getModTime()) . "</td>\n";
                    }
                    if ($this->mobile == false && GateKeeper::isDeleteAllowed()) {
                        print "<td class=\"del\">\n\t\t\t\t<a data-name=\"" . htmlentities($file->getName()) . "\" href=\"" . $this->makeLink(false, false, null, null, $this->location->getDir(false, true, false, 0) . $file->getNameEncoded(), $this->location->getDir(false, true, false, 0)) . "\">\n\t\t\t\t\t<img src=\"?img=del\" alt=\"Delete\" />\n\t\t\t\t</a>\n\t\t\t</td>";
                    }
                    print "</tr>\n";
                    $row = !$row;
                }
            }
            //
            // The files and folders have been displayed
            //
            ?>

</table>
<!-- END: List table -->
<?php 
        }
        ?>
</div>

<?php 
        if (GateKeeper::isAccessAllowed() && GateKeeper::showLoginBox()) {
            ?>
<!-- START: Login area -->
<form enctype="multipart/form-data" method="post">
	<div id="login_bar">
	<?php 
            print $this->getString("username");
            ?>
:
	<input type="text" name="user_name" value="" id="user_name" />
	<?php 
            print $this->getString("password");
            ?>
:
	<input type="password" name="user_pass" id="user_pass" />
	<input type="submit" class="submit" value="<?php 
            print $this->getString("log_in");
            ?>
" />
	<div class="bar"></div>
	</div>
</form>
<!-- END: Login area -->
<?php 
        }
        if (GateKeeper::isAccessAllowed() && $this->location->uploadAllowed() && (GateKeeper::isUploadAllowed() || GateKeeper::isNewdirAllowed())) {
            ?>
<!-- START: Upload area -->
<form enctype="multipart/form-data" method="post">
	<div id="upload">
		<?php 
            if (GateKeeper::isNewdirAllowed()) {
                ?>
		<div id="newdir_container">
			<input name="userdir" type="text" class="upload_dirname" />
			<input type="submit" value="<?php 
                print $this->getString("make_directory");
                ?>
" />
		</div>
		<?php 
            }
            if (GateKeeper::isUploadAllowed()) {
                ?>
		<div id="upload_container">
			<input name="userfile" type="file" class="upload_file" />
			<input type="submit" value="<?php 
                print $this->getString("upload");
                ?>
" class="upload_sumbit" />
		</div>
		<?php 
            }
            ?>
		<div class="bar"></div>
	</div>
</form>
<!-- END: Upload area -->
<?php 
        }
        ?>
<!-- START: Info area -->
<div id="info">
<?php 
        if (GateKeeper::isUserLoggedIn()) {
            print "<a href=\"" . $this->makeLink(false, true, null, null, null, "") . "\">" . $this->getString("log_out") . "</a> | ";
        }
        if (EncodeExplorer::getConfig("mobile_enabled") == true) {
            print "<a href=\"" . $this->makeLink(true, false, null, null, null, $this->location->getDir(false, true, false, 0)) . "\">\n";
            print $this->mobile == true ? $this->getString("standard_version") : $this->getString("mobile_version") . "\n";
            print "</a> | \n";
        }
        if (GateKeeper::isAccessAllowed() && $this->getConfig("calculate_space_level") > 0 && $this->mobile == false) {
            print $this->getString("total_used_space") . ": " . $this->spaceUsed . " MB | ";
        }
        if ($this->mobile == false && $this->getConfig("show_load_time") == true) {
            printf($this->getString("page_load_time") . " | ", (microtime(TRUE) - $_START_TIME) * 1000);
        }
        ?>
<a href="http://encode-explorer.siineiolekala.net">Encode Explorer</a>
</div>
<!-- END: Info area -->
</body>
</html>

<?php 
    }
Ejemplo n.º 2
0
session_name($_CONFIG["session_name"]);
session_start();
$lang = filter_input(INPUT_POST, 'thislang', FILTER_SANITIZE_STRING);
require 'translations/' . $lang . '.php';
$setUp = new SetUp();
$utils = new Utils();
$updater = new Updater();
$resetter = new Resetter();
$encodeExplorer = new EncodeExplorer();
$dest = filter_input(INPUT_POST, "user_email", FILTER_VALIDATE_EMAIL);
$pulito = filter_input(INPUT_POST, 'cleanurl', FILTER_SANITIZE_STRING);
$postcaptcha = filter_input(INPUT_POST, "captcha", FILTER_SANITIZE_STRING);
global $_USERS;
global $_TOKENS;
if (!$dest || $setUp->getConfig("show_captcha_reset") == true && !$postcaptcha) {
    print "<div class=\"alert alert-warning\">" . $encodeExplorer->getString("fill_all_fields") . "</div>";
    exit;
}
if (Utils::checkCaptchaReset($postcaptcha) !== true) {
    print "<div class=\"alert alert-danger\">" . $encodeExplorer->getString("wrong_captcha") . "</div>";
    exit;
}
if (!$updater->findEmail($dest)) {
    print "<div class=\"alert alert-danger\">" . $encodeExplorer->getString("email_not_exist") . "</div>";
    exit;
}
if (!$resetter->setToken($dest)) {
    print "<div class=\"alert alert-danger\">Error: token not set</div>";
    exit;
}
$token = $resetter->setToken($dest);
Ejemplo n.º 3
0
* update LANG
*/
if (isset($_GET['languagemanager'])) {
    $activesec = "lang";
    if ($_GET['languagemanager'] == 'update') {
        $postnewlang = filter_input(INPUT_POST, "thenewlang", FILTER_SANITIZE_STRING);
        $getremove = filter_input(INPUT_GET, "remove", FILTER_SANITIZE_STRING);
        if ($postnewlang && strlen($postnewlang) == 2 || $getremove) {
            if ($getremove) {
                $thelang = $getremove;
                $langtoremove = "translations/" . $thelang . ".php";
                if (!unlink($langtoremove)) {
                    $success = 'language "' . $thelang . '" does not exists';
                    $status = 'nope';
                } else {
                    $success = $encodeExplorer->getString("language_removed");
                    $status = 'yep';
                }
            } else {
                $thelang = $postnewlang;
                if (in_array($thelang, $translations)) {
                    foreach ($baselang as $key => $value) {
                        $postkey = filter_input(INPUT_POST, $key, FILTER_SANITIZE_STRING);
                        $_TRANSLATIONSEDIT[$key] = $postkey;
                    }
                    $success = $encodeExplorer->getString("language_updated");
                    $status = 'yep';
                } else {
                    $newlang = array();
                    foreach ($baselang as $key => $value) {
                        $postkey = filter_input(INPUT_POST, $key, FILTER_SANITIZE_STRING);
Ejemplo n.º 4
0
        <script src="js/html5.js" type="text/javascript"></script>
        <script src="js/respond.min.js" type="text/javascript"></script>
        <![endif]-->
    </head>
    <body>

    <?php 
    $template->getPart('userpanel', '');
    $template->getPart('header', '');
    ?>

    <div class="container">
        <div id="error">
                <?php 
    if ($error) {
        print "<div class=\"response nope\">" . $encodeExplorer->getString('wrong_pass') . "</div>";
    }
    if ($captchaerror) {
        print "<div class=\"response nope\">" . $encodeExplorer->getString('wrong_captcha') . "</div>";
    }
    ?>
        </div>
        <section class="docblock">
            <div class="login">
                <h2>
                    <i class="fa fa-cogs"></i> 
                    <?php 
    print $encodeExplorer->getString('administration');
    ?>
                </h2>
                <form enctype="multipart/form-data" 
Ejemplo n.º 5
0
} elseif ($getfilelist && file_exists('shorten/' . $getfilelist . '.json')) {
    $datarray = json_decode(file_get_contents('shorten/' . $getfilelist . '.json'), true);
    $hash = $datarray['hash'];
    $time = $datarray['time'];
    $pass = $datarray['pass'];
    $passa = true;
    if ($pass) {
        $passa = false;
        if ($getpass && md5($getpass) === $pass) {
            $passa = true;
        }
    }
    if ($downloader->checkTime($time) == true && $passa === true) {
        $pieces = explode(",", $datarray['attachments']);
        if (count($pieces) > $maxfiles) {
            $_SESSION['error'] = $encodeExplorer->getString("too_many_files") . " " . $maxfiles;
            header('Location:' . $script_url);
            exit;
        }
        if (!file_exists('tmp')) {
            if (!mkdir('tmp', 0755)) {
                $_SESSION['error'] = "Cannot create a tmp dir for .zip files";
                header('Location:' . $script_url);
                exit;
            }
            if (!chmod('tmp', 0755)) {
                $_SESSION['error'] = "Cannot set CHMOD 755 to tmp dir";
                header('Location:' . $script_url);
                exit;
            }
        }
Ejemplo n.º 6
0
         $mail->Username = $setUp->getConfig('email_login');
         $mail->Password = $setUp->getConfig('email_pass');
     }
 }
 $mail->setFrom($setfrom, $setUp->getConfig('appname'));
 $mail->addReplyTo($from, '<' . $from . '>');
 $mail->addAddress($dest, '<' . $dest . '>');
 if ($bcc) {
     foreach ($bcc as $newcc) {
         $cleancc = filter_var($newcc, FILTER_VALIDATE_EMAIL);
         if ($cleancc) {
             $mail->AddBCC($cleancc, '<' . $cleancc . '>');
         }
     }
 }
 $mail->Subject = $from . " " . $encodeExplorer->getString('sent_some_files');
 $myfiles = "<ul>";
 foreach ($attachments as $value) {
     $filepathinfo = $utils->mbPathinfo(urldecode(base64_decode($value)));
     $filename = $filepathinfo['basename'];
     $myfiles .= "<li>" . $filename . "</li>";
 }
 $myfiles .= "</ul>";
 $mail->AddEmbeddedImage('mail/mail-logo.png', 'logoimg', 'mail/mail-logo.png');
 // Retrieve the email template required
 $message = file_get_contents('mail/template-send-files.html');
 // Replace the % with the actual information
 $message = str_replace('%from%', $from, $message);
 $message = str_replace('%translate_sent_some_files%', $encodeExplorer->getString('sent_some_files'), $message);
 $message = str_replace('%myfiles%', $myfiles, $message);
 $message = str_replace('%link%', $link, $message);