예제 #1
0
func (rcv *controller) serve() {

	rcv.formUser = &account{Controller: rcv.Controller}
	rcv.SetTitle("text06")

	switch rcv.Request.Method {
	case "GET":
		if err := rcv.get(); err != nil {
			notfound.Serve(rcv.Controller)
			return
		}
	case "POST":

		errs := rcv.post()
		if errs == nil {
			// If successfull process
			rcv.SetFlash("I", "text19")
			rcv.Redirect("/", 303)
			return
		}

		for _, e := range errs {
			rcv.AppendError(e)
		}

		rcv.get()
	}
	rcv.Render()
}
예제 #2
0
func (rcv *controller) serve() {

	rcv.SetTitle("text01")
	// Validate information for activating
	if err := rcv.validate(); err != nil {
		switch err.(type) {
		case *expiredError:
			rcv.RenderContentPart(expiredTmpl, err.Error())
		default:
			notfound.Serve(rcv.Controller)
			return
		}

	}

	if err := rcv.get(); err == nil {
		return
	}

	rcv.Render()

}