Skip to content

Commit

Permalink
Typo, rename referrer to referer
Browse files Browse the repository at this point in the history
  • Loading branch information
mxhash committed Oct 8, 2013
1 parent c8f714f commit 02c3963
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions lib/tkmon/TKMON/Action/Expose/System/Login.php
Expand Up @@ -58,7 +58,7 @@ public function actionIndex(ArrayObject $params)
$validator = new ArrayObjectValidator();
$validator->addValidatorObject(
ValidatorObject::create(
'referrer',
'referer',
'Referrer URL',
ValidatorObject::VALIDATE_ANYTHING,
null,
Expand All @@ -71,7 +71,7 @@ public function actionIndex(ArrayObject $params)

$output = new TwigTemplate($this->container['template']);
$output->setTemplateName('forms/login.twig');
$output['referrer'] = $params->get('referrer');
$output['referer'] = $params->get('referer');
return $output;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/tkmon/TKMON/Mvc/Dispatcher.php
Expand Up @@ -256,7 +256,7 @@ public function dispatchRequest()
if ($e->getCode() === \TKMON\Exception\DispatcherException::TYPE_UNAUTHORIZED) {
$response = new \TKMON\Mvc\Output\TwigTemplate($this->container['template']);
$response->setTemplateName('views/Common/SessionExpired.twig');
$response['referrer'] = $this->uri;
$response['referer'] = $this->uri;
return $this->renderTemplate($response->toString());
}
}
Expand Down
10 changes: 5 additions & 5 deletions share/tkmon/templates/forms/login.twig
@@ -1,6 +1,6 @@
{% set link_home = web_link("Index/Index") %}
{% if referrer is empty %}
{% set referrer = web_link("Index/Index") %}
{% if referer is empty %}
{% set referer = web_link("Index/Index") %}
{% endif %}

<div id="login-container">
Expand Down Expand Up @@ -44,16 +44,16 @@
<i class="icon-key"></i> {% trans "Login" %}
</button>

<input type="hidden" name="referrer" value="{{ referrer }}" />
<input type="hidden" name="referer" value="{{ referer }}" />
</form>
</div>

<script>
require(['jquery'], function($) {
window.redirectToTarget = function() {
var referrer = $('form#login input[name="referrer"]').val();
var referer = $('form#login input[name="referer"]').val();
setTimeout(function() {
window.location.href = referrer;
window.location.href = referer;
}, 1000);
};
});
Expand Down
6 changes: 3 additions & 3 deletions share/tkmon/templates/views/Common/SessionExpired.twig
@@ -1,7 +1,7 @@
{% set link_login = web_link('System/Login/Index') %}
{% set url_referrer = web_link(referrer) %}
{% if url_referrer %}
{% set link_login = link_login ~ '?referrer=' ~ url_referrer %}
{% set url_referer = web_link(referer) %}
{% if url_referer %}
{% set link_login = link_login ~ '?referer=' ~ url_referer %}
{% endif %}
<div class="page-header">
<h2>{% trans "Session expired" %}</h2>
Expand Down
4 changes: 3 additions & 1 deletion test/NETWAYS/Tests/Chain/DummyHandler1.php
Expand Up @@ -2,7 +2,9 @@

namespace NETWAYS\Tests\Chain;

class DummyHandler1 implements \NETWAYS\Chain\Interfaces\HandlerInterface
use NETWAYS\Chain\Interfaces\HandlerInterface;

class DummyHandler1 implements HandlerInterface
{

private $doThrow=false;
Expand Down

0 comments on commit 02c3963

Please sign in to comment.