User / Account model split, User and account now seperate entities, collaborators are now AccountUsers

This commit is contained in:
Torkel Ödegaard
2015-01-19 18:01:04 +01:00
parent f1996a9f1f
commit 90925273a0
29 changed files with 592 additions and 705 deletions
+5 -11
View File
@@ -32,24 +32,18 @@ var (
UseSQLite3 bool
)
type TestTable struct {
Id1 int `xorm:"pk"`
Id2 int `xorm:"pk"`
}
func init() {
tables = make([]interface{}, 0)
tables = append(tables, new(m.Dashboard),
new(m.Collaborator), new(m.DataSource), new(DashboardTag),
new(m.Token), new(TestTable))
tables = append(tables, new(m.Dashboard), new(m.DataSource), new(DashboardTag),
new(m.Token))
}
func EnsureAdminUser() {
adminQuery := m.GetAccountByLoginQuery{LoginOrEmail: setting.AdminUser}
adminQuery := m.GetUserByLoginQuery{LoginOrEmail: setting.AdminUser}
if err := bus.Dispatch(&adminQuery); err == m.ErrAccountNotFound {
cmd := m.CreateAccountCommand{}
if err := bus.Dispatch(&adminQuery); err == m.ErrUserNotFound {
cmd := m.CreateUserCommand{}
cmd.Login = setting.AdminUser
cmd.Email = setting.AdminUser + "@localhost"
cmd.Salt = util.GetRandomString(10)