Graphic Bar
They said you were paranoid, I say your not enough.
Graphic Bar


About

This is a On-Host text file editor, that can be used to edit any type of file that can be edited as ASCII Text. You can use this to edit, and save HTML, PHP, TXT, etc files on-host and save them on-host without downloading.
This is also Password-Protected to deter misuse.

NOTE: Some files which do not contain ACSII character that are mis-read, may be corrupt when saving. Be sure to keep backups of files. Also, when saving, files on Linux Servers must be CHMOD'd properly in order to save. The same applies when editing XeDit internally within the interface.

Screenshots


EDITED: As of Version 5, password variable contained inside xedit file is encrypted.
1. The real password cannot be viewed inside the XeDit file. Only an encryption hash. You must change password within the user intaeface or manually with MD5 encryption hash of your password.

EDITED: As of Version 4.2, less errors are displayed by PHP when an error occurs.
1. Error was fixed that caused file not to display in textarea

EDITED: As of Version 4.1, less errors are displayed by PHP when an error occurs.
1. If a file is not CHMOD'd or not able to be written to, XeDit displays a error and supresses the PHP error.
2. If a file exists, yet does not read, the system will display an error instead of PHP.
3. The notice that is displayed in case a file does not exist, is now shown as default font color, to be easier to see.
4. An error is displayed if the system is not able to edit the XeDit file for settings modification.
5. Default body font color changed to make PHP errors easier to see if they do occur. And modification of XeDit would be easier this way.


Features


* Text editing area enlarges to fit the current browser window (This also now works in IE), thanks to coding from Paul Wratt..

* Edit authentication details within the interface in the settings section.

* Edit color theme within the interface in settings section.

* Editor can create file on save if it does not exist.

* Editor will now login with IE without problem. Previous time setting of 1 hour default caused issues. Editor will now login for default 24 hours (86400 seconds)


Instruction


* Copy the script below.
* Paste into a blank text file.
* Name the text file to your liking.
* Change Username, Password & Encryption Key in the code. (Unless you wish to do it within the interface.)
* Upload to your web server.
* Go to the location of the editor.
* Login to the editor with the default username and password.
* Click Settings, and modify authentication and Color theme if desired.


Default Username: admin
Default Password: password ($password="5f4dcc3b5aa765d61d8327deb882cf99";)


CHMOD Settings

I have to strongly note, that is required that files being read or saved be properly CHMOD'd... Otherwise the process will fail.


Script


<?php
###################################
##
## XeDit 5 - File Editor
## Xegment Delta Edit
## By XegmentDelta
##
## XegmentDelta.net/works-agreement
##
###################################


###################################
### Special Thanks To Paul Wratt
### For Assistance On This Editor
###################################


###################################
### Authentication
$username="admin";
$password="5f4dcc3b5aa765d61d8327deb882cf99";
$encrypt_key="1234567890";
###################################


###################################
### Color Theme
$xedit_text_color="#ffffff";
$xedit_link_color="#ffffff";
$xedit_module_color="#cc9900";
$xedit_module_border_color="#ff9933";
$xedit_background_color="#336600";
###################################


###################################
### HTML Start
$htmlstart="
<html>
<head>
<title>XeDit 5 - Text Editor</title>
<meta name=\"ROBOTS\" content=\"NOINDEX, NOFOLLOW\">
<style type=\"text/css\">
body {background-color:".$xedit_background_color.";color:".$xedit_text_color."; font: bold 13px Verdana}
#module {background-color:".$xedit_module_color.";border-width:1px;border-color:".$xedit_module_border_color.";border-style:solid;padding:8px;}
a {color:".$xedit_link_color.";font: bold 13px Verdana}
p, div {color:".$xedit_text_color."; font: bold 13px Verdana}
.h2 {color:".$xedit_text_color.";font: bold 23px Verdana}
select, input, textarea {background-color:".$xedit_background_color."!important;color:".$xedit_text_color."; font: 14px \"Verdana\"}
</style>
</head>
<body onResize=fixResize()>
<table width=\"100%\">
<td width=\"50%\">
   <div style=\"color:".$xedit_text_color."; font: bold 34px Verdana;\">XeDit</div>
   <div>File&nbsp;Editor&nbsp;5</div>
</td>
<td valign=\"top\" width=\"50%\">
   <div style=\"vertical-alignment:bottom;\" align=\"right\">
   <div><a href=\"".$_SERVER['PHP_SELF']."\">Main</a></div>
   <div><a href=\"".$_SERVER['PHP_SELF']."?p=settings\">Settings</a></div>
   <div><a href=\"".$_SERVER['PHP_SELF']."?p=logout\">Log Out</a></div>
   <div><a href=\"http://xegmentdelta.com/works-agreement\">&copy;&nbsp;XegmentDelta</a></div>
   </div>
</td>
</table>";
function xedit_quick_display($display){
global $htmlstart;
echo $htmlstart;
?>
<br>
<br>
<br>
<br>
<center>
<table id="module">
<td align="center">
   <?php echo $display; ?>
</td>
</table>
</center>
</body>
</html>
<?php
exit();
}
###################################


###################################
### Logout Protocol
if($_GET['p']=="logout"){
setcookie("XeDit", "Logout",time()-86400);
xedit_quick_display("<div class=\"h2\">Logged Out</div>");
}
###################################


###################################
### Check Login
if(isset($_COOKIE['XeDit'])){
if($_COOKIE['XeDit']==md5($password.$encrypt_key)){
###################################


###################################
### Open File
if($_GET['p']=="open"){
if(!isset($_POST['file'])||$_POST['file']==""){
xedit_quick_display("<div class=\"h2\">Please Enter A File Path To Open...</div>");
}else{
header("Location: ".$_SERVER['PHP_SELF']."?p=file&l=".$_POST['file']);
exit();
}
}
if($_GET['p']=="file")
if(file_exists($_GET['l'])){
@$xedit_retrieved_contents=file_get_contents($_GET['l']) or xedit_quick_display("<div class=\"h2\">File Read Error</div><br><div>The file specified has been detected to exist, however there was an error while reading it. Perhaps the CHMOD permissions are not set properly.</div>");
}
###################################


###################################
### Save File
if($_GET['p']=="save"){
if($_POST['file']==null)
xedit_quick_display("<div class=\"h2\">Error: File Not Specified</div>");
if(get_magic_quotes_gpc())
$data=stripslashes($_POST['info']);
else
$data = $_POST['info'];
@file_put_contents($_POST['file'],$data) or xedit_quick_display("<div class=\"h2\">Unable to save file...</div><br><div>Perhaps the file is not properly CHMOD'd...</div>");
xedit_quick_display("<div class=\"h2\">File Saved...</div><br><div><a href=\"".$_POST['file']."\">Click Here</a> to visit saved file.</div><br><div><a href=\"".$_SERVER['PHP_SELF']."\">Click Here</a> to goto XeDit Main.</div>");
}
###################################


###################################
### Settings Section
if($_GET['p']=="settings"){
xedit_quick_display("<div class=\"h2\">Change Authentication</div><form method=\"post\" action=\"".$_SERVER['PHP_SELF']."?p=authentication\"><div>Username:</div><div><input name=\"name\" type=\"text\" value=\"".$username."\" size=\"25\"></div><br><div>Password:</div><div><input type=\"password\" name=\"pass\" value=\"".$password."\" size=\"25\"></div><br><div>Encryption Key:</div><div><input type=\"text\" name=\"encrypt_key\" value=\"".$encrypt_key."\" size=\"25\"></div><br><div><input type=\"submit\" onclick=\"return alert('You may be alerted to a bad cookie. If this occurs, please click logout or clear your cookies and re-login.')\" value=\" Modify \"></div></form><br><br><div class=\"h2\">Change Color Theme</div><form method=\"post\" action=\"".$_SERVER['PHP_SELF']."?p=colortheme\"><div>Text Color</div><div><input name=\"xedit_text_color\" type=\"text\" value=\"".$xedit_text_color."\" size=\"7\"></div><br><div>Link Color</div><div><input name=\"xedit_link_color\" type=\"text\" value=\"".$xedit_link_color."\" size=\"7\"></div><br><div>Module Background Color</div><div><input name=\"xedit_module_color\" type=\"text\" value=\"".$xedit_module_color."\" size=\"7\"></div><br><div>Module Border Color</div><div><input name=\"xedit_module_border_color\" type=\"text\" value=\"".$xedit_module_border_color."\" size=\"7\"></div><br><div>Background Color</div><div><input name=\"xedit_background_color\" type=\"text\" value=\"".$xedit_background_color."\" size=\"7\"></div><br><div><input type=\"submit\" onclick=\"return alert('Changes to color theme may not seem instantly apparent, however after returning to main, changes should be visible.')\" value=\" Modify \"></div></form>");}
###################################


###################################
### Modify Authentication
if($_GET['p']=="authentication"){
$contents=file_get_contents(basename(__FILE__));
$contents=str_replace("username=\"".$username,"username=\"".$_POST['name'],$contents);
$contents=str_replace("password=\"".$password,"password=\"".md5($_POST['pass']),$contents);
$contents=str_replace("encrypt_key=\"".$encrypt_key,"encrypt_key=\"".$_POST['encrypt_key'],$contents);
@file_put_contents(basename(__FILE__),$contents) or xedit_quick_display("<div class=\"h2\">Modification Error</div><br><div>While attempting to save changes to this file, an error occured. It is possible XeDit is not properly CHMOD'd, or an error has made this file not writable by XeDit.</div>");
xedit_quick_display("<div class=\"h2\">Modification Complete</div>");
}
###################################


###################################
### Modify Color Theme
if($_GET['p']=="colortheme"){
$contents=file_get_contents(basename(__FILE__));
$contents=str_replace("xedit_text_color=\"".$xedit_text_color,"xedit_text_color=\"".$_POST['xedit_text_color'],$contents);
$contents=str_replace("xedit_link_color=\"".$xedit_link_color,"xedit_link_color=\"".$_POST['xedit_link_color'],$contents);
$contents=str_replace("xedit_module_color=\"".$xedit_module_color,"xedit_module_color=\"".$_POST['xedit_module_color'],$contents);
$contents=str_replace("xedit_module_border_color=\"".$xedit_module_border_color,"xedit_module_border_color=\"".$_POST['xedit_module_border_color'],$contents);
$contents=str_replace("xedit_background_color=\"".$xedit_background_color,"xedit_background_color=\"".$_POST['xedit_background_color'],$contents);
@file_put_contents(basename(__FILE__),$contents) or xedit_quick_display("<div class=\"h2\">Modification Error</div><br><div>While attempting to save changes to this file, an error occured. It is possible XeDit is not properly CHMOD'd, or an error has made this file not writable by XeDit.</div>");
xedit_quick_display("<div class=\"h2\">Modification Complete</div>");
}
###################################


###################################
### Main Display
echo $htmlstart;
?>
<center>
<table id="module">
<td align="center" width="300">
   <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?p=open">
   <div class="h2">Open File...</div>
   <div>"file.php" | "folder/file.php"</div>
   <div><input name="file" type="text" value="<?php echo $_GET['l']; ?>" size="25"></div>
   <br>
   <div><input type="submit" value=" Open "></div>
   </form>
</td>
</table>
<br>
<table id="module">
<td align="center" width="950">
   <table>
   <td>
      <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?p=save">
      <div class="h2">File Editor<?php if(isset($_GET['l'])) echo " | \"".$_GET['l']."\""; ?></div>
      <?php
      if (isset($_GET['l'])&&!file_exists($_GET['l']))
      echo "<p style=\"color:".$xedit_text_color.";font-size:15px;\">File Not Found - Will Attempt To Create On Save</p>";
      ?>
      <input name="file" type="hidden" value="<?php echo $_GET['l']; ?>">
      <div><textarea wrap="off" id="dataBox" name="info" rows="20" cols="105" style="width: expression(document.body.clientWidth-20); height: expression(document.body.clientHeight-40);"><?php if($_GET['p']=="file") echo htmlentities($xedit_retrieved_contents); ?></textarea></div>
      <script language=JavaScript>
      function fixResize(){
      if (window.innerHeight){
      xObj = document.getElementById('dataBox');
      xObj.style.width = window.innerWidth-80;
      xObj.style.height = window.innerHeight-82;
      }}
      fixResize();
      </script>
      <br>
      <div align="right"><input type="submit" value=" Save "></div>
      </form>
   </td>
   </table>
</td>
</table>
</center>
</body>
</html>
<?php
exit();
###################################


###################################
### Bad Cookie
}else{
xedit_quick_display("<div class=\"h2\">Bad cookie. Please click logout, or clear cookies and try again.</div>");
}
###################################


###################################
### End Login Check
}
###################################


###################################
### Login Protocols
if($_GET['p']=="login"){
if($_POST['name']!==$username||md5($_POST['pass'])!==$password){
xedit_quick_display("<div class=\"h2\">Incorrect Username/Password.</div>");
}elseif($_POST['name']==$username&&md5($_POST['pass'])==$password){
setcookie('XeDit',md5(md5($_POST['pass']).$encrypt_key),time()+86400);
header("Location: $_SERVER[PHP_SELF]");
}else{
xedit_quick_display("<div class=\"h2\">You could not be logged in. Please refresh page and try again.</div>");
}
}
###################################


###################################
### Login Display
echo $htmlstart;
?>
<br>
<br>
<br>
<br>
<center>
<table id="module">
<td width="425" height="250" align="center">
   <table>
   <td align="center">
      <div class="h2" align="right">Login</div>
      <br>
      <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>?p=login">
      <input type="hidden" name="action" value="login">
      <table>
      <td>
         <div>Username:</div>
         <div><input name="name" type="text" size="25"></div>
         <br>
         <div>Password:</div>
         <input type="password" name="pass" size="25"></div>
      </td>
      </table>
      <br>
      <div align="center"><input type="submit" value=" Login "></div>
      </form>
   </td>
   </table>
</td>
</table>
</center>
</body>
</html>
Copyright © XegmentDelta And Respective Owners.
Processed: 0.25 Sec | 778,492 Hits | 12 Users Online
Website Design & Implementation By D3xt3r
XegmentDelta Network Powered By X.D.D and ChemicalServers