Compare commits

..

17 Commits

Author SHA1 Message Date
Matt Pass
7062560eaa Version number update only 2012-05-31 15:07:12 +01:00
Matt Pass
3be433c910 Visibility of content, padlock dir & IE fixes
Removed comments/dislaimer at top, now use LICENSE file
No longer show or hide content area, it's shown from init load if logged
in
Changed location of packlock icon
IE now using e var for event and not event, fixes JS issue
On refresh and successful login, set visibility & src of content area
(This shows server info upon login)
2012-05-31 15:07:00 +01:00
Matt Pass
bd0969e870 Altered error text & showing content area on load
Better error message to user re public write permissions on config.php
If logged in, now shows content area and therefore server details
2012-05-31 15:01:07 +01:00
Matt Pass
ffbac321a4 Change of padlock image location & IE CSS hack
Padlock now located in parent image folder
IE differs in it's placement of icons, so have conditional IE CSS fix
2012-05-31 14:59:27 +01:00
Matt Pass
222f6589a9 FM icons now work from single sprite sheet
All filetypes now show icons via single sprite sheet
This works via setting a class with pseudo :before containing icon sized
block with icon in BG
blank.gif is used as a sizing placeholder for LI images
Removed a few trailing semi colons
2012-05-31 14:57:59 +01:00
Matt Pass
a2245775a9 Adjustment to location of padlock image 2012-05-31 14:52:34 +01:00
Matt Pass
d594050166 Server & user info screen
CodeMirror instances now on z-index of 1, above body
Body by default now shows server & user details if logged in and no docs
loaded
2012-05-31 14:51:46 +01:00
Matt Pass
2665055558 New FM icons sprite sheet & blank.gif
All file manager icons now in single sprite sheet
These are shown using CSS class pseudo's
blank.gif is needed to easily determin height
2012-05-31 14:37:37 +01:00
Matt Pass
3e41afb0a6 Set value not innerHTML in textarea
Setting innerHTML works fine in Chrome & Firefox but not IE
In order to make IE compatible, made this improvement
(More syntactically appropriate anyway)
2012-05-31 14:35:48 +01:00
Matt Pass
f1ec4a2453 Padlock & refresh icons moved
Moved from FM dir (no longer exists) to parent 'images' dir
2012-05-31 14:32:59 +01:00
Matt Pass
98f1ace910 Removed single FM icons
Removed individual file manager icons from own dir
Icons now show via CSS and spritesheet
2012-05-31 14:32:09 +01:00
Matt Pass
401a3a7abb New initAliases function & scoping of vars
Initialisation of DOM vars now in own function
(This allows Firefox loadstack to work fine & is more efficient too,
only ever called once)
'this' also prefixes the DOM vars initialised, so works in Firefox
2012-05-29 17:53:41 +01:00
Matt Pass
6a0cc816a9 Aliases now initialised in seperate function
Initialise once DOM load complete, prior to 1st setLayout call
2012-05-29 17:51:08 +01:00
Matt Pass
4bafb3aaa1 Need e not event
Wasn't working in Firefox, this fixes issue
2012-05-29 17:50:14 +01:00
Matt Pass
782aac54e4 Logo now is a PNG
Has transparent BG, so can show on white or dark grey BG
2012-05-29 17:11:44 +01:00
Matt Pass
06dd46c24f Logo now is a PNG
Has transparent BG, so can show on white or dark grey BG
2012-05-29 17:11:10 +01:00
Matt Pass
bc50886250 Alterations to the install process 2012-05-29 16:58:02 +01:00
29 changed files with 101 additions and 66 deletions

View File

@@ -44,17 +44,16 @@ Early version of the web based IDE which allows for creation of websites in the
$ git clone git@github:mattpass/ICEcoder
```
####Step 2: Upload all the files
####Step 2: Upload the files (Linux or Windows hosting OK)
```
Linux or Windows hosting OK
Upload to a new sub-dir URL such as yourdomain.com/_coder
Set public write permissions on the lib/settings.php file
Set public write permissions on the lib/config.php file
```
####Step 3: Start coding
```
Visit the sub-dir URL in your browser and enter a password
Now you're setup, auto-logged in too and ready to code
Now you're setup, auto-logged in and ready to code!
```
Suitable for commercial & non-commercial projects, just let me know if it's useful to you and any cool customisations you make to it. I take no responsibility for anything, your usage is all down to you.

View File

@@ -24,7 +24,7 @@ if ($theme=="default") {
}
?>
<style type="text/css">
.CodeMirror {position: absolute; width: 0; background-color: #fff}
.CodeMirror {position: absolute; width: 0; background-color: #fff; top: 0px; z-index: 1}
.CodeMirror-scroll {width: 100px; height: 100px;}
.cm-s-visible {display: block; top: 0}
.cm-s-hidden {display: none; top: 4000px}
@@ -36,7 +36,30 @@ span.CodeMirror-matchhighlight {background: #555}
</style>
</head>
<body style="margin: 0" onKeyDown="return top.ICEcoder.interceptKeys('content', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
<body style="color: #fff; margin: 0" onKeyDown="return top.ICEcoder.interceptKeys('content', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
<div style="margin: 35px 43px; font-family: arial; font-size: 10px; color: #dddddd">
<?php if($_SESSION['userLevel'] == 10) {
echo '<span style="color:#888">Server name:</span><br>'.PHP_EOL;
echo $_SERVER['SERVER_NAME'].'<br><br>'.PHP_EOL;
echo '<span style="color:#888">Server OS:</span><br>'.PHP_EOL;
echo $_SERVER['SERVER_SOFTWARE'].'<br><br>'.PHP_EOL;
echo '<span style="color:#888">Server IP:</span><br>'.PHP_EOL;
echo $_SERVER['SERVER_ADDR'].'<br><br>'.PHP_EOL;
echo '<span style="color:#888">Root:</span><br>'.PHP_EOL;
echo $_SERVER['DOCUMENT_ROOT'].'<br><br>'.PHP_EOL;
echo '<span style="color:#888">PHP version:</span><br>'.PHP_EOL;
echo phpversion().'<br><br><br>'.PHP_EOL;
echo '<span style="color:#888">Browser:</span><br>'.PHP_EOL;
echo $_SERVER['HTTP_USER_AGENT'].'<br><br>'.PHP_EOL;
echo '<span style="color:#888">Your IP:</span><br>'.PHP_EOL;
echo $_SERVER['REMOTE_ADDR'].'<br><br><br>'.PHP_EOL;
echo '<span style="color:#888">Date & time:</span><br>'.PHP_EOL;
echo date("D jS M Y g:i:sa").'<br><br>'.PHP_EOL;
}; ?>
</div>
<script>
function createNewCMInstance(num) {
@@ -79,7 +102,7 @@ function createNewCMInstance(num) {
}
},
onKeyEvent: function(instance, e) {
top.ICEcoder.redoChangedContent(event);
top.ICEcoder.redoChangedContent(e);
top.ICEcoder.findReplace('find',true,false);
top.ICEcoder.getCaretPosition();
top.ICEcoder.updateCharDisplay();

View File

@@ -119,7 +119,7 @@ function fileManager_dir($directory, $return_link, $first_call=true) {
}
$fileManager .= "<li class=\"pft-file " . strtolower($ext) . "\"><a nohref onMouseOver=\"top.ICEcoder.overFileFolder('file','$link')\" onMouseOut=\"top.ICEcoder.overFileFolder('file','')\" style=\"position: relative; left:-22px; cursor: pointer\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span id=\"".str_replace("/","|",str_replace($docRoot,"",$link))."\">" . htmlspecialchars($this_file) . "</span> ".$fileAtts."</a></li>";
} else {
$fileAtts = "<img src=\"images/file-manager-icons/padlock.png\" style=\"cursor: pointer\" onClick=\"alert('Sorry, you need higher admin level rights to view.')\">";
$fileAtts = "<img src=\"images/padlock.png\" style=\"cursor: pointer\" onClick=\"alert('Sorry, you need higher admin level rights to view.')\">";
$fileManager .= "<li class=\"pft-file " . strtolower($ext) . "\" style=\"cursor: default\"><span style=\"position: relative; left:-22px; color: #888\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [HIDDEN] ".$fileAtts."</span></li>";
}
}
@@ -146,11 +146,18 @@ function php4_scandir($dir) {
<head>
<title>ICE Coder File Manager</title>
<link rel="stylesheet" type="text/css" href="lib/files.css">
<!--[if IE]>
<style type="text/css">
.fileManager LI.pft-directory:before, .fileManager LI.pft-file:before {
margin-top: -2px;
}
</style>
<![endif]-->
<script src="lib/coder.js" type="text/javascript"></script>
</head>
<body onLoad="top.ICEcoder.fileManager()" onDblClick="top.ICEcoder.openFile()" onKeyDown="return top.ICEcoder.interceptKeys('files', event);" onKeyUp="top.ICEcoder.resetKeys(event);">
<div onClick="top.ICEcoder.refreshFileManager()" class="refresh"><img src="images/file-manager-icons/refresh.png"></div>
<div onClick="top.ICEcoder.refreshFileManager()" class="refresh"><img src="images/refresh.png"></div>
<?php
echo fileManager($_SERVER['DOCUMENT_ROOT'], "[link]");
?>

BIN
images/blank.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 954 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 386 B

BIN
images/ice-coder.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

Before

Width:  |  Height:  |  Size: 752 B

After

Width:  |  Height:  |  Size: 752 B

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -93,7 +93,7 @@ lastOpenFiles = [<?php
<?php echo $pluginsDisplay; ?>
</div>
<div class="version"><?php echo $versionNo;?></div>
<img src="images/ice-coder.gif" class="logo" onClick="ICEcoder.helpScreen('show')" onContextMenu="ICEcoder.settingsScreen('show')">
<img src="images/ice-coder.png" class="logo" onClick="ICEcoder.helpScreen('show')" onContextMenu="ICEcoder.settingsScreen('show')">
</div>
<div id="files" class="files" onMouseOver="ICEcoder.changeFilesW('expand')" onMouseOut="ICEcoder.changeFilesW('contract'); top.document.getElementById('fileMenu').style.display='none';">
@@ -115,7 +115,7 @@ lastOpenFiles = [<?php
<a nohref title="Rename" onClick="ICEcoder.fMIcon('rename')"><img src="images/rename.png" alt="Rename" id="fMRename" style="margin: 9px 0 0 5px; opacity: 0.3"></a>
<a nohref title="View" onClick="ICEcoder.fMIcon('view')"><img src="images/view.png" alt="View" id="fMView" style="margin: 9px 0 0 5px; opacity: 0.3"></a>
</div>
<a nohref style="cursor: pointer" onClick="ICEcoder.lockUnlockNav()"><img src="images/file-manager-icons/padlock.png" id="fmLock" class="lock"></a>
<a nohref style="cursor: pointer" onClick="ICEcoder.lockUnlockNav()"><img src="images/padlock.png" id="fmLock" class="lock"></a>
</div>
<iframe id="filesFrame" class="frame" name="ff" src="files.php" style="opacity: 0" onLoad="this.style.opacity='1'"></iframe>
<div class="serverMessage" id="serverMessage"></div>
@@ -175,6 +175,7 @@ lastOpenFiles = [<?php
</div>
<script>
ICEcoder.initAliases();
ICEcoder.setLayout('dontSetEditor');
</script>

View File

@@ -1,9 +1,3 @@
// ICE coder by Matt Pass
// Free to use it for your own purposes, commercial or not, just let me know of any cool uses or customisations. :)
// No warranty or liability accepted for anything, all responsibility of use is your own.
// Latest version: https://github.com/mattpass/ICEcoder
// Twitter: @mattpass
var ICEcoder = {
// Define settings
filesW: 250, // Initial width of the files pane
@@ -33,15 +27,18 @@ var ICEcoder = {
// Don't consider these tags as part of nesting as they're singles, JS, PHP or Ruby code blocks
tagNestExceptions: ["!DOCTYPE","meta","link","img","br","hr","input","script","?php","?","%"],
// On load, set aliases, set the layout and get the nest location
init: function(login) {
// Set our aliases
initAliases: function() {
var aliasArray = ["header","files","account","accountLogin","fmLock","filesFrame","editor","tabsBar","findBar","content","footer","nestValid","nestDisplay","charDisplay"];
// Create our ID aliases
for (var i=0;i<aliasArray.length;i++) {
ICEcoder[aliasArray[i]] = top.document.getElementById(aliasArray[i]);
}
},
// On load, set the layout and get the nest location
init: function(login) {
// Set layout & the nest location
ICEcoder.setLayout();
@@ -65,15 +62,15 @@ var ICEcoder = {
// Apply sizes to various elements of the page
headerH = 40, footerH = 30, accountH = 50, tabsBarH = 21, findBarH = 28;
header.style.width = tabsBar.style.width = findBar.style.width = winW + "px";
files.style.width = accountLogin.style.width = editor.style.left = this.filesW + "px";
account.style.height = accountH + "px";
fmLock.style.marginLeft = (this.filesW-27) + "px";
filesFrame.style.height = (winH-headerH-accountH-footerH) + "px";
this.header.style.width = this.tabsBar.style.width = this.findBar.style.width = winW + "px";
this.files.style.width = this.accountLogin.style.width = this.editor.style.left = this.filesW + "px";
this.account.style.height = this.accountH + "px";
this.fmLock.style.marginLeft = (this.filesW-27) + "px";
this.filesFrame.style.height = (winH-headerH-accountH-footerH) + "px";
// If we need to set the editor sizes
if (!dontSetEditor) {
editor.style.width = ICEcoder.content.style.width = (winW-this.filesW) + "px";
this.editor.style.width = ICEcoder.content.style.width = (winW-this.filesW) + "px";
ICEcoder.content.style.height = (winH-headerH-footerH-tabsBarH-findBarH) + "px";
// Resize the CodeMirror instances to match the window size
@@ -400,7 +397,6 @@ var ICEcoder = {
cM = ICEcoder.getcMInstance('new');
ICEcoder.switchTab(ICEcoder.openFiles.length);
ICEcoder.content.style.visibility='visible';
cM.setLineClass(ICEcoder['cMActiveLine'+ICEcoder.selectedTab], null);
ICEcoder['cMActiveLine'+ICEcoder.selectedTab] = cM.setLineClass(0, "cm-s-activeLine");
@@ -559,7 +555,6 @@ var ICEcoder = {
// hide the content area if we have no tabs open
if (ICEcoder.openFiles.length==0) {
top.document.getElementById('content').style.visibility = "hidden";
top.ICEcoder.fMIconVis('fMView',0.3);
} else {
// Switch the mode & the tab
@@ -1001,7 +996,7 @@ var ICEcoder = {
lockIcon = top.document.getElementById('fmLock');
ICEcoder.lockedNav ? ICEcoder.lockedNav = false : ICEcoder.lockedNav = true;
ICEcoder.lockedNav ? lockIcon.src="images/file-manager-icons/padlock.png" : lockIcon.src="images/file-manager-icons/padlock-disabled.png";
ICEcoder.lockedNav ? lockIcon.src="images/padlock.png" : lockIcon.src="images/padlock-disabled.png";
},
// Determine the CodeMirror instance we're using on demand
@@ -1093,11 +1088,11 @@ var ICEcoder = {
var tempX, tempY, scrollTop, IE;
IE = document.all ? true : false;
if (!IE) {document.captureEvents(Event.MOUSEMOVE)};
if (IE) {
top.ICEcoder.mouseX = event.clientX + document.body.scrollLeft;
top.ICEcoder.mouseY = event.clientY + document.body.scrollTop;
top.ICEcoder.mouseX = e.clientX + document.body.scrollLeft;
top.ICEcoder.mouseY = e.clientY + document.body.scrollTop;
} else {
document.captureEvents(Event.MOUSEMOVE);
top.ICEcoder.mouseX = e.pageX;
top.ICEcoder.mouseY = e.pageY;
}
@@ -1437,6 +1432,10 @@ var ICEcoder = {
top.document.getElementById('loadingMask').style.visibility = "hidden";
if (loginAttempt) {
if (loginAttempt == "loginOK") {
if (top.ICEcoder.openFiles.length==0) {
top.ICEcoder.content.style.visibility='visible';
top.ICEcoder.content.src = "editor.php";
}
top.document.getElementById('accountLogin').style.top = "-50px";
setTimeout(function() {top.document.getElementById('accountLoginContainer').style.display = "none";},300);
} else {

View File

@@ -1,5 +1,5 @@
<?php
$versionNo = "v 0.6.9";
$versionNo = "v 0.7.0";
$codeMirrorDir = "CodeMirror-2.25";
$cMThisVer = 2.25;
$tabsIndent = true;

View File

@@ -263,7 +263,7 @@ if (action=="save") {
if ("undefined" != typeof newFileName) {
top.ICEcoder.serverMessage('<b>Saving</b><br>'+newFileName);
}
document.saveFile.contents.innerHTML = top.document.getElementById('saveTemp1').value;
document.saveFile.contents.value = top.document.getElementById('saveTemp1').value;
document.saveFile.submit();
} else {
top.ICEcoder.serverMessage();top.ICEcoder.serverQueue("del",0);

View File

@@ -29,36 +29,37 @@ body {margin: 0; overflow: auto}
user-select: none;
}
.fileManager span {font-family: helvetica, arial, swiss, verdana;}
.fileManager a {color: #eee; text-decoration: none;}
.fileManager .open {font-style: italic;}
.fileManager .closed {font-style: normal;}
.fileManager .pft-directory {list-style-image: url(../images/file-manager-icons/directory.png);}
.fileManager li {margin-left: 15px;}
.fileManager span {font-family: helvetica, arial, swiss, verdana}
.fileManager a {color: #eee; text-decoration: none}
.fileManager .open {font-style: italic}
.fileManager .closed {font-style: normal}
.fileManager .pft-directory, .fileManager .pft-file {list-style-image: url(../images/blank.gif)}
.fileManager li {margin-left: 15px}
/* Default file */
.fileManager LI.pft-file { list-style-image: url(../images/file-manager-icons/file.png); }
.fileManager LI.pft-directory:before, .fileManager LI.pft-file:before {
position: absolute; display: block; width: 16px; height: 16px; content: ""; margin-top: -19px; margin-left: -23px; background:url(../images/file-manager-icons.png) no-repeat 0 0;
}
.fileManager LI.pft-file:before {background-position: -16px 0}
/* Additional file types */
.fileManager LI.ext-coffee { list-style-image: url(../images/file-manager-icons/coffee.png); }
.fileManager LI.ext-css { list-style-image: url(../images/file-manager-icons/css.png); }
.fileManager LI.ext-doc { list-style-image: url(../images/file-manager-icons/doc.png); }
.fileManager LI.ext-gif { list-style-image: url(../images/file-manager-icons/gif.png); }
.fileManager LI.ext-htm { list-style-image: url(../images/file-manager-icons/html.png); }
.fileManager LI.ext-html { list-style-image: url(../images/file-manager-icons/html.png); }
.fileManager LI.ext-jpg { list-style-image: url(../images/file-manager-icons/jpg.png); }
.fileManager LI.ext-jpeg { list-style-image: url(../images/file-manager-icons/jpg.png); }
.fileManager LI.ext-js { list-style-image: url(../images/file-manager-icons/js.png); }
/*.fileManager LI.ext-pdf { list-style-image: url(../images/file-manager-icons/pdf.png); } */
.fileManager LI.ext-php { list-style-image: url(../images/file-manager-icons/php.png); }
.fileManager LI.ext-png { list-style-image: url(../images/file-manager-icons/png.png); }
.fileManager LI.ext-rb { list-style-image: url(../images/file-manager-icons/ruby.png); }
.fileManager LI.ext-rbx { list-style-image: url(../images/file-manager-icons/ruby.png); }
.fileManager LI.ext-rhtml { list-style-image: url(../images/file-manager-icons/ruby.png); }
.fileManager LI.ext-ruby { list-style-image: url(../images/file-manager-icons/ruby.png); }
/*.fileManager LI.ext-sql { list-style-image: url(../images/file-manager-icons/sql.png); } */
/*.fileManager LI.ext-swf { list-style-image: url(../images/file-manager-icons/swf.png); } */
.fileManager LI.ext-txt { list-style-image: url(../images/file-manager-icons/txt.png); }
/*.fileManager LI.ext-xls { list-style-image: url(../images/file-manager-icons/xls.png); } */
/*.fileManager LI.ext-xml { list-style-image: url(../images/file-manager-icons/xml.png); } */
/*.fileManager LI.ext-zip { list-style-image: url(../images/file-manager-icons/zip.png); } */
.fileManager LI.ext-coffee:before {background-position: -32px 0}
.fileManager LI.ext-css:before {background-position: -48px 0}
.fileManager LI.ext-gif:before {background-position: -64px 0}
.fileManager LI.ext-htm:before {background-position: -80px 0}
.fileManager LI.ext-html:before {background-position: -80px 0}
.fileManager LI.ext-jpg:before {background-position: -96px 0}
.fileManager LI.ext-jpeg:before {background-position: -96px 0}
.fileManager LI.ext-js:before {background-position: -112px 0}
/*.fileManager LI.ext-pdf:before {background-position: -???px 0} */
.fileManager LI.ext-php:before {background-position: -128px 0}
.fileManager LI.ext-png:before {background-position: -144px 0}
.fileManager LI.ext-rb:before {background-position: -160px 0}
.fileManager LI.ext-rbx:before {background-position: -160px 0}
.fileManager LI.ext-rhtml:before {background-position: -160px 0}
.fileManager LI.ext-ruby:before {background-position: -160px 0}
/*.fileManager LI.ext-sql:before {background-position: -???px 0} */
/*.fileManager LI.ext-swf:before {background-position: -???px 0} */
.fileManager LI.ext-txt:before {background-position: -176px 0}
/*.fileManager LI.ext-xml:before {background-position: -???px 0} */
.fileManager LI.ext-zip:before {background-position: -192px 0}

View File

@@ -55,7 +55,7 @@ if (isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['userLevel'] == 10) {
// Compile our new settings
$settingsContents = substr($settingsContents,0,$repPosStart).$settingsNew.substr($settingsContents,($repPosEnd),strlen($settingsContents));
// Now update the config file
$fh = fopen($settingsFile, 'w') or die("can't update settings file");
$fh = fopen($settingsFile, 'w') or die("Can't update config file. Please set public write permissions on lib/config.php");
fwrite($fh, $settingsContents);
fclose($fh);
@@ -82,7 +82,7 @@ if (isset($_GET["saveFiles"]) && $_GET['saveFiles']) {
$repPosEnd = strpos($settingsContents,'";',$repPosStart)-$repPosStart;
$settingsContents = substr($settingsContents,0,$repPosStart).$_GET['saveFiles'].substr($settingsContents,($repPosStart+$repPosEnd),strlen($settingsContents));
// Now update the config file
$fh = fopen($settingsFile, 'w') or die("can't update settings file");
$fh = fopen($settingsFile, 'w') or die("Can't update config file. Please set public write permissions on lib/config.php");
fwrite($fh, $settingsContents);
fclose($fh);
}
@@ -168,6 +168,11 @@ if ((isset($_POST["theme"]) && $_POST["theme"] && $_SESSION['userLevel'] == 10)
if ($openLastFiles) {
$onLoadExtras .= ";top.ICEcoder.autoOpenFiles()";
}
// Show server data if we're logged in
if ($_SESSION['userLevel'] == 10) {
$onLoadExtras .= ";top.ICEcoder.content.style.visibility='visible'";
}
}
// If we're due to show the settings screen
@@ -186,7 +191,7 @@ if ($accountPassword == "" && isset($_GET['settings'])) {
<div class="screenContainer">
<div class="screenVCenter">
<div class="screenCenter">
<img src="../images/ice-coder.gif">
<img src="../images/ice-coder.png">
<div class="version"><?php echo $versionNo;?></div>
<form name="settingsUpdate" action="../index.php" method="POST">
<input type="password" name="accountPassword" class="accountPassword">
@@ -212,7 +217,7 @@ if ($accountPassword == "" && isset($_GET['settings'])) {
// Replace our empty password with the one submitted by user
$settingsContents = str_replace('$accountPassword = "";','$accountPassword = "'.$password.'";',$settingsContents);
// Now update the config file
$fh = fopen($settingsFile, 'w') or die("can't update settings file");
$fh = fopen($settingsFile, 'w') or die("Can't update config file. Please set public write permissions on lib/config.php");
fwrite($fh, $settingsContents);
fclose($fh);
// Set the session user level