mirror of
https://github.com/documize/community.git
synced 2025-07-19 13:19:43 +02:00
only show active users for selection in space-scoped lists
This commit is contained in:
parent
68107a4ea1
commit
b0fe7aff26
2 changed files with 7 additions and 2 deletions
|
@ -279,7 +279,7 @@ func GetFolderUsers(w http.ResponseWriter, r *http.Request) {
|
|||
switch folder.Type {
|
||||
case entity.FolderTypePublic:
|
||||
// return all users for team
|
||||
users, err = p.GetUsersForOrganization()
|
||||
users, err = p.GetActiveUsersForOrganization()
|
||||
break
|
||||
case entity.FolderTypePrivate:
|
||||
// just me
|
||||
|
|
|
@ -189,7 +189,12 @@ func (p *Persister) GetUsersForOrganization() (users []entity.User, err error) {
|
|||
// GetFolderUsers returns a slice containing all user records for given folder.
|
||||
func (p *Persister) GetFolderUsers(folderID string) (users []entity.User, err error) {
|
||||
err = Db.Select(&users,
|
||||
"SELECT id, refid, firstname, lastname, email, initials, password, salt, reset, created, revised FROM user WHERE refid IN (SELECT userid from labelrole WHERE orgid=? AND labelid=?) ORDER BY firstname,lastname", p.Context.OrgID, folderID)
|
||||
`SELECT u.id, u.refid, u.firstname, u.lastname, u.email, u.initials, u.password, u.salt, u.reset, u.created, u.revised
|
||||
FROM user u, account a
|
||||
WHERE u.refid IN (SELECT userid from labelrole WHERE orgid=? AND labelid=?)
|
||||
AND a.orgid=? AND u.refid = a.userid AND a.active=1
|
||||
ORDER BY u.firstname, u.lastname`,
|
||||
p.Context.OrgID, folderID, p.Context.OrgID)
|
||||
|
||||
if err != nil {
|
||||
log.Error(fmt.Sprintf("Unable to get all users for org %s", p.Context.OrgID), err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue