1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/limesurvey_ynh.git synced 2024-09-03 19:36:32 +02:00

[enh] Support private/public access to the admin

This commit is contained in:
ljf 2017-02-06 00:29:42 +01:00
parent 0f5c010f35
commit 65e319f926
3 changed files with 15 additions and 3 deletions

View file

@ -42,3 +42,7 @@ INSERT INTO `lime_plugin_settings` (`id`, `plugin_id`, `model`, `model_id`, `key
INSERT INTO `lime_settings_global` VALUES ('defaultlang','{{ language }}'),('AssetsVersion','2620');
INSERT INTO `lime_users` VALUES (1,'{{ admin }}','9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08','Administrator',0,'{{ language }}','','default','default','default',NULL,1,'2017-02-02 01:03:08',NULL);
{% if is_public == "1" %}
UPDATE `lime_plugin_settings` SET value='\"0\"' WHERE `id`=21;
{% endif %}

View file

@ -206,6 +206,14 @@ ynh_set_default_perm () {
|| echo "No file to modify"
}
ynh_sso_access () {
sudo yunohost app setting $app unprotected_uris -v "/"
if [[ $is_public -eq 0 ]]; then
sudo yunohost app setting $app protected_uris -v "$1"
fi
sudo yunohost app ssowatconf
}
ynh_read_manifest () {
python3 -c "import sys, json;print(json.load(open('../manifest.json'))['$1'])"
@ -237,6 +245,8 @@ EOF
}
# Create a system user
#
# usage: ynh_system_user_create user_name [home_dir]

View file

@ -55,9 +55,7 @@ sudo chmod u+w $data_path/upload
sudo chmod u+w $local_path/application/config/
sudo yunohost app addaccess $app -u $admin
sudo yunohost app setting $app unprotected_uris -v "/"
#sudo yunohost app setting $app protected_uris -v "/index.php?r=admin,/index.php?r=plugins,/scripts"
sudo yunohost app ssowatconf
ynh_sso_access "/index.php?r=admin,/index.php?r=plugins,/scripts"
ynh_configure_php_fpm
ynh_configure_nginx