Commit fd3bd4cd authored by Bas Lijnse's avatar Bas Lijnse

Small bugfixes

git-svn-id: https://svn.cs.ru.nl/repos/iTask-system/trunk@1164 63da3aa8-80fd-4f01-9db8-e6ea747a3da2
parent 4b0c3ec2
[["RegisteredUser",{"userName":"janine","password":["Password","j"],"displayName":"Janine Jackson","roles":null}],["RegisteredUser",{"userName":"bert","password":["Password","b"],"displayName":"Bert vd Wielen","roles":null}],["RegisteredUser",{"userName":"jim","password":["Password","j"],"displayName":"Jim Bakker","roles":null}],["RegisteredUser",{"userName":"martin","password":["Password","m"],"displayName":"Martin Tegelaar","roles":["IT Support","AV Service"]}],["RegisteredUser",{"userName":"jaqueline","password":["Password","j"],"displayName":"Jaqueline Havelaar","roles":["Catering"]}],["RegisteredUser",{"userName":"mirjam","password":["Password","m"],"displayName":"Mirjam Mulders","roles":["Secretary"]}],["RegisteredUser",{"userName":"sjaak","password":["Password","s"],"displayName":"Sjaak Polak","roles":["Program Committee"]}],["RegisteredUser",{"userName":"hans","password":["Password","h"],"displayName":"Hans Koopmans","roles":["Program Committee"]}],["RegisteredUser",{"userName":"janwillem","password":["Password","j"],"displayName":"Jan Willem Beentjes","roles":["Program Committee","Chair"]}]]
\ No newline at end of file
[{"userName":"janine","password":["Password","j"],"displayName":"Janine Jackson","roles":null},{"userName":"bert","password":["Password","b"],"displayName":"Bert vd Wielen","roles":null},{"userName":"jim","password":["Password","j"],"displayName":"Jim Bakker","roles":null},{"userName":"martin","password":["Password","m"],"displayName":"Martin Tegelaar","roles":["IT Support","AV Service"]},{"userName":"jaqueline","password":["Password","j"],"displayName":"Jaqueline Havelaar","roles":["Catering"]},{"userName":"mirjam","password":["Password","m"],"displayName":"Mirjam Mulders","roles":["Secretary"]},{"userName":"sjaak","password":["Password","s"],"displayName":"Sjaak Polak","roles":["Program Committee"]},{"userName":"hans","password":["Password","h"],"displayName":"Hans Koopmans","roles":["Program Committee"]},{"userName":"janwillem","password":["Password","j"],"displayName":"Jan Willem Beentjes","roles":["Program Committee","Chair"]}]
\ No newline at end of file
......@@ -151,7 +151,7 @@ userName (RegisteredUser details) = details.UserDetails.userName
userName _ = ""
displayName :: !User -> String
displayName RootUser = "Root"
displayName RootUser = "Root User"
displayName (RegisteredUser details) = details.UserDetails.displayName
displayName (NamedUser name)
| end > start && start > -1 = trim (name % (0,start - 1)) //Named user of form "Joe Smith <joe>" (with display name)
......@@ -212,9 +212,6 @@ JSONEncode{|User|} (RegisteredUser details) = [JSONString (details.displayName++
JSONEncode{|User|} (NamedUser username) = [JSONString username]
JSONEncode{|User|} (SessionUser session) = [JSONString ("Anonymous User <#"+++session+++">")]
import StdDebug, GenPrint
derive gPrint User, UserDetails, Maybe, Password
JSONDecode{|User|} [JSONString user:json]
# uname = extractUserName user
| uname == "root" = (Just RootUser, json)
......@@ -223,7 +220,7 @@ JSONDecode{|User|} [JSONString user:json]
| otherwise = (Just (NamedUser user), json)
where
extractUserName user
| end > start && start > -1 = trim (user % (start,end - 1))
| end > start && start > -1 = trim (user % (start + 1, end - 1))
| otherwise = user
where
start = indexOf "<" user
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment