1 structure ChooseDomain
:> CHOOSE_DOMAIN
= struct
5 val proc
= Unix
.execute ("/bin/sh", ["-c", "DOMTOOL_USER=hcoop /usr/local/bin/domtool-admin perms " ^ user
])
6 val inf
= Unix
.textInstreamOf proc
9 case TextIO.inputLine inf
of
12 case String.tokens (fn ch
=> ch
= #
":") line
of
13 ["domain", domains
] => String.tokens
Char.isSpace domains
17 before ignore (Unix
.reap proc
)
20 fun yourDomain
{user
, domain
} = List.exists (fn x
=> x
= domain
) (domains user
)