diff --git a/README.md b/README.md index bee3128..b52d8d4 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ This app can be configured via its admin panel, available at `https://mydomain/m #### Multi-user support -This app supports multiuser, but is not integrated via LDAP nor SSO. +This app supports multiuser and LDAP, but is not integrated via SSO. The admin page is protected by SSOwat. #### Supported architectures diff --git a/README_fr.md b/README_fr.md index a820331..1803224 100644 --- a/README_fr.md +++ b/README_fr.md @@ -34,7 +34,7 @@ Cette application se configure via son interface administrateur, accessible sur #### Support multi-utilisateur -Cette application supporte le multiutilisateur, mais n'est pas intégrée avec le LDAP ni le SSO. +Cette application supporte le multiutilisateur et LDAP, mais n'est pas intégrée avec le SSO. Les pages d'administration sont protégées par SSOwat. #### Architectures supportées diff --git a/check_process b/check_process index 425f8a0..ddd27a7 100644 --- a/check_process +++ b/check_process @@ -6,7 +6,7 @@ is_public=1 (PUBLIC|public=1|private=0) q2a_name="ATestQ2ASite" admin="john" (USER) - password="pass" + password="password" ; Checks pkg_linter=1 setup_sub_dir=1 @@ -15,8 +15,11 @@ setup_private=1 setup_public=1 upgrade=1 - upgrade=0 from_commit=61a8347e52d061269e83a0db50b21cd66039f453 + upgrade=1 from_commit=928272bb6c3f68173d1f1fe8b11e48e3464c730e backup_restore=1 multi_instance=1 port_already_use=0 change_url=1 +;;; Upgrade options + ; commit=928272bb6c3f68173d1f1fe8b11e48e3464c730e + manifest_arg=domain=DOMAIN&path=PATH&language=fr&is_public=1&q2a_name=ATestQ2ASite&admin=USER&password=password& diff --git a/manifest.json b/manifest.json index 6c1df63..6385cb2 100644 --- a/manifest.json +++ b/manifest.json @@ -6,7 +6,7 @@ "en": "Platform for Question&Answer sites.", "fr": "Plateforme de Question/Réponses." }, - "version": "1.8.5~ynh1", + "version": "1.8.5~ynh2", "url": "https://www.question2answer.org/", "license": "GPL-2.0-or-later", "maintainer": { diff --git a/scripts/_common.sh b/scripts/_common.sh index 748c116..7fecaea 100644 --- a/scripts/_common.sh +++ b/scripts/_common.sh @@ -4,6 +4,8 @@ # COMMON VARIABLES #================================================= +ldap_login_commit=857ad8bf3ca891cb33fa6e8816ed0d3e198c1afc + #================================================= # PERSONAL HELPERS #================================================= diff --git a/scripts/install b/scripts/install index 3786fe2..1fce781 100755 --- a/scripts/install +++ b/scripts/install @@ -110,6 +110,16 @@ ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" +#================================================= +# DOWNLOAD AND UNPACK LDAP PLUGIN +#================================================= +ynh_script_progression --message="Setting up LDAP plugin..." --weight=3 + +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 + #================================================= # NGINX CONFIGURATION #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 5d490a5..c3e4833 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -84,6 +84,11 @@ then # Download, check integrity, uncompress and patch the source from app.src ynh_setup_source --dest_dir="$final_path" + + # Setup LDAP + 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 fi #================================================= diff --git a/sources/patches/app-00-ldap-include.patch b/sources/patches/app-00-ldap-include.patch new file mode 100644 index 0000000..d3d19e6 --- /dev/null +++ b/sources/patches/app-00-ldap-include.patch @@ -0,0 +1,12 @@ +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');