mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
execute provider events also for plugin auth
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -4487,6 +4487,7 @@ func doExternalAuth(username, password string, pubKey []byte, keyboardInteractiv
|
|||||||
webDAVUsersCache.swap(&user, password)
|
webDAVUsersCache.swap(&user, password)
|
||||||
}
|
}
|
||||||
cachedUserPasswords.Add(user.Username, password, user.Password)
|
cachedUserPasswords.Add(user.Username, password, user.Password)
|
||||||
|
executeAction(operationUpdate, ActionExecutorSelf, "", actionObjectUser, user.Username, "", &user)
|
||||||
}
|
}
|
||||||
return user, err
|
return user, err
|
||||||
}
|
}
|
||||||
@@ -4494,6 +4495,7 @@ func doExternalAuth(username, password string, pubKey []byte, keyboardInteractiv
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return user, err
|
return user, err
|
||||||
}
|
}
|
||||||
|
executeAction(operationAdd, ActionExecutorSelf, "", actionObjectUser, user.Username, "", &user)
|
||||||
return provider.userExists(user.Username, "")
|
return provider.userExists(user.Username, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4559,6 +4561,7 @@ func doPluginAuth(username, password string, pubKey []byte, ip, protocol string,
|
|||||||
webDAVUsersCache.swap(&user, password)
|
webDAVUsersCache.swap(&user, password)
|
||||||
}
|
}
|
||||||
cachedUserPasswords.Add(user.Username, password, user.Password)
|
cachedUserPasswords.Add(user.Username, password, user.Password)
|
||||||
|
executeAction(operationUpdate, ActionExecutorSelf, "", actionObjectUser, user.Username, "", &user)
|
||||||
}
|
}
|
||||||
return user, err
|
return user, err
|
||||||
}
|
}
|
||||||
@@ -4566,6 +4569,7 @@ func doPluginAuth(username, password string, pubKey []byte, ip, protocol string,
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return user, err
|
return user, err
|
||||||
}
|
}
|
||||||
|
executeAction(operationAdd, ActionExecutorSelf, "", actionObjectUser, user.Username, "", &user)
|
||||||
return provider.userExists(user.Username, "")
|
return provider.userExists(user.Username, "")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user