diff --git a/src/nera.lisp b/src/nera.lisp index ecaaeb6..9292fd6 100644 --- a/src/nera.lisp +++ b/src/nera.lisp @@ -16,7 +16,9 @@ #:create-user #:get-site-settings #:migrate-all - #:get-all-users)) + #:get-all-users + #:update-enable-sign-on-settings + #:set-home-page)) (in-package #:nera-db) (defparameter *tables* '(user site-settings) @@ -95,3 +97,18 @@ "Gets the settings for the website from the database." (with-connection (db) (mito:find-dao 'site-settings))) + +(defun update-enable-sign-on-settings (value) + "Updates the 'Enable Sign Up' setting in the database with `VALUE'." + (with-connection (db) + (let ((settings-to-update (mito:find-dao 'site-settings))) + (setf (site-settings::enable-sign-up-p settings-to-update) + (utils:checkbox-to-bool value)) + (mito:save-dao settings-to-update)))) + +(defun set-home-page (value) + "Sets the page (in /storage/pages) to be displayed on the sites home page." + (with-connection (db) + (let ((settings-to-update (mito:find-dao 'site-settings))) + (setf (site-settings::home-page-of settings-to-update) value) + (mito:save-dao settings-to-update))))