Last active
August 29, 2015 13:57
-
-
Save Petah/9650636 to your computer and use it in GitHub Desktop.
Raptor behind authorisation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php require_once 'path/to/bootstrap.php'; ?> | |
<html> | |
<body> | |
<div class="editable" data-id="body"> | |
<?= get_content('body'); ?> | |
</div> | |
<?php if (user_can_edit()): ?> | |
<script src="raptor.js"></script> | |
<script> | |
$('.editable').raptor({ | |
... | |
}); | |
</script> | |
<?php endif; ?> | |
</body> | |
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once 'path/to/bootstrap.php'; | |
if (!user_can_edit()) { | |
echo "You are not authorised to edit content."; | |
exit; | |
} | |
// save content here... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment