Exemplo n.º 1
0
func (rcv *controller) delete() error {

	if err := account.Delete(rcv.loggedUser.Email, rcv.Local); err != nil {
		return err
	}

	return nil
}
Exemplo n.º 2
0
// Validate if the acccount is registered for
// activation.
func (rcv *controller) validate() error {

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

	// If account does not exists
	if rcv.store.Email == "" {
		return errors.New(rcv.Translate("text11"))
	}

	// If time for activating account is expired
	if time.Now().Unix() > rcv.store.Expired {
		// Delete registered user from neo4j
		maccount.Delete(rcv.store.Email, rcv.Local)
		return &expiredError{rcv.Controller}
	}

	return nil
}