]> gitweb @ CieloNegro.org - Rakka.git/blobdiff - Rakka/SystemConfig.hs
implemented global lock
[Rakka.git] / Rakka / SystemConfig.hs
index eb526fbc45939a6863d2fc139fd2a45876f8138c..11fe124a155a62c4bcb4f8b4b28601f3804aca59 100644 (file)
@@ -12,6 +12,7 @@ module Rakka.SystemConfig
     , DefaultPage(..)
     , StyleSheet(..)
     , Languages(..)
+    , GlobalLock(..)
 
     , serializeStringPairs
     , deserializeStringPairs
@@ -209,3 +210,15 @@ instance SysConfValue Languages where
                                  , ("pt", "Português")
                                  , ("sv", "Svenska"  )
                                  ]
+
+
+newtype GlobalLock = GlobalLock Bool deriving (Show, Typeable)
+instance SysConfValue GlobalLock where
+    confPath _      = "globalLock"
+    serialize (GlobalLock isLocked)
+        | isLocked  = "*"
+        | otherwise = ""
+    deserialize "*" = Just (GlobalLock True)
+    deserialize ""  = Just (GlobalLock False)
+    deserialize _   = Nothing
+    defaultValue _  = GlobalLock False