diff --git a/sources/.DS_Store b/sources/.DS_Store new file mode 100644 index 0000000..fdc4ab0 Binary files /dev/null and b/sources/.DS_Store differ diff --git a/sources/patches/.DS_Store b/sources/patches/.DS_Store new file mode 100644 index 0000000..5008ddf Binary files /dev/null and b/sources/patches/.DS_Store differ diff --git a/sources/patches/app-00-auth.patch b/sources/patches/app-00-auth.patch new file mode 100644 index 0000000..cd7b47f --- /dev/null +++ b/sources/patches/app-00-auth.patch @@ -0,0 +1,20 @@ +--- a/web/src/Controller/Authentication.php ++++ b/web/src/Controller/Authentication.php +@@ -34,9 +34,14 @@ + $success = false; + $template_vars = []; + +- if ($request->isMethod('POST')) { +- $user = $request->request->get('user'); +- $password = $request->request->get('password'); ++ if ($request->isMethod('POST') || isset($_SERVER['PHP_AUTH_USER'])) { ++ if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { ++ $user = $_SERVER['PHP_AUTH_USER']; ++ $password = $_SERVER['PHP_AUTH_PW']; ++ } else { ++ $user = $request->request->get('user'); ++ $password = $request->request->get('password'); ++ } + + if (empty($user) || empty($password)) { + $template_vars['error'] = $app['translator']->trans('messages.error_empty_fields'); diff --git a/sources/patches/app-00-add-http-auth.patch b/sources/patches/app-00-controller.patch similarity index 51% rename from sources/patches/app-00-add-http-auth.patch rename to sources/patches/app-00-controller.patch index abd4452..5f7dfde 100644 --- a/sources/patches/app-00-add-http-auth.patch +++ b/sources/patches/app-00-controller.patch @@ -1,6 +1,6 @@ --- a/web/app/controllers.php +++ b/web/app/controllers.php -@@ -58,14 +58,20 @@ $controllers->before(function(Request $request, Silex\Application $app) { +@@ -58,14 +58,20 @@ // processing the request if ($app['session']->has('username')) { $username = $app['session']->get('username'); @@ -27,27 +27,5 @@ + return; + } } - - if ($request->isXmlHttpRequest()) { -diff --git a/web/src/Controller/Authentication.php b/web/src/Controller/Authentication.php -index deebb751..134cc9a8 100644 ---- a/web/src/Controller/Authentication.php -+++ b/web/src/Controller/Authentication.php -@@ -34,9 +34,14 @@ class Authentication - $success = false; - $template_vars = []; - -- if ($request->isMethod('POST')) { -- $user = $request->request->get('user'); -- $password = $request->request->get('password'); -+ if ($request->isMethod('POST') || isset($_SERVER['PHP_AUTH_USER'])) { -+ if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { -+ $user = $_SERVER['PHP_AUTH_USER']; -+ $password = $_SERVER['PHP_AUTH_PW']; -+ } else { -+ $user = $request->request->get('user'); -+ $password = $request->request->get('password'); -+ } - - if (empty($user) || empty($password)) { - $template_vars['error'] = $app['translator']->trans('messages.error_empty_fields'); + + if (isset($app['auth.methods'])) {