1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/question2answer_ynh.git synced 2024-09-03 20:16:07 +02:00
This commit is contained in:
Éric Gaspar 2023-03-29 19:10:54 +02:00 committed by Félix Piédallu
parent d509a80c83
commit 5d4a5c67b0
2 changed files with 6 additions and 6 deletions

View file

@ -27,6 +27,6 @@ INSERT INTO `qa_options` (`title`, `content`) VALUES
UPDATE `qa_users` SET `sessionsource` = 'ldap'; UPDATE `qa_users` SET `sessionsource` = 'ldap';
INSERT INTO `qa_userlogins` (`userid`, `source`, `identifier`, `identifiermd5`) VALUES INSERT INTO `qa_userlogins` (`userid`, `source`, `identifier`, `identifiermd5`) VALUES
((SELECT userid FROM `qa_users` WHERE `handle` = '__ADMIN__'), 'ldap', '__ADMIN_EMAIL__', UNHEX(MD5('__ADMIN_EMAIL__'))); ((SELECT userid FROM `qa_users` WHERE `handle` = '__ADMIN__'), 'ldap', '__EMAIL__', UNHEX(MD5('__EMAIL__')));
COMMIT; COMMIT;

View file

@ -73,6 +73,9 @@ ynh_add_config --template="../conf/qa-config.php" --destination="$install_dir/qa
chmod 400 "$install_dir/qa-config.php" chmod 400 "$install_dir/qa-config.php"
chown $app:$app "$install_dir/qa-config.php" chown $app:$app "$install_dir/qa-config.php"
# Calculate and store the config file checksum into the app settings
ynh_store_file_checksum --file="$install_dir/qa-config.php"
#================================================= #=================================================
# SETUP APPLICATION WITH CURL # SETUP APPLICATION WITH CURL
#================================================= #=================================================
@ -101,12 +104,9 @@ ynh_local_curl_csrf "/index.php?qa=admin&qa_1=general"\
"has_js=0" "has_js=0"
ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="../conf/ldap.sql" ynh_replace_string --match_string="__ADMIN__" --replace_string="$admin" --target_file="../conf/ldap.sql"
ynh_replace_string --match_string="__ADMIN_EMAIL__" --replace_string="$email" --target_file="../conf/ldap.sql" ynh_replace_string --match_string="__EMAIL__" --replace_string="$email" --target_file="../conf/ldap.sql"
mysql -u $db_user -p${db_pwd} $db_name < ../conf/ldap.sql
# Calculate and store the config file checksum into the app settings ynh_mysql_connect_as --user="$db_user" --password="$db_pwd" < ../conf/ldap.sql
ynh_store_file_checksum --file="$install_dir/qa-config.php"
ynh_store_file_checksum --file="$install_dir/.htaccess"
#================================================= #=================================================
# SECURE FILES AND DIRECTORIES # SECURE FILES AND DIRECTORIES