mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge remote-tracking branch 'origin/unstable' into unstable
This commit is contained in:
commit
610eec348b
2 changed files with 31 additions and 34 deletions
|
@ -15,24 +15,11 @@ base dc=yunohost,dc=org
|
||||||
# The LDAP protocol version to use.
|
# The LDAP protocol version to use.
|
||||||
#ldap_version 3
|
#ldap_version 3
|
||||||
|
|
||||||
# The DN to bind with for normal lookups.
|
|
||||||
#binddn cn=annonymous,dc=example,dc=net
|
|
||||||
#bindpw secret
|
|
||||||
|
|
||||||
# The DN used for password modifications by root.
|
|
||||||
#rootpwmoddn cn=admin,dc=example,dc=com
|
|
||||||
|
|
||||||
# SSL options
|
|
||||||
#ssl off
|
|
||||||
#tls_reqcert never
|
|
||||||
tls_cacertfile /etc/ssl/certs/ca-certificates.crt
|
|
||||||
|
|
||||||
# The search scope.
|
# The search scope.
|
||||||
#scope sub
|
#scope sub
|
||||||
|
|
||||||
|
# Build a full list of non-LDAP users on startup.
|
||||||
|
nss_initgroups_ignoreusers ALLLOCAL
|
||||||
|
|
||||||
|
# The minimum numeric user id to lookup.
|
||||||
|
nss_min_uid 1000
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -253,34 +253,44 @@ def app_map(app=None, raw=False, user=None):
|
||||||
app -- Specific app to map
|
app -- Specific app to map
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
apps = []
|
||||||
result = {}
|
result = {}
|
||||||
|
|
||||||
for app_id in os.listdir(apps_setting_path):
|
if app is not None:
|
||||||
if app and (app != app_id):
|
if not _is_installed(app):
|
||||||
continue
|
raise MoulinetteError(errno.EINVAL,
|
||||||
|
m18n.n('app_not_installed', app))
|
||||||
if user is not None:
|
apps = [app,]
|
||||||
app_dict = app_info(app=app_id, raw=True)
|
else:
|
||||||
if ('mode' not in app_dict['settings']) or ('mode' in app_dict['settings'] and app_dict['settings']['mode'] == 'private'):
|
apps = os.listdir(apps_setting_path)
|
||||||
if 'allowed_users' in app_dict['settings'] and user not in app_dict['settings']['allowed_users'].split(','):
|
|
||||||
continue
|
|
||||||
|
|
||||||
|
for app_id in apps:
|
||||||
with open(apps_setting_path + app_id +'/settings.yml') as f:
|
with open(apps_setting_path + app_id +'/settings.yml') as f:
|
||||||
app_settings = yaml.load(f)
|
app_settings = yaml.load(f)
|
||||||
|
if not isinstance(app_settings, dict):
|
||||||
|
continue
|
||||||
if 'domain' not in app_settings:
|
if 'domain' not in app_settings:
|
||||||
continue
|
continue
|
||||||
|
if user is not None:
|
||||||
|
if ('mode' not in app_settings \
|
||||||
|
or ('mode' in app_settings \
|
||||||
|
and app_settings['mode'] == 'private')) \
|
||||||
|
and 'allowed_users' in app_settings \
|
||||||
|
and user not in app_settings['allowed_users'].split(','):
|
||||||
|
continue
|
||||||
|
|
||||||
|
domain = app_settings['domain']
|
||||||
|
path = app_settings.get('path', '/')
|
||||||
|
|
||||||
if raw:
|
if raw:
|
||||||
if app_settings['domain'] not in result:
|
if domain not in result:
|
||||||
result[app_settings['domain']] = {}
|
result[domain] = {}
|
||||||
result[app_settings['domain']][app_settings['path']] = {
|
result[domain][path] = {
|
||||||
'label': app_settings['label'],
|
'label': app_settings['label'],
|
||||||
'id': app_settings['id']
|
'id': app_settings['id']
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
result[app_settings['domain']+app_settings['path']] = app_settings['label']
|
result[domain + path] = app_settings['label']
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue