1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/question2answer_ynh.git synced 2024-09-03 20:16:07 +02:00

Use ynh_replace_string instead of patch

This commit is contained in:
Nils VAN ZUIJLEN 2021-03-26 11:22:22 +01:00
parent 9a3fef2eff
commit ab9068ab2a
3 changed files with 10 additions and 12 deletions

View file

@ -120,6 +120,11 @@ wget -O qa-ldap-login.zip https://github.com/zakkak/qa-ldap-login/archive/$ldap_
unzip qa-ldap-login.zip -d $final_path/qa-plugin unzip qa-ldap-login.zip -d $final_path/qa-plugin
mv $final_path/qa-plugin/qa-ldap-login-$ldap_login_commit $final_path/qa-plugin/qa-ldap-login mv $final_path/qa-plugin/qa-ldap-login-$ldap_login_commit $final_path/qa-plugin/qa-ldap-login
ynh_replace_string\
--match_string="require_once QA_INCLUDE_DIR . 'db/selects.php';"\
--replace_string="require_once QA_INCLUDE_DIR . 'db/selects.php';\r\n require_once QA_INCLUDE_DIR . '../qa-plugin/qa-ldap-login/qa-ldap-process.php';"\
--target_file="$final_path/qa-include/pages/login.php"
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================

View file

@ -89,6 +89,11 @@ then
wget -O qa-ldap-login.zip https://github.com/zakkak/qa-ldap-login/archive/$ldap_login_commit.zip 2>&1 wget -O qa-ldap-login.zip https://github.com/zakkak/qa-ldap-login/archive/$ldap_login_commit.zip 2>&1
unzip qa-ldap-login.zip -d $final_path/qa-plugin unzip qa-ldap-login.zip -d $final_path/qa-plugin
mv $final_path/qa-plugin/qa-ldap-login-$ldap_login_commit $final_path/qa-plugin/qa-ldap-login mv $final_path/qa-plugin/qa-ldap-login-$ldap_login_commit $final_path/qa-plugin/qa-ldap-login
ynh_replace_string\
--match_string="require_once QA_INCLUDE_DIR . 'db/selects.php';"\
--replace_string="require_once QA_INCLUDE_DIR . 'db/selects.php';\r\n require_once QA_INCLUDE_DIR . '../qa-plugin/qa-ldap-login/qa-ldap-process.php';"\
--target_file="$final_path/qa-include/pages/login.php"
fi fi
#================================================= #=================================================

View file

@ -1,12 +0,0 @@
diff --git a/qa-include/pages/login.php b/qa-include/pages/login.php
index 12946ec..7983a34 100644
--- a/qa-include/pages/login.php
+++ b/qa-include/pages/login.php
@@ -57,6 +57,7 @@ if (qa_clicked('dologin') && (strlen($inemailhandle) || strlen($inpassword))) {
if (qa_user_limits_remaining(QA_LIMIT_LOGINS)) {
require_once QA_INCLUDE_DIR . 'db/users.php';
require_once QA_INCLUDE_DIR . 'db/selects.php';
+ require_once QA_INCLUDE_DIR . '../qa-plugin/qa-ldap-login/qa-ldap-process.php';
if (!qa_check_form_security_code('login', qa_post_text('code'))) {
$pageerror = qa_lang_html('misc/form_security_again');