mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Merge branch 'bullseye' into admins
This commit is contained in:
commit
b84c1c24b4
7 changed files with 17 additions and 15 deletions
|
@ -23,7 +23,7 @@ autofix-translated-strings:
|
|||
script:
|
||||
# create a local branch that will overwrite distant one
|
||||
- git checkout -b "ci-autofix-translated-strings-${CI_COMMIT_REF_NAME}" --no-track
|
||||
- python3 maintenance/missing_i18n_keys --fix
|
||||
- python3 maintenance/missing_i18n_keys.py --fix
|
||||
- python3 maintenanceautofix_locale_format.py
|
||||
- '[ $(git diff -w | wc -l) != 0 ] || exit 0' # stop if there is nothing to commit
|
||||
- git commit -am "[CI] Reformat / remove stale translated strings" || true
|
||||
|
|
|
@ -69,7 +69,7 @@ def domain_list(exclude_subdomains=False):
|
|||
result = [
|
||||
entry["virtualdomain"][0]
|
||||
for entry in ldap.search(
|
||||
"ou=domains,dc=yunohost,dc=org", "virtualdomain=*", ["virtualdomain"]
|
||||
"ou=domains", "virtualdomain=*", ["virtualdomain"]
|
||||
)
|
||||
]
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ def user_permission_list(
|
|||
|
||||
ldap = _get_ldap_interface()
|
||||
permissions_infos = ldap.search(
|
||||
"ou=permission,dc=yunohost,dc=org",
|
||||
"ou=permission",
|
||||
"(objectclass=permissionYnh)",
|
||||
[
|
||||
"cn",
|
||||
|
@ -408,7 +408,7 @@ def permission_create(
|
|||
|
||||
# Validate uniqueness of permission in LDAP
|
||||
if ldap.get_conflict(
|
||||
{"cn": permission}, base_dn="ou=permission,dc=yunohost,dc=org"
|
||||
{"cn": permission}, base_dn="ou=permission"
|
||||
):
|
||||
raise YunohostValidationError("permission_already_exist", permission=permission)
|
||||
|
||||
|
|
|
@ -163,7 +163,7 @@ def _get_user_for_ssh(username, attrs=None):
|
|||
|
||||
ldap = _get_ldap_interface()
|
||||
user = ldap.search(
|
||||
"ou=users,dc=yunohost,dc=org",
|
||||
"ou=users",
|
||||
"(&(objectclass=person)(uid=%s))" % username,
|
||||
attrs,
|
||||
)
|
||||
|
|
|
@ -236,17 +236,17 @@ def check_LDAP_db_integrity():
|
|||
ldap = _get_ldap_interface()
|
||||
|
||||
user_search = ldap.search(
|
||||
"ou=users,dc=yunohost,dc=org",
|
||||
"ou=users",
|
||||
"(&(objectclass=person)(!(uid=root))(!(uid=nobody)))",
|
||||
["uid", "memberOf", "permission"],
|
||||
)
|
||||
group_search = ldap.search(
|
||||
"ou=groups,dc=yunohost,dc=org",
|
||||
"ou=groups",
|
||||
"(objectclass=groupOfNamesYnh)",
|
||||
["cn", "member", "memberUid", "permission"],
|
||||
)
|
||||
permission_search = ldap.search(
|
||||
"ou=permission,dc=yunohost,dc=org",
|
||||
"ou=permission",
|
||||
"(objectclass=permissionYnh)",
|
||||
["cn", "groupPermission", "inheritPermission", "memberUid"],
|
||||
)
|
||||
|
|
12
src/user.py
12
src/user.py
|
@ -111,7 +111,7 @@ def user_list(fields=None):
|
|||
|
||||
ldap = _get_ldap_interface()
|
||||
result = ldap.search(
|
||||
"ou=users,dc=yunohost,dc=org",
|
||||
"ou=users",
|
||||
"(&(objectclass=person)(!(uid=root))(!(uid=nobody)))",
|
||||
attrs,
|
||||
)
|
||||
|
@ -382,7 +382,7 @@ def user_update(
|
|||
ldap = _get_ldap_interface()
|
||||
attrs_to_fetch = ["givenName", "sn", "mail", "maildrop"]
|
||||
result = ldap.search(
|
||||
base="ou=users,dc=yunohost,dc=org",
|
||||
base="ou=users",
|
||||
filter="uid=" + username,
|
||||
attrs=attrs_to_fetch,
|
||||
)
|
||||
|
@ -551,7 +551,7 @@ def user_info(username):
|
|||
else:
|
||||
filter = "uid=" + username
|
||||
|
||||
result = ldap.search("ou=users,dc=yunohost,dc=org", filter, user_attrs)
|
||||
result = ldap.search("ou=users", filter, user_attrs)
|
||||
|
||||
if result:
|
||||
user = result[0]
|
||||
|
@ -951,7 +951,7 @@ def user_group_list(short=False, full=False, include_primary_groups=True):
|
|||
|
||||
ldap = _get_ldap_interface()
|
||||
groups_infos = ldap.search(
|
||||
"ou=groups,dc=yunohost,dc=org",
|
||||
"ou=groups",
|
||||
"(objectclass=groupOfNamesYnh)",
|
||||
["cn", "member", "permission"],
|
||||
)
|
||||
|
@ -1002,7 +1002,7 @@ def user_group_create(
|
|||
|
||||
# Validate uniqueness of groupname in LDAP
|
||||
conflict = ldap.get_conflict(
|
||||
{"cn": groupname}, base_dn="ou=groups,dc=yunohost,dc=org"
|
||||
{"cn": groupname}, base_dn="ou=groups"
|
||||
)
|
||||
if conflict:
|
||||
raise YunohostValidationError("group_already_exist", group=groupname)
|
||||
|
@ -1217,7 +1217,7 @@ def user_group_info(groupname):
|
|||
|
||||
# Fetch info for this group
|
||||
result = ldap.search(
|
||||
"ou=groups,dc=yunohost,dc=org",
|
||||
"ou=groups",
|
||||
"cn=" + groupname,
|
||||
["cn", "member", "permission"],
|
||||
)
|
||||
|
|
|
@ -140,6 +140,8 @@ class LDAPInterface:
|
|||
"""
|
||||
if not base:
|
||||
base = self.basedn
|
||||
else:
|
||||
base = base + "," + self.basedn
|
||||
|
||||
try:
|
||||
result = self.con.search_s(base, ldap.SCOPE_SUBTREE, filter, attrs)
|
||||
|
@ -241,7 +243,7 @@ class LDAPInterface:
|
|||
|
||||
"""
|
||||
dn = rdn + "," + self.basedn
|
||||
actual_entry = self.search(base=dn, attrs=None)
|
||||
actual_entry = self.search(rdn, attrs=None)
|
||||
ldif = modlist.modifyModlist(actual_entry[0], attr_dict, ignore_oldexistent=1)
|
||||
|
||||
if ldif == []:
|
||||
|
|
Loading…
Add table
Reference in a new issue