1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/dotclear2_ynh.git synced 2024-09-03 18:26:29 +02:00

Fix admin permissions and setup

This commit is contained in:
tituspijean 2023-10-11 21:39:51 +02:00
parent 71d3b856ff
commit 76ad8d900b
No known key found for this signature in database
GPG key ID: EF3B0D7CC0A94720
2 changed files with 10 additions and 0 deletions

View file

@ -42,6 +42,7 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen
[install.admin]
type = "user"
help.en = "Choose the Dotclear super user. By default, all users in the admin group will be admins of Dotclear."
[resources]
[resources.sources.latest]
@ -62,6 +63,9 @@ ram.runtime = "50M" # FIXME: replace with an **estimate** minimum ram requiremen
[resources.permissions]
main.url = "/"
admin.url = "/admin"
admin.show_tile = false
admin.allowed = "admins"
[resources.apt]
packages = "mariadb-server, php8.2, php8.2-fpm, php8.2-mbstring, php8.2-mysql, php-iconv, php8.2-xml, php8.2-cli, php8.2-intl, php8.2-ldap"

View file

@ -116,6 +116,9 @@ chown $app:$app "$php_config"
#=================================================
ynh_script_progression --message="Finalizing installation..." --weight=14
# Give the admin the proper permission and give temporary admin access to visitors
ynh_permission_update --permission="admin" --add="$admin" "visitors"
firstname=$(ynh_user_get_info --username=$admin --key=firstname)
lastname=$(ynh_user_get_info --username=$admin --key=lastname)
email=$(ynh_user_get_info --username=$admin --key=mail)
@ -127,6 +130,9 @@ installUrl="/admin/install/index.php"
ynh_local_curl $installUrl "u_email=$email" "u_firstname=$firstname" "u_name=$lastname" "u_login=$admin" "u_pwd=$password" "u_pwd2=$password"
# Remove visitor access to admin
ynh_permission_update --permission="admin" --remove="visitors"
#=================================================
# GENERIC FINALIZATION
#=================================================