diff --git a/scripts/install b/scripts/install index 1fce781..c38527c 100755 --- a/scripts/install +++ b/scripts/install @@ -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 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 #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index c3e4833..9824e1f 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -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 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 + + 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 #================================================= diff --git a/sources/patches/app-00-ldap-include.patch b/sources/patches/app-00-ldap-include.patch deleted file mode 100644 index d3d19e6..0000000 --- a/sources/patches/app-00-ldap-include.patch +++ /dev/null @@ -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');