mirror of https://github.com/mindoc-org/mindoc.git
fix(login): judging ldap_enable logic error
review: https://github.com/mindoc-org/mindoc/pull/662#discussion_r603750715pull/662/head
parent
94c233c03a
commit
bdaeefc784
|
@ -25,6 +25,7 @@ database
|
||||||
*.test
|
*.test
|
||||||
*.prof
|
*.prof
|
||||||
.idea
|
.idea
|
||||||
|
.vscode
|
||||||
/conf/app.conf
|
/conf/app.conf
|
||||||
/vendor
|
/vendor
|
||||||
/runtime
|
/runtime
|
||||||
|
|
|
@ -114,8 +114,8 @@ func RunMigration() {
|
||||||
|
|
||||||
//导出数据库的表结构
|
//导出数据库的表结构
|
||||||
func ExportDatabaseTable() ([]string, error) {
|
func ExportDatabaseTable() ([]string, error) {
|
||||||
dbadapter,_ := web.AppConfig.String("db_adapter")
|
dbadapter, _ := web.AppConfig.String("db_adapter")
|
||||||
dbdatabase,_ := web.AppConfig.String("db_database")
|
dbdatabase, _ := web.AppConfig.String("db_database")
|
||||||
tables := make([]string, 0)
|
tables := make([]string, 0)
|
||||||
|
|
||||||
o := orm.NewOrm()
|
o := orm.NewOrm()
|
||||||
|
|
|
@ -118,7 +118,7 @@ func (m *Member) TmpLogin(account string) (*Member, error) {
|
||||||
|
|
||||||
//ldapLogin 通过LDAP登陆
|
//ldapLogin 通过LDAP登陆
|
||||||
func (m *Member) ldapLogin(account string, password string) (*Member, error) {
|
func (m *Member) ldapLogin(account string, password string) (*Member, error) {
|
||||||
if web.AppConfig.DefaultBool("ldap_enable", false) {
|
if !web.AppConfig.DefaultBool("ldap_enable", false) {
|
||||||
return m, ErrMemberAuthMethodInvalid
|
return m, ErrMemberAuthMethodInvalid
|
||||||
}
|
}
|
||||||
var err error
|
var err error
|
||||||
|
|
Loading…
Reference in New Issue