Add check to make sure audit log location is writeable

Some cleanups
This commit is contained in:
Andy Dixon
2024-10-09 21:06:37 +01:00
parent 65331f905d
commit 9700ee807a
5 changed files with 43 additions and 27 deletions
+2 -2
View File
@@ -7,9 +7,9 @@ switch ($_REQUEST["action"]) {
header('Content-type: application/json');
if (!empty($_POST['uri']) && !empty($_POST['content'])) {
$_SESSION['core']->saveContent($_POST['uri'], $_POST['content']);
echo json_encode(array('message'=>'Page has been saved'));
echo json_encode(array('message' => 'Page has been saved'));
} else {
echo json_encode(array('error'=>'Unable to save page'));
echo json_encode(array('error' => 'Unable to save page'));
}
break;
+3 -1
View File
@@ -166,4 +166,6 @@ File List Modal
background-color: #e0e0e0;
}
.redText {
color: #ff4d4d;
}
+6 -1
View File
@@ -36,7 +36,12 @@ require_once "init.php";
</ul>
</div>
<div class="loggedInDetails">
Logged in as: <?php echo $_SESSION["core"]->getLoggedinUser(); ?>
Logged in as: <?php echo $_SESSION["core"]->getLoggedinUser(); ?><br />
<?php
if ( ! is_writable("logs/")) {
echo "<span style='redText'>Make /cms/logs/ writeable!</span>";
}
?>
</div>
</div>
<iframe id="frameContainer" src="welcome.html" class="frame"></iframe>
+16 -16
View File
@@ -24,22 +24,22 @@ $(document).ready(function () {
// Open the modal and init tinyMCE
$('#editModal').modal('show')
.on('shown.bs.modal', function () {
tinymce.init({
promotion: false,
branding: false,
selector: '#editor',
height: 300,
plugins: 'print preview paste importcss searchreplace autolink autosave save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists wordcount textpattern noneditable help charmap quickbars emoticons',
toolbar: 'undo redo | bold italic underline strikethrough | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview save print | insertfile image media template link anchor codesample | ltr rtl',
images_upload_url: '/cms/image_upload.php',
automatic_uploads: true,
images_reuse_filename: false,
images_upload_credentials: true,
force_br_newlines: false,
force_p_newlines: false,
newline_behavior: 'linebreak'
tinymce.init({
promotion: false,
branding: false,
selector: '#editor',
height: 300,
plugins: 'print preview paste importcss searchreplace autolink autosave save directionality code visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists wordcount textpattern noneditable help charmap quickbars emoticons',
toolbar: 'undo redo | bold italic underline strikethrough | fontselect fontsizeselect formatselect | alignleft aligncenter alignright alignjustify | outdent indent | numlist bullist | forecolor backcolor removeformat | pagebreak | charmap emoticons | fullscreen preview save print | insertfile image media template link anchor codesample | ltr rtl',
images_upload_url: '/cms/image_upload.php',
automatic_uploads: true,
images_reuse_filename: false,
images_upload_credentials: true,
force_br_newlines: false,
force_p_newlines: false,
newline_behavior: 'linebreak'
});
});
});
});
});
@@ -70,7 +70,7 @@ $(document).ready(function () {
// Handle Saving changes to the page
$('#savePage').click(() => {
frameContainerElement=$('#frameContainer').contents().get(0);
frameContainerElement = $('#frameContainer').contents().get(0);
$.post("/cms/controller/", {
action: "save",
uri: frameContainerElement.location.pathname,