Skip to content

Commit

Permalink
mysql fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ubaldus committed Sep 28, 2024
1 parent 1954892 commit be9b1fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,17 +208,24 @@ func Run(eja TypeApi, sessionSave bool) (result TypeApi, err error) {
alert(&eja.Alert, db.Translate("ejaErrorEditId", eja.Owner))
} else {
for key, val := range eja.Values {
var value interface{}
fieldType := db.FieldTypeGet(eja.ModuleId, key)
switch fieldType {
case "password":
if len(val) != 64 {
val = db.Sha256(val)
value = db.Sha256(val)
}
case "boolean", "integer":
value = db.Number(val)
case "decimal":
value = db.Float(val)
default:
value = db.String(val)
}
if key == "ejaOwner" && db.Number(val) < 1 {
eja.Values["ejaOwner"] = db.String(eja.Owner)
} else {
db.Put(eja.Owner, eja.ModuleId, eja.Id, key, val)
db.Put(eja.Owner, eja.ModuleId, eja.Id, key, value)
}
}
values, err := db.Get(eja.Owner, eja.ModuleId, eja.Id)
Expand Down
2 changes: 1 addition & 1 deletion sys/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
package sys

const Name = "Tibula"
const Version = "17.9.27"
const Version = "17.9.28"

var Options TypeConfig
var Commands TypeCommand

0 comments on commit be9b1fd

Please sign in to comment.