Beispiel #1
0
func (c Admin) RemoveTopics(sid string, ids string) r.Result {
	c.Sess.GetSession(sid)
	if !c.Sess.IsAdmin() {
		return c.RenderNoAdmin()
	}

	tid := helpers.GetArrayFromString(ids)
	res, err := modules.NewTopic(c.Db, c.Rc).RemoveTopics(tid)

	return c.Render(res, err)
}
Beispiel #2
0
func (c Admin) RemoveUsers(sid string, ids string, withPost bool) r.Result {
	c.Sess.GetSession(sid)
	if !c.Sess.IsAdmin() {
		return c.RenderNoAdmin()
	}
	uid := helpers.GetArrayFromString(ids)

	res, err := modules.NewUser(c.Db).RemoveUsers(uid)
	if withPost {
		res, err = modules.NewTopic(c.Db, c.Rc).RemoveUsersTopics(uid)
	}
	return c.Render(res, err)
}