forked from tildetown/town
WIP user creation
parent
4847c19eaf
commit
3940fe58ae
|
@ -244,12 +244,31 @@ func _main() error {
|
|||
s = s.SetString("cool, awesome, going to make your account now...")
|
||||
fmt.Println(s)
|
||||
|
||||
// TODO have enough to make account; can now do that
|
||||
if err = createUser(*data); err != nil {
|
||||
s = s.SetString(fmt.Sprintf(`augh, I'm sorry. the account creation failed.
|
||||
Please email root@tilde.town and paste the following error:
|
||||
|
||||
%s
|
||||
|
||||
Your invite code has not been marked as used and you're welcome to try again, though if there is a system issue you might need to wait for word from an admin.`, err.Error()))
|
||||
fmt.Println(s)
|
||||
return nil
|
||||
}
|
||||
|
||||
// TODO assuming account creation succeeded, mark invite as used
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func createUser(data newUserData) error {
|
||||
// TODO adduser
|
||||
// TODO add to town group
|
||||
// TODO create keyfile by running helper (helper should also make ~/.ssh)
|
||||
// TODO generate welcome gift
|
||||
// TODO any alerts
|
||||
return errors.New("not implemented")
|
||||
}
|
||||
|
||||
func main() {
|
||||
// TODO friendlier error handling
|
||||
err := _main()
|
||||
|
|
Loading…
Reference in New Issue