Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.96 KB | None | 0 0
  1. <?php
  2. <?php
  3. session_start();
  4.  
  5. if(isset($_GET['logout']))
  6. {
  7. session_destroy();
  8. session_start();
  9. }
  10. ?>
  11. <!-- TinyMCE -->
  12. <script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
  13. <script type="text/javascript">
  14. tinyMCE.init({
  15. // General options
  16. mode : "textareas",
  17. theme : "advanced",
  18. plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
  19.  
  20. // Theme options
  21. theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
  22. theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
  23. theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
  24. theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
  25. theme_advanced_toolbar_location : "top",
  26. theme_advanced_toolbar_align : "left",
  27. theme_advanced_statusbar_location : "bottom",
  28. theme_advanced_resizing : true,
  29.  
  30. // Example content CSS (should be your site CSS)
  31. content_css : "css/content.css",
  32.  
  33. // Drop lists for link/image/media/template dialogs
  34. template_external_list_url : "lists/template_list.js",
  35. external_link_list_url : "lists/link_list.js",
  36. external_image_list_url : "lists/image_list.js",
  37. media_external_list_url : "lists/media_list.js",
  38.  
  39. // Style formats
  40. style_formats : [
  41. {title : 'Bold text', inline : 'b'},
  42. {title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
  43. {title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
  44. {title : 'Example 1', inline : 'span', classes : 'example1'},
  45. {title : 'Example 2', inline : 'span', classes : 'example2'},
  46. {title : 'Table styles'},
  47. {title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
  48. ],
  49.  
  50. // Replace values for the template plugin
  51. template_replace_values : {
  52. username : "Some User",
  53. staffid : "991234"
  54. }
  55. });
  56. </script>
  57. <!-- /TinyMCE -->
  58. <?php
  59.  
  60. if (isset($_POST['submitUpdate'])) {
  61. if (get_magic_quotes_gpc()) {
  62. $_POST = array_map('stripslashes',$_POST);
  63. }
  64. $fc = file_get_contents($_POST['file']);
  65. // truncate file
  66. $fw = fopen($_POST['file'], 'w+');
  67. $text = explode("<!-- EDITABLE -->",$fc);
  68. $newText = $text[0]."<!-- EDITABLE -->".htmlentities($_POST['content'])."<!--EDITABLE ->".$text[2];
  69. if (fwrite($fw, $newText)===FALSE) {
  70. die("Cannot write to file.");
  71. }
  72. fclose($fw);
  73. exit("<div><span class='redText'>The file has been updated. Click <a href=\"admin.php\">here</a> to go back to admin page.</div>");
  74. }
  75.  
  76. if (isset($_POST['Submit'])) {
  77. if (($_POST['username'] == 'admin') && ($_POST['passwd'] == 'x638cdk')) {
  78. $_SESSION['username'] = 'login';
  79. }
  80. else {
  81. echo "<b>Your login details are not correct. Please try again</b>";
  82. }
  83. }
  84.  
  85. if ($_SESSION['username']=='login') {
  86. if (isset($_REQUEST['file'])) {
  87. $fc = file_get_contents($_REQUEST['file']);
  88. $text = explode("<!– EDITABLE –>",$fc);
  89. echo "<form method='post' action=''><textarea id=\"elm1\" name=\"elm1\" rows=\"15\" cols=\"80\" style=\"width: 80%\">$text[1]</textarea>";
  90. echo "</div>
  91.  
  92. <!-- Some integration calls -->
  93. <a href=\"javascript:;\" onclick=\"tinyMCE.get('elm1').show();return false;\">[Show]</a>
  94. <a href=\"javascript:;\" onclick=\"tinyMCE.get('elm1').hide();return false;\">[Hide]</a>
  95. <a href=\"javascript:;\" onclick=\"tinyMCE.get('elm1').execCommand('Bold');return false;\">[Bold]</a>
  96. <a href=\"javascript:;\" onclick=\"alert(tinyMCE.get('elm1').getContent());return false;\">[Get contents]</a>
  97. <a href=\"javascript:;\" onclick=\"alert(tinyMCE.get('elm1').selection.getContent());return false;\">[Get selected HTML]</a>
  98. <a href=\"javascript:;\" onclick=\"alert(tinyMCE.get('elm1').selection.getContent({format : 'text'}));return false;\">[Get selected text]</a>
  99. <a href=\"javascript:;\" onclick=\"alert(tinyMCE.get('elm1').selection.getNode().nodeName);return false;\">[Get selected element]</a>
  100. <a href=\"javascript:;\" onclick=\"tinyMCE.execCommand('mceInsertContent',false,'<b>Hello world!!</b>');return false;\">[Insert HTML]</a>
  101. <a href=\"javascript:;\" onclick=\"tinyMCE.execCommand('mceReplaceContent',false,'<b>{$selection}</b>');return false;\">[Replace selection]</a>
  102.  
  103. <br />
  104. <input type=\"submit\" name=\"save\" value=\"Submit\" />
  105. <input type=\"reset\" name=\"reset\" value=\"Reset\" />
  106. </div>
  107. </form>";
  108. }
  109. else {
  110. // edit to link to your own static html files
  111. echo "
  112. <h1><a href=\"/\">View Site</a> | <a href=\"?logout\">Logout</a></h1>
  113. <em>Click on the links below to edit the files.</em><br/><br/>
  114. <p align='left'>
  115. <a href=\"?file=../home/pages/home.php\">Home Page</a><br/>
  116. <hr>
  117. <a href=\"?file=../home/pages/welcome/home.php\">Welcome Home</a><br/>
  118. <a href=\"?file=../home/pages/welcome/about.php\">About Ruach</a><br/>
  119. <a href=\"?file=../home/pages/welcome/declaration-of-faith.php\">Declaration of Faith</a><br/>
  120. <a href=\"?file=../home/pages/welcome/governance.php\">Governance</a><br/>
  121. <a href=\"?file=../home/pages/welcome/partnership.php\">Partnership</a><br/>
  122. <hr>
  123. <a href=\"?file=../home/pages/ministries/aol.php\">Academy of Learning</a><br/>
  124. <a href=\"?file=../home/pages/ministries/creative-arts.php\">Creative Arts</a><br/>
  125. <a href=\"?file=../home/pages/ministries/global.php\">Global Ministry</a><br/>
  126. <a href=\"?file=../home/pages/ministries/hospitality.php\">Hospitality Ministry</a><br/>
  127. <a href=\"?file=../home/pages/ministries/outreach.php\">Outreach Ministry</a><br/>
  128. <a href=\"?file=../home/pages/ministries/social-care.php\">Social Care Ministry</a><br/>
  129. <a href=\"?file=../home/pages/ministries/spiritual-mediation.php\">Spiritual Mediation</a><br/>
  130. <a href=\"?file=../home/pages/ministries/youth.php\">Youth Ministry</a><br/>
  131. <hr>
  132. <a href=\"?file=../home/pages/contact/home.php\">Contact Home</a><br/>
  133. <a href=\"?file=../home/pages/contact/directions.php\">Directions</a><br/>
  134. <hr>
  135. <a href=\"?file=/home/pages/missions/home.php\">Missions</a>
  136. </p>";
  137. }
  138. }
  139. if(!$_SESSION['username'])
  140. {
  141. ?>
  142. <div align="center"><img src="images/cms-title.png" border="0" alt=""></div>
  143. <form method="post" action="">
  144. <table width="400" border="0" align="center" cellpadding="2" cellspacing="2">
  145. <tr>
  146. <td width="73">Username: </td>
  147. <td width="313"><input type="text" name="username"></td>
  148. </tr>
  149. <tr>
  150. <td>Password: </td>
  151. <td><input type="password" name="passwd"></td>
  152. </tr>
  153. <tr>
  154. <td>&nbsp;</td>
  155. <td><input type="submit" name="Submit" class="btn" value="Submit">&nbsp;&nbsp; <input type="reset" name="reset" class="btn" value="Reset">
  156. </td>
  157. </tr>
  158. </table>
  159. </form>
  160. <?php
  161. }
  162. ?>
  163.  
  164. <style>
  165. body{
  166. font-family: Arial, Helvetica, sans-serif;
  167. font-size: 12px;
  168. color: #000000;
  169. margin-top: 20px;
  170. }
  171.  
  172. a{
  173. color: #639;
  174. text-decoration: underline;
  175. }
  176.  
  177. a:hover{
  178. text-decoration: none;
  179. }
  180.  
  181. h1{
  182. font-size: 16px;
  183. }
  184.  
  185. table{
  186. font-family: Arial, Helvetica, sans-serif;
  187. font-size: 12px;
  188. color: #000000;
  189. margin-top: 20px;
  190. }
  191.  
  192. input{
  193. width: 300px;
  194. height: 25px;
  195. background: #FFFFFF;
  196. border: 1px solid #999;
  197. padding: 5px;
  198. }
  199.  
  200. .btn{
  201. width: auto;
  202. background: #CCC;
  203. }
  204.  
  205. hr{
  206. color: #fff;
  207. background-color: #fff;
  208. height: 1px;
  209. border: 0;
  210. }
  211. </style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement