Browse Source

implement update-enable-sign-on-settings and set-home-page in nera.

stable
Craig Oates 2 years ago
parent
commit
6d4d16ec45
  1. 19
      src/nera.lisp

19
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))))

Loading…
Cancel
Save