mirror of
https://github.com/YunoHost-Apps/nextcloud_ynh.git
synced 2024-09-03 19:55:57 +02:00
[fix] Correct ldap_email_attr and test config at installation
This commit is contained in:
parent
5d9232f082
commit
66920372d0
3 changed files with 8 additions and 7 deletions
|
@ -15,7 +15,7 @@
|
||||||
"ldap_base": "dc=yunohost,dc=org",
|
"ldap_base": "dc=yunohost,dc=org",
|
||||||
"ldap_base_groups": "dc=yunohost,dc=org",
|
"ldap_base_groups": "dc=yunohost,dc=org",
|
||||||
"ldap_base_users": "dc=yunohost,dc=org",
|
"ldap_base_users": "dc=yunohost,dc=org",
|
||||||
"ldap_email_attribute": "mail",
|
"ldap_email_attr": "mail",
|
||||||
"ldap_expert_username_attr": "uid",
|
"ldap_expert_username_attr": "uid",
|
||||||
"ldap_quota_attr": "mailQuota",
|
"ldap_quota_attr": "mailQuota",
|
||||||
"ldap_user_display_name": "cn",
|
"ldap_user_display_name": "cn",
|
||||||
|
|
|
@ -55,10 +55,10 @@ exec_as() {
|
||||||
shift 1
|
shift 1
|
||||||
|
|
||||||
if [[ $USER = $(whoami) ]]; then
|
if [[ $USER = $(whoami) ]]; then
|
||||||
eval $@
|
eval "$@"
|
||||||
else
|
else
|
||||||
# use sudo twice to be root and be allowed to use another user
|
# use sudo twice to be root and be allowed to use another user
|
||||||
sudo sudo -u "$USER" $@
|
sudo sudo -u "$USER" "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,5 +70,5 @@ exec_occ() {
|
||||||
shift 2
|
shift 2
|
||||||
|
|
||||||
(cd "$WORKDIR" && exec_as "$AS_USER" \
|
(cd "$WORKDIR" && exec_as "$AS_USER" \
|
||||||
php occ --no-interaction --quiet --no-ansi $@)
|
php occ --no-interaction --quiet --no-ansi "$@")
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,14 +107,15 @@ _exec_occ ldap:create-empty-config
|
||||||
_exec_occ config:import "$oc_conf"
|
_exec_occ config:import "$oc_conf"
|
||||||
sudo rm -f "$oc_conf"
|
sudo rm -f "$oc_conf"
|
||||||
|
|
||||||
|
# Check LDAP configuratio to see if everything worked well
|
||||||
|
_exec_occ ldap:test-config \'\' \
|
||||||
|
|| die "An error occured during LDAP configuration"
|
||||||
|
|
||||||
# Set the user as admin and delete admin user
|
# Set the user as admin and delete admin user
|
||||||
ynh_mysql_connect_as $dbuser $dbpass $dbname \
|
ynh_mysql_connect_as $dbuser $dbpass $dbname \
|
||||||
<<< "INSERT INTO oc_group_user VALUES ('admin','$admin');"
|
<<< "INSERT INTO oc_group_user VALUES ('admin','$admin');"
|
||||||
_exec_occ user:delete admin
|
_exec_occ user:delete admin
|
||||||
|
|
||||||
## Needed for Jessie/PHP5.6 compatibility
|
|
||||||
#sudo sed -i "s/;always_populate_raw/always_populate_raw/" /etc/php5/cli/php.ini
|
|
||||||
|
|
||||||
# Iterate over users to extend their home folder permissions - for the external
|
# Iterate over users to extend their home folder permissions - for the external
|
||||||
# storage plugin usage - and create relevant ownCloud directories
|
# storage plugin usage - and create relevant ownCloud directories
|
||||||
for u in $(ynh_user_list); do
|
for u in $(ynh_user_list); do
|
||||||
|
|
Loading…
Add table
Reference in a new issue