Browse Source

[fix] Correct ldap_email_attr and test config at installation

pull/4/head
Jérôme Lebleu 10 years ago
parent
commit
66920372d0
  1. 2
      conf/config.json
  2. 6
      scripts/_common.sh
  3. 7
      scripts/install

2
conf/config.json

@ -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",

6
scripts/_common.sh

@ -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 "$@")
} }

7
scripts/install

@ -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…
Cancel
Save