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';"