Sanitize ldap_user

This commit is contained in:
yalh76
2019-07-09 01:10:33 +02:00
parent c367e46820
commit 1168c040d7
4 changed files with 25 additions and 4 deletions

View File

@@ -8,6 +8,7 @@
source _common.sh
source ynh_send_readme_to_admin__2
source ynh_sanitize_name
source /usr/share/yunohost/helpers
#=================================================
@@ -30,7 +31,7 @@ is_public=$YNH_APP_ARG_IS_PUBLIC
app=$YNH_APP_INSTANCE_NAME
ldap_user="${app}_ldap"
ldap_user=$(ynh_sanitize_name --name="${app}ldap")
ldap_password=$(ynh_string_random --length=8)
#=================================================
@@ -120,7 +121,7 @@ ynh_system_user_create --username=$app --home_dir="$final_path"
#=================================================
ynh_print_info --message="Creating LDAP user..."
yunohost user create $ldap_user --firstname $app --lastname $app --mail ${ldap_user}@$domain --password $ldap_password -q 0
yunohost user create $ldap_user --firstname $ldap_user --lastname $ldap_user --mail ${ldap_user}@$domain --password $ldap_password -q 0
#=================================================
# SETUP SYSTEMD