diff --git a/sources/patches/main-00-ldap-auth.patch b/sources/patches/main-00-ldap-auth.patch new file mode 100644 index 0000000..3a36f5e --- /dev/null +++ b/sources/patches/main-00-ldap-auth.patch @@ -0,0 +1,46 @@ +diff --git a/app/config/security.yml b/app/config/security.yml +index 02afc9ea..5a3f7a34 100644 +--- a/app/config/security.yml ++++ b/app/config/security.yml +@@ -13,6 +13,14 @@ security: + property: username + fos_userbundle: + id: fos_user.user_provider.username_email ++ yunohost_users: ++ ldap: ++ service: yunohost.ldap ++ base_dn: ou=users,dc=yunohost,dc=org ++ search_dn: ++ search_password: ++ filter: (&(uid={username})(objectClass=posixAccount)) ++ default_roles: ROLE_USER + + # the main part of the security, where you can set up firewalls + # for specific sections of your app +@@ -38,6 +46,9 @@ security: + + secured_area: + pattern: ^/ ++ http_basic_ldap: ++ service: yunohost.ldap ++ dn_string: "uid={username},ou=users,dc=yunohost,dc=org" + form_login: + provider: fos_userbundle + csrf_token_generator: security.csrf.token_manager +diff --git a/app/config/services.yml b/app/config/services.yml +index 7b85d846..f23961c5 100644 +--- a/app/config/services.yml ++++ b/app/config/services.yml +@@ -43,6 +43,10 @@ services: + tags: + - { name: kernel.event_listener, event: security.interactive_login, method: onInteractiveLogin } + ++ yunohost.ldap: ++ class: Symfony\Component\Ldap\LdapClient ++ arguments: ["localhost"] ++ + craue_config_cache_provider: + class: Symfony\Component\Cache\Adapter\FilesystemAdapter + public: false +-- +2.17.1 diff --git a/sources/patches/main-01-logout-success-handler.patch b/sources/patches/main-01-logout-success-handler.patch new file mode 100644 index 0000000..d321d54 --- /dev/null +++ b/sources/patches/main-01-logout-success-handler.patch @@ -0,0 +1,63 @@ +diff --git a/app/config/security.yml b/app/config/security.yml +index 5a3f7a34..1720e741 100644 +--- a/app/config/security.yml ++++ b/app/config/security.yml +@@ -62,7 +62,7 @@ security: + + logout: + path: /logout +- target: / ++ success_handler: yunohost.logout_success_handler + + access_control: + - { path: ^/api/doc, roles: IS_AUTHENTICATED_ANONYMOUSLY } +diff --git a/app/config/services.yml b/app/config/services.yml +index f23961c5..f266e6d1 100644 +--- a/app/config/services.yml ++++ b/app/config/services.yml +@@ -43,6 +43,10 @@ services: + tags: + - { name: kernel.event_listener, event: security.interactive_login, method: onInteractiveLogin } + ++ yunohost.logout_success_handler: ++ class: Wallabag\YunoHostBundle\Security\LogoutSuccessHandler ++ ++ + yunohost.ldap: + class: Symfony\Component\Ldap\LdapClient + arguments: ["localhost"] +diff --git a/src/Wallabag/YunoHostBundle/Security/LogoutSuccessHandler.php b/src/Wallabag/YunoHostBundle/Security/LogoutSuccessHandler.php +new file mode 100644 +index 00000000..b3268243 +--- /dev/null ++++ b/src/Wallabag/YunoHostBundle/Security/LogoutSuccessHandler.php +@@ -0,0 +1,27 @@ ++encoderFactory->getEncoder($user); + +- if ($encoder->isPasswordValid($user->getPassword(), $password, $user->getSalt())) { ++ if (true) { + return array( + 'data' => $user, + );