user signup can now be disabled
This commit is contained in:
parent
d4c8ac6d42
commit
e226802379
2 changed files with 57 additions and 45 deletions
|
@ -8,13 +8,21 @@ import Data.Maybe
|
|||
|
||||
getSignupR :: Handler Html
|
||||
getSignupR = do
|
||||
-- (signupWidget, enctype) <- generateFormPost signupForm
|
||||
block <- fmap extraSignupBlocked appExtra
|
||||
case block of
|
||||
False -> do
|
||||
defaultLayout $ do
|
||||
setTitle "Eidolon :: Signup"
|
||||
$(widgetFile "signup")
|
||||
True -> do
|
||||
setMessage "User signup has been disabled"
|
||||
redirect $ HomeR
|
||||
|
||||
postSignupR :: Handler Html
|
||||
postSignupR = do
|
||||
block <- fmap extraSignupBlocked appExtra
|
||||
case block of
|
||||
False -> do
|
||||
mUserName <- lookupPostParam "username"
|
||||
newUserName <- case validateLen (fromJust mUserName) of
|
||||
True -> return $ fromJust $ mUserName
|
||||
|
@ -57,6 +65,9 @@ postSignupR = do
|
|||
_ -> do
|
||||
setMessage "This user already exists"
|
||||
redirect $ SignupR
|
||||
True -> do
|
||||
setMessage "User signup is disabled"
|
||||
redirect $ HomeR
|
||||
|
||||
validateLen :: Text -> Bool
|
||||
validateLen a =
|
||||
|
|
|
@ -3,7 +3,8 @@ Default: &defaults
|
|||
port: 3000
|
||||
approot: "http://localhost:3000"
|
||||
copyright: Insert copyright statement here
|
||||
#analytics: UA-YOURCODE
|
||||
#enter only True or False
|
||||
signupBlocked: False
|
||||
|
||||
Development:
|
||||
<<: *defaults
|
||||
|
|
Loading…
Reference in a new issue