From a419d7b6f52aaeaf4c42284d963b901a7e1a012d Mon Sep 17 00:00:00 2001 From: ericgaspar Date: Sun, 1 May 2022 09:25:08 +0200 Subject: [PATCH] Add patch --- sources/.DS_Store | Bin 0 -> 6148 bytes sources/patches/.DS_Store | Bin 0 -> 6148 bytes sources/patches/app-00-auth.patch | 20 +++++++++++++ ...ttp-auth.patch => app-00-controller.patch} | 28 ++---------------- 4 files changed, 23 insertions(+), 25 deletions(-) create mode 100644 sources/.DS_Store create mode 100644 sources/patches/.DS_Store create mode 100644 sources/patches/app-00-auth.patch rename sources/patches/{app-00-add-http-auth.patch => app-00-controller.patch} (51%) diff --git a/sources/.DS_Store b/sources/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..fdc4ab0a909e15d299b333a000bf90035df4ba39 GIT binary patch literal 6148 zcmeHK%}(1u5S|Tb@wN!LQl+*M2TMJ0;gC>NI9e%is#Js#97>zoc-2_4?8tV=A&O-6 z0r~)NrR{UHeF+|f2ViD*g9@QX5TF@p_8ZUN+MlgmF93+nAZ`P=0N|h!HY5($2*pXK zq+vaTLigx_f-)MG{V1KvX2)G*fZp9K^dW=_4&a~nmq!>mi~4C&R;|{lXv{PpJ)U*s z6FDd6<=m&Bmk)y~tOjK#EV}MOki;qqi@hYSdOIrHNY$arJ{0f6N);a|c_+_POfYsB z?Ivp2b)Ub>vnot7Rp@@E$NpZD#rd$453;z_`L?;Xx5BE2edKFj)tXW1$gcZhG+JI; z@>bgI@sc-MU2UQL=IwYa9p}~J=Jw~ox9>;CCqI7v`u#^2fxs_T%QK4;_>0CBMh=4_ zOY`h2MkZC0Y({2)8DIwPBLj9VbDrMEo9BCG2AF{xWq{TP50%ijSR2$!2M+Z6Nbx2i z3EFg)AoMKy7HfkTK@p}D(Ub~%#1N(&{hrP9E!GB2IS4&7_OUYydqNR>S`YOLDhcJ)1}{p` j&|5L)(pLNuRSWt(G7x=>wL$ct@Q;9|fd^*bRv9=41?gg< literal 0 HcmV?d00001 diff --git a/sources/patches/.DS_Store b/sources/patches/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0isMethod('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'])) {