mirror of
https://github.com/YunoHost-Apps/question2answer_ynh.git
synced 2024-09-03 20:16:07 +02:00
Add LDAP integration
This commit is contained in:
parent
da7f4d6d73
commit
9a3fef2eff
8 changed files with 37 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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&
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
# COMMON VARIABLES
|
||||
#=================================================
|
||||
|
||||
ldap_login_commit=857ad8bf3ca891cb33fa6e8816ed0d3e198c1afc
|
||||
|
||||
#=================================================
|
||||
# PERSONAL HELPERS
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
#=================================================
|
||||
|
|
|
@ -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
|
||||
|
||||
#=================================================
|
||||
|
|
12
sources/patches/app-00-ldap-include.patch
Normal file
12
sources/patches/app-00-ldap-include.patch
Normal file
|
@ -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');
|
Loading…
Add table
Reference in a new issue