diff --git a/editor.php b/editor.php index 0788656..9f3aae6 100644 --- a/editor.php +++ b/editor.php @@ -35,7 +35,7 @@ span.CodeMirror-matchhighlight {background: #555}
-'.PHP_EOL; echo '

server

'.PHP_EOL; echo 'Server name, OS & IP:
'.PHP_EOL; diff --git a/files.php b/files.php index 626b5a2..eda21f0 100644 --- a/files.php +++ b/files.php @@ -121,7 +121,7 @@ for ($i=0;$i'.$chmodInfo.''; } $type == "folder" ? $class = 'pft-directory' : $class = 'pft-file '.strtolower($ext); - if ($_SESSION['userLevel'] == 10 || ($_SESSION['userLevel'] < 10 && !$restrictedFile)) { + if ($_SESSION['loggedIn'] || (!$_SESSION['loggedIn'] && !$restrictedFile)) { echo "
  •         ".basename($fileFolderName)." ".$fileAtts."\n"; } else { echo "
  •         [HIDDEN]"; diff --git a/index.php b/index.php index 8b567f4..91d74ac 100644 --- a/index.php +++ b/index.php @@ -43,7 +43,7 @@ window.onbeforeunload = function() { } previousFiles = [ " onResize="ICEcoder.setLayout()" onKeyDown="return ICEcoder.interceptKeys('coder',event);" onKeyUp="parent.ICEcoder.resetKeys(event);"> diff --git a/lib/file-control.php b/lib/file-control.php index 7d8506b..8d692db 100644 --- a/lib/file-control.php +++ b/lib/file-control.php @@ -31,7 +31,7 @@ if ($_GET['action']=="load") { $bannedFile=true; } } - if (file_exists($file) && ($_SESSION['userLevel'] > 0 || ($_SESSION['userLevel'] == 0 && !$bannedFile))) { + if (file_exists($file) && ($_SESSION['loggedIn'] || (!$_SESSION['loggedIn'] && !$bannedFile))) { echo ''; @@ -53,7 +53,7 @@ if ($_GET['action']=="load") { // If we're due to add a new folder... if ($_GET['action']=="newFolder") { - if (is_writable($docRoot.$fileLoc) && $_SESSION['userLevel'] > 0) { + if (is_writable($docRoot.$fileLoc) && $_SESSION['loggedIn']) { mkdir($file, 0705); // Reload file manager echo ''; @@ -71,7 +71,7 @@ if ($_GET['action']=="newFolder") { // If we're due to rename a file/folder... if ($_GET['action']=="rename") { - if ($_SESSION['userLevel'] > 0 && is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) { + if ($_SESSION['loggedIn'] && is_writable($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])))) { rename($docRoot.$iceRoot.str_replace("|","/",strClean($_GET['oldFileName'])),$docRoot.$fileLoc."/".$fileName); // Reload file manager echo ''; // on the form posting via a reload, save the file if (isset($_POST['contents'])) { - if ($_SESSION['userLevel'] > 0) { + if ($_SESSION['loggedIn']) { if ((file_exists($file) && is_writable($file)) || isset($_POST['newFileName']) && $_POST['newFileName']!="") { if (filemtime($file)==$_GET['fileMDT']||!(isset($_GET['fileMDT']))) { $fh = fopen($file, 'w') or die("Sorry, cannot save"); diff --git a/lib/file-folder-properties.php b/lib/file-folder-properties.php index 9ad1d23..2bcc9b5 100644 --- a/lib/file-folder-properties.php +++ b/lib/file-folder-properties.php @@ -39,7 +39,7 @@ echo number_format($outputSize, 2, '.', '').$outputUnit." (".number_format($byte

    Type: Readable / Writeable: /

    Absolute path:


    @@ -145,7 +145,7 @@ var validatePerms = function() { canUpdate = false; } if (canUpdate) {top.ICEcoder.chmod('',permText)}; 0) {$rFile = true;}; } diff --git a/lib/settings-screen.php b/lib/settings-screen.php index 6690e32..f3d7ec0 100644 --- a/lib/settings-screen.php +++ b/lib/settings-screen.php @@ -52,7 +52,7 @@ for ($i=0;$i
    file manager root:
    - +



    ICE coder by Matt Pass (@mattpass)

    @@ -202,7 +202,7 @@ var showHideTabs = function() { } var validatePasswords = function() { - + if (document.settings.accountPassword.value != 0 && document.settings.accountPassword.value.length<8) { top.ICEcoder.message('Please use at least 8 chars in the password'); } else { diff --git a/lib/settings.php b/lib/settings.php index 3c984de..26d28d4 100644 --- a/lib/settings.php +++ b/lib/settings.php @@ -35,7 +35,7 @@ $ICEcoder = array( )+$ICEcoder; // Update this config file? -if (isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['userLevel'] == 10) { +if (isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['loggedIn']) { $settingsContents = file_get_contents($settingsFile); // Replace our settings vars $repPosStart = strpos($settingsContents,'"root"'); @@ -89,15 +89,15 @@ if (isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['userLevel'] == 10) { // Define the docRoot & iceRoot $docRoot = rtrim(str_replace("\\","/",$_SERVER['DOCUMENT_ROOT'])); $iceRoot = rtrim(str_replace("\\","/",$ICEcoder["root"])); -if ($_SESSION['userLevel'] == 10) { +if ($_SESSION['loggedIn']) { echo ""; } $serverType = stristr($_SERVER[SERVER_SOFTWARE], "win") ? "Windows" : "Linux"; // Establish our user level -if (!isset($_SESSION['userLevel'])) {$_SESSION['userLevel'] = 0;}; -if(isset($_POST['loginPassword']) && generateHash(strClean($_POST['loginPassword']),$ICEcoder["accountPassword"])==$ICEcoder["accountPassword"]) {$_SESSION['userLevel'] = 10;}; -$_SESSION['userLevel'] = $_SESSION['userLevel']; +if (!isset($_SESSION['loggedIn'])) {$_SESSION['loggedIn'] = false;}; +if(isset($_POST['loginPassword']) && generateHash(strClean($_POST['loginPassword']),$ICEcoder["accountPassword"])==$ICEcoder["accountPassword"]) {$_SESSION['loggedIn'] = true;}; +$_SESSION['loggedIn'] = $_SESSION['loggedIn']; // Setup our file security vars $settingsArray = array("findFilesExclude","restrictedFiles","bannedFiles","allowedIPs"); @@ -119,7 +119,7 @@ if (!$allowedIP) { // Save the currently opened files for next time if (isset($_GET["saveFiles"]) && $_GET['saveFiles']) { - if ($_SESSION['userLevel'] == 10) { + if ($_SESSION['loggedIn']) { $settingsContents = file_get_contents($settingsFile); // Replace our previousFiles var with the the current @@ -161,9 +161,9 @@ if (isset($_GET["saveFiles"]) && $_GET['saveFiles']) { } // If we're updating or calling from the index.php page, do/redo plugins -if ((isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['userLevel'] == 10) || strpos($_SERVER['PHP_SELF'],"index.php")>0) { +if ((isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['loggedIn']) || strpos($_SERVER['PHP_SELF'],"index.php")>0) { // If we're updating, we need to recreate the plugins array - if (isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['userLevel'] == 10) { + if (isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['loggedIn']) { $ICEcoder["plugins"] = array(); $pluginsArray = explode("====================",str_replace("\"","",str_replace("\r","",str_replace("\n","",$_POST['plugins'])))); for ($i=0;$itop.document.getElementById('pluginsContainer').innerHTML = '".$pluginsDisplay."';"; } @@ -192,7 +192,7 @@ if ((isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['userLevel'] == 10) }; // If we're updating our settings, clear existing setIntervals & the array refs, then start new ones - if (isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['userLevel'] == 10) { + if (isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['loggedIn']) { ?> '; $addToZip = $doZip->zipFilesUp($saveLocation,$fileName,$keepLastDays,$docRoot);