mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[mod] we never used those filtering/offset things
This commit is contained in:
parent
f41c2dd763
commit
56513bbdb1
2 changed files with 4 additions and 25 deletions
|
@ -241,18 +241,6 @@ domain:
|
|||
configuration:
|
||||
authenticate: all
|
||||
authenticator: ldap-anonymous
|
||||
arguments:
|
||||
-f:
|
||||
full: --filter
|
||||
help: LDAP filter used to search
|
||||
-l:
|
||||
full: --limit
|
||||
help: Maximum number of domain fetched
|
||||
type: int
|
||||
-o:
|
||||
full: --offset
|
||||
help: Starting number for domain fetching
|
||||
type: int
|
||||
|
||||
### domain_add()
|
||||
add:
|
||||
|
|
|
@ -43,7 +43,7 @@ from yunohost.service import service_regen_conf
|
|||
logger = getActionLogger('yunohost.domain')
|
||||
|
||||
|
||||
def domain_list(auth, filter=None, limit=None, offset=None):
|
||||
def domain_list(auth):
|
||||
"""
|
||||
List domains
|
||||
|
||||
|
@ -55,19 +55,10 @@ def domain_list(auth, filter=None, limit=None, offset=None):
|
|||
"""
|
||||
result_list = []
|
||||
|
||||
# Set default arguments values
|
||||
if offset is None:
|
||||
offset = 0
|
||||
if limit is None:
|
||||
limit = 1000
|
||||
if filter is None:
|
||||
filter = 'virtualdomain=*'
|
||||
result = auth.search('ou=domains,dc=yunohost,dc=org', 'virtualdomain=*', ['virtualdomain'])
|
||||
|
||||
result = auth.search('ou=domains,dc=yunohost,dc=org', filter, ['virtualdomain'])
|
||||
|
||||
if len(result) > offset and limit > 0:
|
||||
for domain in result[offset:offset + limit]:
|
||||
result_list.append(domain['virtualdomain'][0])
|
||||
for domain in result:
|
||||
result_list.append(domain['virtualdomain'][0])
|
||||
|
||||
return {'domains': result_list}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue