Some additions

This commit is contained in:
Lukas Bachschwell 2018-11-12 11:43:14 +01:00
parent 4d857daf5d
commit 3a616b0b5e
3 changed files with 18 additions and 6 deletions

View File

@ -19,3 +19,10 @@ To regenerate docs simply run `bee generate docs`
## Notes:
- Fixes have been placed into the beego orm for setting the timezone when using NewOrmWithDB()
## Management tools
- create databases,
- run different migrations on template and system
- run migrations on all company tables (list, connect, migrate)
- generate password

View File

@ -81,7 +81,7 @@ func (c *AuthController) Login() {
return
}
if password != userCompanyMapping.PasswordHash { // TODO: Hash me
if !tokenTools.CheckPasswordHash(password, userCompanyMapping.PasswordHash) {
c.ServeJSONError("Email/Password incorrect")
return
}

View File

@ -77,14 +77,19 @@ func GetDatabase(tokenString string) (jwt.MapClaims, *sql.DB, error) {
}
// CreateDatabase Create a database by copying the template
func CreateDatabase(token string) {
func CreateDatabase(companyName string) {
/*
db, err = sql.Open("postgres", "host=127.0.0.1 port=5435 user=postgres password=postgre dbname=company5 sslmode=disable")
if err != nil {
log.Fatal(err)
if dbs[companyName] != nil {
fmt.Println("DB Already open")
return dbs[companyName], nil
}
/*
db, err = sql.Open("postgres", "host=127.0.0.1 port=5435 user=postgres password=postgre dbname=company5 sslmode=disable")
if err != nil {
log.Fatal(err)
}
or, err := orm.NewOrmWithDB("postgres", "temp", db)
or, err := orm.NewOrmWithDB("postgres", "temp", db)
*/
}