From 46947632f835444358b774b3a780507e5e0f89aa Mon Sep 17 00:00:00 2001 From: Jimmy Monin Date: Sun, 19 Nov 2017 19:42:54 +0100 Subject: [PATCH] Fix missing LDAP plugin configuration --- conf/data.dat | 1 + scripts/install | 3 ++- scripts/upgrade | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 conf/data.dat diff --git a/conf/data.dat b/conf/data.dat new file mode 100644 index 0000000..853e9e2 --- /dev/null +++ b/conf/data.dat @@ -0,0 +1 @@ +a:11:{s:4:"host";s:0:"";s:6:"basedn";s:27:"ou=users,dc=yunohost,dc=org";s:4:"port";s:0:"";s:7:"ld_attr";s:3:"uid";s:9:"ld_binddn";s:0:"";s:9:"ld_bindpw";s:0:"";s:10:"ld_use_ssl";b:0;s:14:"allow_newusers";b:1;s:28:"advertise_admin_new_ldapuser";b:0;s:26:"send_password_by_mail_ldap";b:0;s:8:"ld_group";s:0:"";} \ No newline at end of file diff --git a/scripts/install b/scripts/install index 6b64b49..6796574 100644 --- a/scripts/install +++ b/scripts/install @@ -159,8 +159,9 @@ ynh_store_file_checksum "$final_path/local/config/database.inc.php" # ADD LDAP & FAIL2BAN PLUGINS #================================================= -# Activate LDAP plugin +# Configure and activate LDAP plugin ynh_mysql_connect_as $db_name $db_pwd $db_user <<< "INSERT INTO plugins (id,state,version) VALUES ('Ldap_Login','active','1.1');" +cp ../conf/data.dat $final_path/plugins/Ldap_Login # Configure and activate log_failed_logins plugin ynh_mysql_connect_as $db_name $db_pwd $db_user <<< "INSERT INTO plugins (id,state,version) VALUES ('log_failed_logins','active','1.2');" diff --git a/scripts/upgrade b/scripts/upgrade index 40d0016..0baf101 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -192,8 +192,9 @@ ynh_store_file_checksum "$final_path/local/config/database.inc.php" # ADD LDAP & FAIL2BAN PLUGINS #================================================= -# Activate ldap plugin +# Configure and activate LDAP plugin ynh_mysql_connect_as $db_name $db_pwd $db_user <<< "UPDATE plugins SET state='active' WHERE id='Ldap_Login';" +cp ../conf/data.dat $final_path/plugins/Ldap_Login # Configure and activate log_failed_logins plugin ynh_mysql_connect_as $db_name $db_pwd $db_user <<< "INSERT INTO plugins (id,state,version) VALUES ('log_failed_logins','active','1.2');" 2>&1 > /dev/null ||ynh_mysql_connect_as $db_name $db_pwd $db_user <<< "UPDATE plugins SET state='active' WHERE id='log_failed_logins';"