Esempio n. 1
0
$_IMAGES["wmv"] = $_IMAGES["video"];
$_IMAGES["xcf"] = $_IMAGES["graphics"];
$_IMAGES["xls"] = $_IMAGES["spreadsheet"];
$_IMAGES["xlsx"] = $_IMAGES["spreadsheet"];
$_IMAGES["xml"] = $_IMAGES["code"];
$_IMAGES["zip"] = $_IMAGES["archive"];
require "inc/EncodeExplorer.php";
require "inc/Dir.php";
require "inc/FileManager.php";
require "inc/File.php";
require "inc/GateKeeper.php";
require "inc/ImageServer.php";
require "inc/Location.php";
require "inc/Logger.php";
//
// This is where the system is activated.
// We check if the user wants an image and show it. If not, we show the explorer.
//
$encodeExplorer = new EncodeExplorer();
$encodeExplorer->init();
GateKeeper::init();
if (!ImageServer::showImage() && !Logger::logQuery()) {
    $location = new Location();
    $location->init();
    if (GateKeeper::isAccessAllowed()) {
        Logger::logAccess($location->getDir(true, false, false, 0), true);
        $fileManager = new FileManager();
        $fileManager->run($location);
    }
    $encodeExplorer->run($location);
}
Esempio n. 2
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 
    }
Esempio n. 3
0
 function run($location)
 {
     if (isset($_POST['userdir']) && strlen($_POST['userdir']) > 0) {
         if ($location->uploadAllowed() && GateKeeper::isUserLoggedIn() && GateKeeper::isAccessAllowed() && GateKeeper::isNewdirAllowed()) {
             $this->newFolder($location, $_POST['userdir']);
         }
     }
     if (isset($_FILES['userfile']['name']) && strlen($_FILES['userfile']['name']) > 0) {
         if ($location->uploadAllowed() && GateKeeper::isUserLoggedIn() && GateKeeper::isAccessAllowed() && GateKeeper::isUploadAllowed()) {
             $this->uploadFile($location, $_FILES['userfile']);
         }
     }
     if (isset($_GET['del'])) {
         if (GateKeeper::isUserLoggedIn() && GateKeeper::isAccessAllowed() && GateKeeper::isDeleteAllowed()) {
             $split_path = Location::splitPath($_GET['del']);
             $path = "";
             for ($i = 0; $i < count($split_path); $i++) {
                 $path .= $split_path[$i];
                 if ($i + 1 < count($split_path)) {
                     $path .= "/";
                 }
             }
             if ($path == "" || $path == "/" || $path == "\\" || $path == ".") {
                 return;
             }
             if (is_dir($path)) {
                 FileManager::delete_dir($path);
             } else {
                 if (is_file($path)) {
                     FileManager::delete_file($path);
                 }
             }
         }
     }
 }
Esempio n. 4
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');
        ?>
">

<!-- <link rel="stylesheet" type="text/css" media="screen" href="localhost.css" /> -->


<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
            CSS
     ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
     ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
     :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->

<style type="text/css">
    body
{
    background-color:#FFF;
    background-image: url("bg.jpg");  no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
    font-family:Verdana;
    font-size:small
}

a
{
    color:#232323;
    text-decoration:none;
    display:block
}

a:hover
{
    text-decoration:underline
}

#top
{
    width:100%;
    padding-bottom:20px;
    background:none repeat scroll 0 0 #B6B7C6;
    text-align: center;

}

/*#top a span,#top a:hover,#top a span:hover
{
    color:#4493C4;
    text-align:center;
    font-size:large
}

#top a
{
    display:block;
    padding:20px 0 0
}

#top span
{
    display:block;
    letter-spacing:9px
}*/

div.subtitle
{
    width:80%;
    margin:0 auto;
    color:#68a9d2;
    text-align:center;
}

#frame
{
    background-color:#F2F2F2;
    border:1px solid #CDD2D6;
    margin:0 auto;
    max-width: 1010px;
    opacity: 0.8;
    /*overflow: auto;*/
    text-align:left;

    /*position: absolute;*/
    /*top: 10%;*/
    height: 90%;
    left: 8%;
    width: 80%;

}

#error
{
    max-width:450px;
    background-color:#FFE4E1;
    color:#000;
    padding:7pt;
    position:relative;
    margin:10pt auto;
    text-align:center;
    border:1px dotted #CDD2D6
}

input
{
    border:1px solid #CDD2D6
}

.bar
{
    width:100%;
    clear:both;
    height:1px
}

/* File list */
table.table
{
    width:100%;
    border-collapse:collapse
}

table.table td
{
    padding:3px;
    width:200px
}

table.table tr.row.two
{
    background-color:#c2c2c2;
    width:200px;
    float:left
}

table.table tr.row.one
{
    background-color:#c2c2c2;
    width:200px;
    float:left
}

table.table tr.row td.icon
{
    width:25px;
    padding-top:3px;
    padding-bottom:1px
}

table.table td.del
{
    width:25px
}

table.table tr.row td.size
{
    width:100px;
    text-align:right
}

table.table tr.row td.changed
{
    width:150px;
    text-align:center
}

table.table tr.header img
{
    vertical-align:bottom
}

table.table tr.row:hover
{
    background-color:#eee
}

table.table tr.row a:hover
{
    color:#EF4646;
    text-decoration:none
}

table img
{
    border:0
}

table.table tr
{
    margin-bottom:5px
}

/* Info area */
#info
{
    color:#000;
    font-family:Verdana;
    max-width:680px;
    position:relative;
    margin:0 auto;
    text-align:center
}

/* Thumbnail area */
#thumb
{
    position:absolute;
    border:1px solid #CDD2D6;
    background:#f8f9fa;
    display:none;
    padding:3px
}

#thumb img
{
    display:block
}

/* Login bar (at the bottom of the page) */
#login_bar
{
    margin:0 auto;
    margin-top:2px;
    max-width:680px
}

#login_bar input.submit
{
    float:right
}

/* Upload area */
#upload
{
    margin:0 auto;
    margin-top:2px;
    max-width:680px
}

#upload #password_container
{
    margin-right:20px
}

#upload #newdir_container,#upload #password_container
{
    float:left
}

#upload #upload_container
{
    float:right
}

#upload input.upload_dirname,#upload input.upload_password
{
    width:140px
}

#upload input.upload_file
{
    font-size:small
}

/* Breadcrumbs */
div.breadcrumbs
{
    display:block;
    padding:1px 3px;
    color:#676767;
    font-size:x-small
}

div.breadcrumbs a
{
    display:inline-block;
    color:#949494;
    padding:2px 0;
    font-size:small
}

/* Login area */
#login
{
    max-width:280px;
    text-align:right;
    margin:15px auto 50px
}

#login div
{
    display:block;
    width:100%;
    margin-top:5px
}

#login label
{
    width:120px;
    text-align:right
}

/* Mobile interface */
body.mobile #frame,body.mobile #info,body.mobile #upload
{
    max-width:none
}

body.mobile
{
    font-size:medium
}

body.mobile a.item
{
    display:block;
    padding:10px 0
}

body.mobile a.item span.size
{
    float:right;
    margin-left:10px
}

body.mobile table.table
{
    margin-bottom:30px
}

body.mobile table.table tr td
{
    border-top:1px solid #CDD2D6
}

body.mobile table.table tr.last td
{
    border-bottom:1px solid #CDD2D6
}

body.mobile #top
{
    padding-bottom:3px
}

body.mobile #top a
{
    padding-top:3px
}

body.mobile #upload #password_container,body.mobile #upload #upload_container,body.mobile #upload #newdir_container
{
    float:none;
    margin-top:5px
}

body.mobile #upload input.upload_dirname,body.mobile #upload input.upload_password
{
    width:240px
}

body.mobile #upload
{
    margin-bottom:15px
}

/* ::::::: Footer
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */
.keyboard_key,#footer,#top
{
    background-color:#EEE;
    background-image:-moz-linear-gradient(top,whiteSmoke 0,#EEE 100%);
    background-image:-ms-linear-gradient(top,whiteSmoke 0,#EEE 100%);
    background-image:-o-linear-gradient(top,whiteSmoke 0,#EEE 100%);
    background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,whiteSmoke),color-stop(100%,#eee));
    background-image:-webkit-linear-gradient(top,whiteSmoke 0,#EEE 100%);
    background-image:linear-gradient(top,whiteSmoke 0,#eee 100%);
    background-repeat:repeat-x;
    color:#555;
    display:inline-block;
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f5f5f5',endColorstr='#eeeeee',GradientType=0);
    font-size:11px;
    height:25px;
    line-height:15px;
    width:20em;
    padding:0 4px;
    text-align:left;
    border:1px solid #CCC;
    -webkit-border-radius:3px;
    -moz-border-radius:3px;
    border-radius:3px;
    -webkit-box-shadow:inset 0 1px 0 white,0 1px 0 #CCC;
    -moz-box-shadow:inset 0 1px 0 #fff,0 1px 0 #ccc;
    box-shadow:inset 0 1px 0 white,0 1px 0 #CCC;
    margin-right:5px;
/* added by dean */
    cursor:pointer
}

.keyboard_key:hover
{
    background:#e9e9ce;
/* Old browsers */
    background-image:-moz-linear-gradient(top,#EEE 0,#B3B5A8 100%);
    background-image:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#EEE),color-stop(100%,#B3B5A8));
    background-image:-webkit-linear-gradient(top,#EEE 0,#B3B5A8 100%);
    background-image:-ms-linear-gradient(top,#EEE 0,#B3B5A8 100%);
    background-image:-o-linear-gradient(top,#EEE 0,#B3B5A8 100%);
    filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee',endColorstr='#f5f5f5',GradientType=0);
    background-image:linear-gradient(top,eee 0,#B3B5A8 100%)
}

.keyboard_key a
{
    width:17em
}

.icon
{
    max-width:2em
}

.name,.header,.back
{
/*max-width: 200px;*/
}

.header,.back
{
/*min-width: 231px;*/
}

#frame
{
    max-width:90%;
    padding:1.7%
}

#footer
{
    text-align:center;
    margin:0 40%;
    line-height:25px;
    background-image:-moz-linear-gradient(center top,#D2D2D2,#939393);
    background-image:-ms-linear-gradient(top,#D2D2D2,#939393);
    background-image:-o-linear-gradient(top,#D2D2D2,#939393);
    background-image:-webkit-gradient(linear,0% 0%,0% 100%,from(#D2D2D2),to(#939393));
    background-image:-webkit-linear-gradient(top,#D2D2D2,#939393);
    min-width:20%
}

#top
{
    background-image:-moz-linear-gradient(center top,#FAFAFA 0px,#FFF 100%);
    background-image:-ms-linear-gradient(top,#FAFAFA,#FFF);
    background-image:-o-linear-gradient(top,#FAFAFA,#FFF);
    background-image:-webkit-gradient(linear,0% 0%,0% 100%,from(#FAFAFA),to(#FFF));
    background-image:-webkit-linear-gradient(top,#FAFAFA,#FFF);
    margin-bottom:20px;
    width:97%;
    text-align: center;
    font-size: 1.4em;
}

#top a
{
    display:block;
    padding:0
}
#top .tl {
    position: relative;
    top: -7px;
    color: #BFC0CB;
}
.stylesHtml
{
    background-color:#E6EDF9;
    background-image:-moz-linear-gradient(top,#E6EDF9,#DAE5F5);
    background-image:-ms-linear-gradient(top,#E6EDF9,#DAE5F5);
    background-image:-o-linear-gradient(top,#E6EDF9,#DAE5F5);
    background-image:-webkit-gradient(linear,0% 0%,0% 100%,from(#E6EDF9),to(#DAE5F5));
    background-image:-webkit-linear-gradient(top,#E6EDF9,#DAE5F5)
}

.stylesIndex
{
    background-color:#BAC1CD;
    background-image:-moz-linear-gradient(top,#BAC1CD,#D1D7DE);
    background-image:-ms-linear-gradient(top,#BAC1CD,#D1D7DE);
    background-image:-o-linear-gradient(top,#BAC1CD,#D1D7DE);
    background-image:-webkit-gradient(linear,0% 0%,0% 100%,from(#BAC1CD),to(#D1D7DE));
    background-image:-webkit-linear-gradient(top,#BAC1CD,#D1D7DE)
}


/* :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: *\
            Camios
\* :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: */

#frame {
    max-width: 90%;
    padding: 1.7%;
}


</style>



<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
            END CSS
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>

<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
            JS
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->

<script type="text/javascript">
 $(document).ready(function() {
    $("tr td:contains('.html')").parent().addClass('stylesHtml');
    $("tr td:contains('index')").parent().addClass('stylesIndex');
});
</script>

<!-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
            END JS
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -->


<!-- <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">
        <img src="localhost.jpg" alt="">
        <span class="tl">Mayccoll</span>


        <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>
<div id="footer">
    <a href="phpmyadmin" target="_BLANK">phpmyadmin</a>
</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="header keyboard_key">
    <td class="icon">
        <img src="?img=directoryHome" alt="dir">
    </td>
    <td class="name">
        <?php 
                //print $this->makeArrow("name");
                ?>
        <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>
    </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="back keyboard_key">

    <td class="icon"><img alt="dir" src="?img=directory" /></td>

    <td colspan="<?php 
            print $this->mobile == true ? 2 : (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 ? "" : "";
                    print "<tr class=\" keyboard_key" . $row_style . "\">\n";
                    print "<td class=\"icon\"><img alt=\"dir\" src=\"?img=directory\" /></td>\n";
                    print "<td class=\"name\" colspan=\"" . ($this->mobile == true ? 2 : 3) . "\">\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 == 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 ? "" : "";
                    print "<tr class=\" keyboard_key" . $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\">\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\n                <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\n                    <img src=\"?img=del\" alt=\"Delete\" />\n\n                </a>\n\n            </td>";
                    }
                    print "</tr>\n";
                    $row = !$row;
                }
            }
            //
            // The files and folders have been displayed
            //
            ?>



</table>


<!-- END: List table

<?php 
        }
        ?>

</div> <!-- END frame -->



<?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 
    }
Esempio n. 5
0
session_start();
require 'users.php';
require 'class.php';
$timeconfig = $_CONFIG['default_timezone'];
$timezone = strlen($timeconfig) > 0 ? $timeconfig : "UTC";
date_default_timezone_set($timezone);
$chunk = new Chunk();
$encodeExplorer = new EncodeExplorer();
if (isset($_SESSION['lang'])) {
    $lang = $_SESSION['lang'];
} else {
    $lang = SetUp::getConfig("lang");
}
require "translations/" . $lang . ".php";
$gateKeeper = new GateKeeper();
if ($gateKeeper->isAccessAllowed() && $gateKeeper->isAllowed('upload_enable')) {
    if ($_SERVER['REQUEST_METHOD'] === 'GET') {
        if ($_GET['resumableChunkNumber'] == 1) {
            $firstChunk = true;
        } else {
            $firstChunk = false;
        }
        $resumabledata = $chunk->setupFilename($_GET['resumableFilename'], $_GET['resumableIdentifier']);
        $resumableFilename = $resumabledata['filename'];
        $extension = $resumabledata['extension'];
        $basename = $resumabledata['basename'];
        $fullfilepath = $_GET['loc'] . $resumableFilename;
        if (Utils::notList($extension, SetUp::getConfig("upload_allow_type")) == true || Utils::inList($extension, SetUp::getConfig("upload_reject_extension")) == true || Utils::inList($resumableFilename, array('.htaccess', '.htpasswd', '.ftpquota')) == true || substr($resumableFilename, 0, 1) === ".") {
            if ($_GET['resumableChunkNumber'] == 1) {
                $chunk->setError("<span><i class=\"fa fa-exclamation-triangle\"></i> " . $basename . "<strong>." . $extension . "</strong> " . SetUp::getLangString("upload_type_not_allowed") . "</span> ");
            }
Esempio n. 6
0
$gateKeeper->init();
$setUp = new SetUp();
$location = new Location();
$location->init();
$downloader = new Downloader();
$updater = new Updater();
$updater->init();
$template = new Template();
$timeconfig = $setUp->getConfig('default_timezone');
$timezone = strlen($timeconfig) > 0 ? $timeconfig : "UTC";
date_default_timezone_set($timezone);
require_once 'doc-admin/token.php';
global $_TOKENS;
$resetter = new Resetter();
$resetter->init();
if ($gateKeeper->isAccessAllowed()) {
    $fileManager = new FileManager();
    $fileManager->run($location);
    $encodeExplorer->run($location);
}
unset($_SESSION['upcoda']);
$_SESSION['upcoda'] = array();
unset($_SESSION['uplist']);
$_SESSION['uplist'] = array();
if (!isset($_GET['response'])) {
    if (isset($_ERROR) && strlen($_ERROR) > 0) {
        $_SESSION['error'] = $_ERROR;
    }
    if (isset($_SUCCESS) && strlen($_SUCCESS) > 0) {
        $_SESSION['success'] = $_SUCCESS;
    }
Esempio n. 7
0
 /**
  * prepare multiple files for upload
  *
  * @param array $coda $_FLES['userfile']
  *
  * @return call uploadFIle()
  */
 public function uploadMulti($coda)
 {
     global $location;
     if ($location->editAllowed() && GateKeeper::isUserLoggedIn() && GateKeeper::isAccessAllowed() && GateKeeper::isAllowed('upload_enable')) {
         // Number of files to uploaded
         $num_files = count($coda['tmp_name']);
         $totnames = array();
         /** loop through the array of files ***/
         for ($i = 0; $i < $num_files; $i++) {
             $filepathinfo = Utils::mbPathinfo($coda['name'][$i]);
             $filename = $filepathinfo['filename'];
             $filex = $filepathinfo['extension'];
             $thename = $filepathinfo['basename'];
             $tempname = $coda['tmp_name'][$i];
             $tipo = $coda['type'][$i];
             $filerror = $coda['error'][$i];
             if (in_array($thename, $totnames)) {
                 $thename = $filename . $i . "." . $filex;
             }
             if (Utils::notList($thename, array('.htaccess', '.htpasswd', '.ftpquota')) == true) {
                 array_push($totnames, $thename);
                 if ($thename) {
                     Actions::uploadFile($location, $thename, $tempname, $tipo);
                     // check uplad errors
                     FileManager::upLog($filerror);
                 }
             }
         }
     }
 }