Server fixes
This commit is contained in:
parent
fe9d31a076
commit
fccd921545
@ -23,7 +23,13 @@ class Middleware
|
|||||||
{
|
{
|
||||||
$container = Application::getContainer();
|
$container = Application::getContainer();
|
||||||
$uri = $request->getUri();
|
$uri = $request->getUri();
|
||||||
|
|
||||||
$path = $uri->getPath();
|
$path = $uri->getPath();
|
||||||
|
|
||||||
|
if (substr($path, 0, 1) != '/') {
|
||||||
|
$path = "/".$path;
|
||||||
|
}
|
||||||
|
|
||||||
$query = $uri->getQuery();
|
$query = $uri->getQuery();
|
||||||
|
|
||||||
// Check for an existing session
|
// Check for an existing session
|
||||||
@ -33,7 +39,7 @@ class Middleware
|
|||||||
// Redirect to the login page
|
// Redirect to the login page
|
||||||
if ($query !== "") {
|
if ($query !== "") {
|
||||||
return Redirect::create($request, $response, '/login?redirect='.$path."&".$query);
|
return Redirect::create($request, $response, '/login?redirect='.$path."&".$query);
|
||||||
} elseif ($path = "/") {
|
} elseif ($path === "/") {
|
||||||
return Redirect::create($request, $response, '/login');
|
return Redirect::create($request, $response, '/login');
|
||||||
} else {
|
} else {
|
||||||
return Redirect::create($request, $response, '/login?redirect='.$path);
|
return Redirect::create($request, $response, '/login?redirect='.$path);
|
||||||
|
@ -19,8 +19,8 @@ use Inforbank\Application\Auth\Middleware;
|
|||||||
use Inforbank\Application\Helper\Header;
|
use Inforbank\Application\Helper\Header;
|
||||||
use Inforbank\Application\Helper\Idob\Transactie;
|
use Inforbank\Application\Helper\Idob\Transactie;
|
||||||
use Inforbank\Application\Helper\Idob\Client;
|
use Inforbank\Application\Helper\Idob\Client;
|
||||||
use Inforbank\Application\Helper\Rekeningen;
|
use Inforbank\Application\Helper\Rekeningen as RekeningHelper;
|
||||||
use Inforbank\Application\Helper\Berichten;
|
use Inforbank\Application\Helper\Berichten as BerichtenHelper;
|
||||||
use Inforbank\Application\Helper\Overboekingen;
|
use Inforbank\Application\Helper\Overboekingen;
|
||||||
use Inforbank\Application\Helper\Redirect;
|
use Inforbank\Application\Helper\Redirect;
|
||||||
use Inforbank\Application\Helper\IBAN;
|
use Inforbank\Application\Helper\IBAN;
|
||||||
@ -35,7 +35,7 @@ class Idob
|
|||||||
$app->group('/idob', function () {
|
$app->group('/idob', function () {
|
||||||
$this->get('/betalen', function ($request, $response, $args) {
|
$this->get('/betalen', function ($request, $response, $args) {
|
||||||
$query = $request->getQueryParams();
|
$query = $request->getQueryParams();
|
||||||
$rekeningen = Rekeningen::getCurrentUserRekeningen();
|
$rekeningen = RekeningHelper::getCurrentUserRekeningen();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$transactie = Transactie::getTransactie($query['trxid']);
|
$transactie = Transactie::getTransactie($query['trxid']);
|
||||||
@ -84,7 +84,7 @@ class Idob
|
|||||||
Transactie::setTransactionStatus($transactie['transactieId'], 2);
|
Transactie::setTransactionStatus($transactie['transactieId'], 2);
|
||||||
|
|
||||||
// Do bericht
|
// Do bericht
|
||||||
Berichten::newBericht($this->auth->getUserID(), $naam, "Betaling met transactiereferentie " . $transactie['reference'] . " gelukt.");
|
BerichtenHelper::newBericht($this->auth->getUserID(), $naam, "Betaling met transactiereferentie " . $transactie['reference'] . " gelukt.");
|
||||||
|
|
||||||
$response = $response->withStatus(302);
|
$response = $response->withStatus(302);
|
||||||
$response = $response->withHeader('Location', $redirectUri . "?trxid=".$transactie['transactieId']);
|
$response = $response->withHeader('Location', $redirectUri . "?trxid=".$transactie['transactieId']);
|
||||||
|
Reference in New Issue
Block a user