Пример #1
0
func UseCaptcha(db *periwinkle.Tx, id, token string) bool {
	o := GetCaptchaByID(db, id)
	if o == nil {
		panic("Captcha " + id + " does not exist.")
	}
	if strings.Compare(token, "true") == 0 {
		// destroy captcha
		db.Delete(&o)
		return true
	}
	// destroy captcha
	db.Delete(&o)
	return false
}
Пример #2
0
func (usr *User) Delete(db *periwinkle.Tx) {
	if err := db.Delete(usr).Error; err != nil {
		dbError(err)
	}
}
Пример #3
0
func (grp *Group) Delete(db *periwinkle.Tx) {
	if err := db.Delete(grp).Error; err != nil {
		dbError(err)
	}
}
Пример #4
0
func (o *Session) Delete(db *periwinkle.Tx) {
	db.Delete(o)
}