mirror of
https://github.com/YunoHost-Apps/agendav_ynh.git
synced 2024-09-03 20:36:12 +02:00
Add patch
This commit is contained in:
parent
6546ee2cba
commit
a419d7b6f5
4 changed files with 23 additions and 25 deletions
BIN
sources/.DS_Store
vendored
Normal file
BIN
sources/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
sources/patches/.DS_Store
vendored
Normal file
BIN
sources/patches/.DS_Store
vendored
Normal file
Binary file not shown.
20
sources/patches/app-00-auth.patch
Normal file
20
sources/patches/app-00-auth.patch
Normal file
|
@ -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');
|
|
@ -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'])) {
|
Loading…
Add table
Reference in a new issue