aboutsummaryrefslogtreecommitdiff
path: root/mod/sitepages/actions/addfront.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/sitepages/actions/addfront.php')
-rw-r--r--mod/sitepages/actions/addfront.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/mod/sitepages/actions/addfront.php b/mod/sitepages/actions/addfront.php
index fd2154cc3..f92d4614d 100644
--- a/mod/sitepages/actions/addfront.php
+++ b/mod/sitepages/actions/addfront.php
@@ -15,6 +15,12 @@ admin_gatekeeper();
$logged_in_content = get_input('logged_in_content', '', FALSE);
$logged_out_content = get_input('logged_out_content', '', FALSE);
+// do some error checking to make sure you can't lock yourself out of your front page.
+if (FALSE === strpos($logged_out_content, '[[login_box')) {
+ register_error(elgg_echo('sitepages:error:no_login'));
+ forward($_SERVER['HTTP_REFERER']);
+}
+
$css = get_input('css', '', FALSE);
$loggedin_user_guid = get_loggedin_userid();