Handbook
Glossary
<edit-user-action> ( -- action )
Vocabulary
webapps
.
user-admin
Inputs
None
Outputs
action
an
object
Definition
USING:
accessors
db.tuples
furnace.actions
furnace.auth
furnace.auth.providers
furnace.redirection
html.forms
kernel
sequences
urls
validators
;
IN:
webapps.user-admin
:
<edit-user-action>
( -- action )
<page-action>
[
validate-username
"username"
value
<user>
select-tuple
[
from-object
]
[
capabilities>>
select-capabilities
]
bi
init-capabilities
]
>>init
{
user-admin
"edit-user"
}
>>template
[
"username"
value
<user>
select-tuple
[
from-object
]
[
capabilities>>
select-capabilities
]
bi
init-capabilities
validate-capabilities
validate-user
{
{
"new-password"
[
[
v-password
]
v-optional
]
}
{
"verify-password"
[
[
v-password
]
v-optional
]
}
}
validate-params
"new-password"
"verify-password"
[
value
empty?
not
]
either?
[
same-password-twice
]
when
]
>>validate
[
"username"
value
<user>
select-tuple
"realname"
value
>>realname
"email"
value
>>email
selected-capabilities
>>capabilities
"new-password"
value
empty?
[
"new-password"
value
>>encoded-password
]
unless
update-tuple
URL" %24user-admin"
<redirect>
]
>>submit
;